/*
 * KARTIKAY A MATHUR — 3D RENDER COMPARATOR LIGHTBOX DESIGN SYSTEM
 * Specialized Split-Screen Inspection Engine for Cycles 5.0 PBR vs Clay Blockout
 * Architecture: Modular, Self-Contained, Zero-Dependency CSS
 * Strict Zero-Emoji Policy Enforced
 */

:root {
    --rc-accent-emerald: var(--accent-emerald, #11845c);
    --rc-accent-emerald-glow: rgba(17, 132, 92, 0.45);
    --rc-accent-mint: var(--accent-mint, #e9fae6);
    --rc-accent-mint-soft: rgba(233, 250, 230, 0.85);
    --rc-bg-void: var(--bg-void, #070908);
    --rc-bg-surface: var(--color-black-surface, #0c100e);
    --rc-bg-card: var(--color-black-card, #121815);
    --rc-bg-card-glass: rgba(18, 24, 21, 0.88);
    --rc-border-hairline: var(--border-hairline, rgba(233, 250, 230, 0.14));
    --rc-border-emerald: rgba(17, 132, 92, 0.45);
    --rc-text-primary: #e8e8e8;
    --rc-text-muted: #8f8f8f;
    --rc-font-heading: var(--font-thunder, 'Anton', 'Impact', sans-serif);
    --rc-font-mono: var(--font-mono, 'JetBrains Mono', monospace);
    --rc-font-body: var(--font-helvetica, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    --rc-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --rc-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   1. LIGHTBOX MODAL OVERLAY & BACKDROP
   ========================================================================= */
.rc-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10005;
    background: rgba(7, 9, 8, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 280ms var(--rc-ease-expo), visibility 280ms var(--rc-ease-expo);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    color: var(--rc-text-primary);
    font-family: var(--rc-font-body);
}

.rc-lightbox-overlay.rc-active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================================
   2. HEADER NAVIGATION & CONTROL BAR
   ========================================================================= */
.rc-header-bar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.75rem;
    background: var(--rc-bg-card-glass);
    border-bottom: 1px solid var(--rc-border-hairline);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: 1rem;
    flex-shrink: 0;
}

.rc-header-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 220px;
}

.rc-header-tag {
    font-family: var(--rc-font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--rc-accent-emerald);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-transform: uppercase;
}

.rc-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rc-accent-emerald);
    box-shadow: 0 0 8px var(--rc-accent-emerald);
    animation: rcPulse 2s ease-in-out infinite;
}

@keyframes rcPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.rc-header-title {
    font-family: var(--rc-font-heading);
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    color: var(--rc-accent-mint);
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}

/* View Mode Toggles (Split / Side-by-Side / A-B / Diff) */
.rc-mode-group {
    display: inline-flex;
    align-items: center;
    background: rgba(7, 9, 8, 0.75);
    border: 1px solid var(--rc-border-hairline);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.rc-mode-btn {
    background: transparent;
    border: none;
    color: var(--rc-text-muted);
    font-family: var(--rc-font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 180ms var(--rc-ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
}

.rc-mode-btn:hover {
    color: var(--rc-accent-mint);
    background: rgba(233, 250, 230, 0.06);
}

.rc-mode-btn.rc-active {
    background: var(--rc-accent-emerald);
    color: #ffffff;
    box-shadow: 0 0 12px var(--rc-accent-emerald-glow);
}

/* Controls Cluster (Zoom, Telemetry, Fullscreen, Close) */
.rc-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rc-btn-tool {
    background: rgba(7, 9, 8, 0.65);
    border: 1px solid var(--rc-border-hairline);
    color: var(--rc-text-muted);
    font-family: var(--rc-font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 180ms var(--rc-ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
}

.rc-btn-tool:hover {
    color: var(--rc-accent-mint);
    border-color: var(--rc-accent-emerald);
    background: rgba(17, 132, 92, 0.12);
}

.rc-btn-tool.rc-active {
    color: var(--rc-accent-mint);
    border-color: var(--rc-accent-emerald);
    background: rgba(17, 132, 92, 0.25);
}

.rc-btn-close {
    background: rgba(18, 24, 21, 0.95);
    border: 1px solid var(--rc-accent-mint);
    color: var(--rc-accent-mint);
    font-family: var(--rc-font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.4rem 0.95rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 180ms var(--rc-ease-expo);
    letter-spacing: 0.05em;
}

.rc-btn-close:hover {
    background: var(--rc-accent-mint);
    color: var(--rc-bg-void);
    box-shadow: 0 0 16px rgba(233, 250, 230, 0.35);
}

/* =========================================================================
   3. MAIN COMPARATOR VIEWPORT & STAGE
   ========================================================================= */
.rc-viewport {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rc-bg-void);
    cursor: default;
}

.rc-viewport.rc-panning {
    cursor: grab;
}

.rc-viewport.rc-is-dragging-pan {
    cursor: grabbing !important;
}

/* Zoom/Pan Scalable Stage Container */
.rc-stage {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
    touch-action: none;
}

.rc-media-wrapper {
    position: relative;
    max-width: calc(100vw - 3rem);
    max-height: calc(100vh - 12rem);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 0, 0, 0.75);
    border: 1px solid var(--rc-border-hairline);
    background: #000000;
    overflow: hidden;
}

/* Base Image Layers */
.rc-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 12rem);
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Final Render Layer (Base Layer) */
.rc-layer-final {
    position: relative;
    z-index: 1;
}

/* Clay Blockout Layer (Overlay Layer with Dynamic Clip-Path) */
.rc-layer-clay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    clip-path: inset(0 calc(100% - var(--rc-split-pos, 50%)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--rc-split-pos, 50%)) 0 0);
    will-change: clip-path;
}

.rc-layer-clay .rc-image {
    width: 100%;
    height: 100%;
}

/* Side-by-Side Dual Viewport Mode */
.rc-viewport.rc-mode-side-by-side .rc-media-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--rc-border-hairline);
}

.rc-viewport.rc-mode-side-by-side .rc-layer-clay {
    position: relative;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    border-right: 1px solid var(--rc-border-hairline);
}

.rc-viewport.rc-mode-side-by-side .rc-divider {
    display: none !important;
}

/* Difference / Blend Inspection Mode */
.rc-viewport.rc-mode-diff .rc-layer-clay {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    mix-blend-mode: difference;
    opacity: 0.95;
    filter: invert(1);
}

.rc-viewport.rc-mode-diff .rc-divider {
    display: none !important;
}

/* =========================================================================
   4. INTERACTIVE SPLIT DIVIDER & DRAGGABLE HANDLE
   ========================================================================= */
.rc-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--rc-split-pos, 50%);
    width: 2px;
    background: var(--rc-accent-mint);
    box-shadow: 0 0 10px var(--rc-accent-emerald-glow), 0 0 2px var(--rc-accent-mint);
    z-index: 10;
    cursor: ew-resize;
    transform: translateX(-50%);
    touch-action: none;
    transition: background 150ms ease;
}

.rc-divider::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -20px;
    right: -20px;
    cursor: ew-resize;
}

.rc-divider:hover,
.rc-divider.rc-active {
    background: #ffffff;
    box-shadow: 0 0 14px var(--rc-accent-emerald), 0 0 4px #ffffff;
}

.rc-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    background: var(--rc-bg-void);
    border: 1.5px solid var(--rc-accent-mint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8), 0 0 14px var(--rc-accent-emerald-glow);
    cursor: ew-resize;
    transition: transform 180ms var(--rc-ease-expo), border-color 180ms ease, box-shadow 180ms ease;
    user-select: none;
}

.rc-divider:hover .rc-handle,
.rc-divider.rc-active .rc-handle {
    transform: translate(-50%, -50%) scale(1.12);
    border-color: #ffffff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.9), 0 0 20px var(--rc-accent-emerald);
}

.rc-handle-chevrons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 20px;
    color: var(--rc-accent-mint);
    font-size: 0.65rem;
    font-family: var(--rc-font-mono);
    font-weight: 700;
    pointer-events: none;
}

.rc-split-badge {
    position: absolute;
    top: calc(50% + 32px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(7, 9, 8, 0.9);
    border: 1px solid var(--rc-border-hairline);
    color: var(--rc-accent-mint);
    font-family: var(--rc-font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 150ms ease;
}

/* Corner Watermark Badges */
.rc-badge-label {
    position: absolute;
    top: 1rem;
    z-index: 5;
    background: rgba(7, 9, 8, 0.85);
    border: 1px solid var(--rc-border-hairline);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-family: var(--rc-font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 200ms ease;
}

.rc-badge-left {
    left: 1rem;
    color: var(--rc-text-muted);
    border-left: 2px solid var(--rc-text-muted);
}

.rc-badge-right {
    right: 1rem;
    color: var(--rc-accent-mint);
    border-right: 2px solid var(--rc-accent-emerald);
}

.rc-viewport.rc-is-dragging-slider .rc-badge-label {
    opacity: 0.25;
}

/* =========================================================================
   5. CAMERA OPTICS & EXIF TELEMETRY OVERLAY HUD
   ========================================================================= */
.rc-telemetry-hud {
    position: absolute;
    bottom: 4.5rem;
    left: 1.5rem;
    z-index: 15;
    width: 320px;
    max-width: calc(100vw - 3rem);
    background: var(--rc-bg-card-glass);
    border: 1px solid var(--rc-border-hairline);
    border-radius: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(17, 132, 92, 0.15);
    transition: transform 260ms var(--rc-ease-expo), opacity 260ms var(--rc-ease-expo);
    overflow: hidden;
}

.rc-telemetry-hud.rc-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.rc-telemetry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.95rem;
    background: rgba(7, 9, 8, 0.6);
    border-bottom: 1px solid var(--rc-border-hairline);
    cursor: pointer;
}

.rc-telemetry-title {
    font-family: var(--rc-font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--rc-accent-mint);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rc-telemetry-pill {
    font-size: 0.58rem;
    background: var(--rc-accent-emerald);
    color: #ffffff;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-weight: 600;
}

.rc-telemetry-toggle-btn {
    background: transparent;
    border: none;
    color: var(--rc-text-muted);
    font-family: var(--rc-font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}

.rc-telemetry-content {
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 380px;
    overflow-y: auto;
}

.rc-telemetry-section-label {
    font-family: var(--rc-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--rc-accent-emerald);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.2rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px dashed rgba(233, 250, 230, 0.1);
}

.rc-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 0.8rem;
}

.rc-telemetry-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.rc-item-label {
    font-family: var(--rc-font-mono);
    font-size: 0.56rem;
    color: var(--rc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rc-item-val {
    font-family: var(--rc-font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rc-text-primary);
}

.rc-item-val.rc-highlight {
    color: var(--rc-accent-mint);
}

/* =========================================================================
   6. MINIMAP OVERVIEW (FOR HIGH-RES ZOOM INSPECTION)
   ========================================================================= */
.rc-minimap {
    position: absolute;
    bottom: 4.5rem;
    right: 1.5rem;
    z-index: 15;
    width: 140px;
    height: 90px;
    background: var(--rc-bg-void);
    border: 1px solid var(--rc-border-hairline);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.rc-minimap.rc-active {
    opacity: 1;
    pointer-events: auto;
}

.rc-minimap-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

.rc-minimap-viewport-rect {
    position: absolute;
    border: 1.5px solid var(--rc-accent-emerald);
    background: rgba(17, 132, 92, 0.25);
    box-shadow: 0 0 8px var(--rc-accent-emerald-glow);
    cursor: move;
}

/* =========================================================================
   7. SCENE PRESET DRAWER & CAROUSEL SELECTOR
   ========================================================================= */
.rc-scene-drawer {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    background: var(--rc-bg-card-glass);
    border-top: 1px solid var(--rc-border-hairline);
    padding: 0.5rem 1.25rem;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--rc-border-hairline) transparent;
    flex-shrink: 0;
}

.rc-drawer-label {
    font-family: var(--rc-font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--rc-text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    padding-right: 0.5rem;
    border-right: 1px solid var(--rc-border-hairline);
}

.rc-scene-pill {
    background: rgba(7, 9, 8, 0.65);
    border: 1px solid var(--rc-border-hairline);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 180ms var(--rc-ease-smooth);
    color: var(--rc-text-muted);
}

.rc-scene-pill:hover {
    color: var(--rc-accent-mint);
    border-color: var(--rc-accent-emerald);
    background: rgba(17, 132, 92, 0.12);
}

.rc-scene-pill.rc-active {
    background: rgba(17, 132, 92, 0.22);
    border-color: var(--rc-accent-emerald);
    color: var(--rc-accent-mint);
    box-shadow: 0 0 12px var(--rc-accent-emerald-glow);
}

.rc-pill-idx {
    font-family: var(--rc-font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--rc-accent-emerald);
}

.rc-scene-pill.rc-active .rc-pill-idx {
    color: #ffffff;
}

.rc-pill-title {
    font-family: var(--rc-font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* =========================================================================
   8. FOOTER TELEMETRY / SHORTCUTS HELPER BAR
   ========================================================================= */
.rc-footer-bar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1.75rem;
    background: rgba(7, 9, 8, 0.95);
    border-top: 1px solid var(--rc-border-hairline);
    font-family: var(--rc-font-mono);
    font-size: 0.6rem;
    color: var(--rc-text-muted);
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.rc-shortcut-chips {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
}

.rc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.rc-chip kbd {
    background: rgba(233, 250, 230, 0.08);
    border: 1px solid var(--rc-border-hairline);
    border-radius: 3px;
    padding: 0.05rem 0.3rem;
    font-size: 0.55rem;
    color: var(--rc-accent-mint);
}

/* =========================================================================
   9. RESPONSIVE GEOMETRY & MOBILE VIEWPORTS
   ========================================================================= */
@media (max-width: 900px) {
    .rc-header-bar {
        padding: 0.75rem 1rem;
    }
    .rc-header-title {
        max-width: 200px;
        font-size: 0.95rem;
    }
    .rc-mode-group {
        display: none;
    }
    .rc-telemetry-hud {
        left: 0.75rem;
        bottom: 4rem;
        width: 280px;
    }
    .rc-footer-bar {
        display: none;
    }
}

@media (max-width: 600px) {
    .rc-header-meta {
        min-width: 0;
    }
    .rc-header-tag {
        font-size: 0.55rem;
    }
    .rc-header-title {
        max-width: 140px;
        font-size: 0.85rem;
    }
    .rc-actions-group .rc-btn-tool {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
    }
    .rc-telemetry-hud {
        width: calc(100vw - 1.5rem);
        left: 0.75rem;
        bottom: 3.8rem;
    }
    .rc-badge-label {
        font-size: 0.58rem;
        padding: 0.25rem 0.5rem;
    }
}
