/**
 * DirectionZ™ Fullscreen Lightbox & Zoom Viewer Stylesheet
 */

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(5, 6, 8, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.lightbox-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    width: 95vw;
    height: 92vh;
    max-width: 1600px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    position: relative;
    transform: scale(0.97);
    transition: transform var(--transition-spring);
}

.lightbox-backdrop.active .lightbox-container {
    transform: scale(1);
}

/* Close & Nav controls */
.lightbox-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.lightbox-close-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

/* ==================== Enhanced Lightbox Navigators ==================== */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(10, 12, 18, 0.78);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    z-index: 50;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    outline: none;
}

.lightbox-nav-btn i {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.lightbox-nav-btn:hover {
    background: var(--accent-primary, #38bdf8);
    color: #030712;
    border-color: #38bdf8;
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.65), 0 12px 35px rgba(0, 0, 0, 0.65);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-prev {
    left: 1.5rem;
}

.lightbox-nav-next {
    right: 1.5rem;
}

.lightbox-nav-prev:hover i {
    transform: translateX(-3px);
}

.lightbox-nav-next:hover i {
    transform: translateX(3px);
}

.lightbox-nav-btn:active {
    transform: translateY(-50%) scale(0.94);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.45);
}

/* Tooltip Hint Bubble */
.nav-hint-bubble {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(8, 10, 15, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    padding: 0.32rem 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 60;
}

.lightbox-nav-btn:hover .nav-hint-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-hint-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.nav-hint-key {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.08rem 0.32rem;
    line-height: 1.1;
}

/* Fade out navigators during 2x pixel inspection zoom */
.lightbox-viewer.zoomed .lightbox-nav-btn {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease;
}

/* Left: Image Viewer Area */
.lightbox-viewer {
    flex: 1;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    user-select: none;
    cursor: zoom-in;
}

.lightbox-viewer.zoomed {
    cursor: grab;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: auto;
}

.lightbox-viewer.zoomed:active {
    cursor: grabbing;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-viewer.zoomed .lightbox-image {
    max-width: none;
    max-height: none;
    transform-origin: top left;
}

.lightbox-zoom-hint {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    pointer-events: none;
}

/* Right: Inspector Sidebar */
.lightbox-sidebar {
    width: 420px;
    min-width: 380px;
    height: 100%;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    gap: 1.25rem;
    box-sizing: border-box;
}

.lightbox-sidebar::-webkit-scrollbar {
    width: 6px;
}

.lightbox-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}

/* Curator & Management Header */
.lightbox-curator-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 2.75rem; /* Avoid close button collision on desktop */
    gap: 0.75rem;
    min-width: 0;
}

.lightbox-curator {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.lightbox-curator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-surface);
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(56, 189, 248, 0.25);
    flex-shrink: 0;
}

.lightbox-curator-meta {
    min-width: 0;
}

.lightbox-curator-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-curator-date {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.lightbox-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.lightbox-subtle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.lightbox-subtle-btn.edit:hover {
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
}

.lightbox-subtle-btn.delete {
    color: #f87171;
}

.lightbox-subtle-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Title & Description Block */
.lightbox-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lightbox-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--text-primary);
}

.lightbox-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-primary);
    padding: 0.55rem 0.8rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Studio Action Toolbar */
.lightbox-action-toolbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.lightbox-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    min-width: 0;
}

.lightbox-tool-btn i {
    font-size: 0.95rem;
}

.lightbox-tool-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.lightbox-tool-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px var(--accent-glow);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-tool-btn.primary:hover {
    background: linear-gradient(135deg, #7175f5 0%, var(--accent-hover) 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-2px);
}

.lightbox-tool-btn.active-saved {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.lightbox-tool-btn.active-saved:hover {
    background: rgba(16, 185, 129, 0.28);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.55);
    transform: translateY(-1px);
}

/* Inspector Sections General */
.inspector-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.inspector-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.heading-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.heading-left i {
    color: var(--accent-primary);
    font-size: 0.75rem;
}

/* Palette Studio Section */
.palette-studio-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
}

.palette-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.palette-copy-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.palette-swatches-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
}

.swatch-card {
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 0.3rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.swatch-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.swatch-hex {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    font-weight: 700;
    background: rgba(10, 12, 18, 0.78);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    letter-spacing: -0.01em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-width: 90%;
    text-align: center;
    transition: all var(--transition-fast);
}

.swatch-card.copied .swatch-hex {
    background: #22c55e;
    color: #0b0f19;
    font-weight: 800;
}

/* Studio Specs Grid */
.specs-studio-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
}

.specs-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.spec-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.spec-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.spec-card.clickable {
    cursor: pointer;
}

.spec-card.clickable:hover {
    background: var(--bg-elevated);
}

.spec-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.spec-label i {
    font-size: 0.68rem;
    opacity: 0.8;
}

.spec-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.spec-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-block;
    flex-shrink: 0;
}

.spec-chip-badge {
    font-size: 0.62rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-weight: 500;
    margin-left: 0.2rem;
    text-transform: none;
}

/* Reference Outbound Source Card */
.source-link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

.source-link-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

.source-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.source-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.source-domain {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-action {
    font-size: 0.72rem;
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Moodboard Chips */
.lightbox-boards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.lightbox-board-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.lightbox-board-chip:hover {
    background: var(--accent-surface);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Tags Cloud */
.lightbox-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lightbox-tag-pill {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.lightbox-tag-pill:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.08);
}

/* Sidebar Footer (Standalone Page Link) */
.lightbox-sidebar-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.lightbox-standalone-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.lightbox-standalone-link:hover {
    background: var(--bg-elevated);
    color: var(--accent-primary);
    border-color: rgba(56, 189, 248, 0.4);
}

/* Responsive Lightbox */
@media (max-width: 960px) {
    .lightbox-container {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        overflow-x: hidden;
    }
    .lightbox-viewer {
        height: 48vh;
        width: 100%;
        min-height: 220px;
        flex-shrink: 0;
        overflow-x: hidden;
    }
    .lightbox-sidebar {
        width: 100%;
        min-width: 0;
        height: 52vh;
        flex: 1;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        padding: 1.25rem 1rem;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
    }
    .lightbox-curator-row {
        padding-right: 0;
    }
    .lightbox-close-btn {
        top: 0.75rem;
        right: 0.75rem;
        width: 38px;
        height: 38px;
        background: rgba(15, 17, 23, 0.9);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.25);
        z-index: 100;
    }
    .lightbox-nav-btn {
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
    }
    .lightbox-nav-prev { left: 0.65rem; }
    .lightbox-nav-next { right: 0.65rem; }
    .nav-hint-bubble { display: none !important; }
    .palette-swatches-grid {
        gap: 0.35rem;
    }
    .swatch-card {
        height: 52px;
    }
}

@media (max-width: 480px) {
    .lightbox-viewer {
        height: 40vh;
        min-height: 180px;
    }
    .lightbox-sidebar {
        height: 60vh;
        padding: 1rem 0.85rem;
        gap: 0.85rem;
    }
    .lightbox-title {
        font-size: 1.15rem;
    }
    .lightbox-action-toolbar {
        gap: 0.35rem;
        padding: 0.3rem;
    }
    .lightbox-tool-btn {
        padding: 0.5rem 0.2rem;
        font-size: 0.68rem;
    }
    .lightbox-tool-btn i {
        font-size: 0.88rem;
    }
    .palette-swatches-grid {
        gap: 0.25rem;
    }
    .swatch-card {
        height: 46px;
    }
    .swatch-hex {
        font-size: 0.58rem;
        padding: 0.1rem 0.2rem;
    }
    .specs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }
    .spec-card {
        padding: 0.5rem 0.55rem;
    }
    .spec-value {
        font-size: 0.76rem;
    }
}

/* Standalone Pin View Page Grid Layout */
.pin-standalone-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 960px) {
    .pin-standalone-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

