/* CineMatch Premium Research Portfolio — GitHub Pages Edition */
/* Neon Tech Design System | Zero Emojis | Professional Grade */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700&family=Outfit:wght@400;600;900&family=JetBrains+Mono:wght@400&display=swap');

/* ============ DESIGN TOKENS ============ */
:root {
    --bg-color: #0a0b10;
    --card-bg: rgba(18, 20, 30, 0.7);
    --accent-red: #ff3e3e;
    --accent-gold: #ffcc00;
    --accent-green: #00ff41;
    --accent-blue: #00d2ff;
    --text-main: #e2e8f0;
    --text-muted: #888;
    --text-dim: #aaa;
    --glass: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-dim: rgba(255, 255, 255, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    /* Grid Spacing System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
}

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(ellipse at 20% 30%, #10121a 0%, var(--bg-color) 60%, #05060a 100%);
    font-family: var(--font-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Cinematic Stardust Particles */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.12;
    z-index: -2;
    animation: stardustMove 120s linear infinite;
    pointer-events: none;
}

@keyframes stardustMove {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-50%, -50%);
    }
}

/* ============ NAVIGATION BAR ============ */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 20px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.22rem;
    background: linear-gradient(90deg, #fff, var(--accent-red));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
    text-transform: uppercase;
}

/* ============ APP LAYOUT ============ */
.app-layout {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 80px);
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 280px;
    min-width: 280px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid var(--border-dim);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Use full height */
    gap: var(--space-lg);
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-metrics {
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 2.2;
    letter-spacing: 0.5px;
}

.metric-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.status-active {
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.sidebar-divider {
    margin: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-info {
    background: rgba(0, 100, 255, 0.08);
    border: 1px solid rgba(0, 100, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #8ac4ff;
    margin-bottom: 15px;
    line-height: 1.5;
}

.sidebar-caption {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #00cc33);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.sidebar-code {
    background: #000;
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: pre;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    padding: 28px 40px;
    min-width: 0;
}

/* ============ TAB SYSTEM ============ */
.tabs-container {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ TYPOGRAPHY ============ */
.section-heading {
    color: #fff;
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.mono-description {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.mono-body {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
}

.mono-body p {
    margin-bottom: 12px;
}

.mono-body ul {
    margin-left: 20px;
    margin-top: 8px;
}

.mono-body li {
    margin-bottom: 4px;
}

.mono-small {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ============ HERO SECTION ============ */
.hero-box {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8)), url('https://images.unsplash.com/photo-1478720568477-152d9b164e26?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-box::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, var(--bg-color));
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -2px;
    position: relative;
    z-index: 1;
    color: #fff;
}

.hero-subtitle-wrapper {
    display: block;
    margin: 0 auto;
    width: max-content;
    max-width: 90vw;
    position: relative;
    z-index: 10;
}

.hero-subtitle {
    color: #cbd5e0;
    font-family: var(--font-mono);
    font-size: 1rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
    /* For typewriter */
    border-right: 2px solid var(--accent-red);
    /* Cursor */
    white-space: nowrap;
    width: 0;
    display: block;
    text-align: left;
    animation:
        typewriter 3s steps(64, end) 1s forwards,
        blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent-red)
    }
}

/* ============ SEARCH AREA ============ */
.search-row {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
}

.search-col {
    width: 100%;
    max-width: 640px;
}

.search-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.select-wrapper {
    position: relative;
}

.movie-select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.movie-select:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 62, 62, 0.2);
}

.movie-select::placeholder {
    color: #555;
}

/* ============ AUTOCOMPLETE ============ */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0e1117;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-dropdown.visible {
    display: block;
}

.autocomplete-item {
    padding: 10px 18px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: rgba(255, 62, 62, 0.15);
    color: #fff;
}

/* ============ SIGMA BADGE ============ */
.sigma-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 2px;
    margin-right: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    min-width: 80px;
    text-align: center;
}

/* ============ TECH HEADER ============ */
.tech-header {
    border-left: 4px solid var(--accent-red);
    padding: 10px 18px;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 62, 62, 0.08), transparent);
    margin: 0.75rem 0;
    font-size: 0.96rem;
}

/* ============ MOVIE CARDS (Glassmorphism) ============ */
.movie-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 12px;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.movie-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--accent-red);
    box-shadow: 0 30px 60px rgba(255, 62, 62, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.poster-img {
    width: 100%;
    border-radius: 16px;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: all 0.8s ease;
    filter: brightness(0.9);
}

.movie-card:hover .poster-img {
    filter: brightness(1.1);
    transform: scale(1.03);
}

/* ============ PRIMARY TARGET ============ */
.primary-target {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    align-items: start;
}

.primary-poster .movie-card {
    border-color: var(--accent-green);
    height: auto;
}

.primary-details h1 {
    color: #fff;
    margin-bottom: 0;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 2.2rem;
    letter-spacing: -1px;
}

.vibe-tag {
    margin-top: 12px;
}

.detail-badges {
    margin: 15px 0;
}

.wiki-block {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid var(--accent-red);
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.6;
}

/* ============ RECOMMENDATIONS GRID ============ */
.recs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

.rec-card {
    text-align: center;
}

.rec-card .movie-card {
    height: auto;
    margin-bottom: var(--space-sm);
}

.rec-btn {
    background: linear-gradient(45deg, var(--accent-red), #ff6b6b);
    color: white;
    border-radius: 100px;
    padding: 8px 16px;
    font-weight: 700;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(255, 62, 62, 0.3);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    width: 100%;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

.explain-btn {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    width: 100%;
    cursor: pointer;
    margin-bottom: var(--space-sm);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.explain-btn:hover {
    background: rgba(255, 204, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.2);
}

.rec-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 62, 62, 0.5);
}

.movie-title-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.3;
    margin: var(--space-sm) 0;
    font-weight: 700;
}

/* Trailer */
.trailer-embed {
    margin-top: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.trailer-embed iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: var(--radius-md);
}

/* ============ COSINE SCORE ============ */
.cosine-display {
    background: rgba(0, 0, 0, 0.5);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid #333;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cosine-score {
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.feature-breakdown {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
}

.feature-header {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: var(--space-xs);
    font-family: var(--font-mono);
}

.feat-name {
    color: var(--text-dim);
}

.feat-score {
    color: var(--accent-gold);
    font-weight: 700;
}

/* ============ LOADING STATES ============ */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 62, 62, 0.2);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.computing-msg {
    text-align: center;
    padding: 30px;
    font-family: var(--font-mono);
    color: var(--accent-red);
    font-size: 0.9rem;
    letter-spacing: 1px;
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

/* ============ PIPELINE TAB ============ */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.pipeline-col {
    background: var(--glass);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dim);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pipeline-col .sigma-badge {
    display: block;
    width: fit-content;
    margin-bottom: 16px;
}

.pipeline-col:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.pipeline-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.pipeline-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.5;
}

.pipeline-list li:last-child {
    border-bottom: none;
}

/* Pipeline Stages */
.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stage-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--accent-red);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: all 0.3s;
}

.stage-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.stage-number {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
    margin-bottom: 6px;
}

.stage-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stage-desc {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Pipeline Stages Grid (6-card grid) */
.pipeline-stages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.pipeline-stage-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--accent-red);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: all 0.3s ease;
}

.pipeline-stage-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
    border-left-color: var(--accent-gold);
}

.pipeline-stage-card:nth-child(even) {
    border-left-color: var(--accent-blue);
}

.pipeline-stage-card:nth-child(even):hover {
    border-left-color: var(--accent-gold);
}

/* ============ RESEARCH CONTAINER (Academic) ============ */
.research-container {
    background: var(--glass);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.archives-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.archives-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.section-divider {
    margin: 40px 0;
    border-top: 1px dashed #444;
}

.formula-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid #333;
    margin-top: 10px;
}

.formula-display {
    text-align: center;
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-size: 1.1rem;
    margin: 15px 0;
    letter-spacing: 1px;
}

.archives-stats {
    display: flex;
    align-items: center;
    gap: 48px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.archives-stats .tech-header {
    margin: 0;
    white-space: nowrap;
}

/* Metrics in Academic tab */
.metric-block {
    margin-bottom: 0;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    font-weight: 700;
}

/* ============ EXPANDERS ============ */
.expander {
    background: var(--glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.expander:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.expander-header {
    padding: 15px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #fff;
    position: relative;
    user-select: none;
}

.expander-header::after {
    content: "▶";
    position: absolute;
    right: 20px;
    transition: transform 0.3s;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.expander.open .expander-header::after {
    transform: rotate(90deg);
}

.expander-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.expander.open .expander-content {
    max-height: 300px;
    padding: 0 20px 20px;
}

.code-block {
    background: #000;
    border-radius: var(--radius-md);
    border: 1px solid #333;
    padding: 1rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-green);
    overflow-x: auto;
    margin-top: 10px;
}

/* ============ EVALUATION TAB ============ */
.eval-metadata {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: var(--radius-md);
    border-left: 5px solid var(--accent-red);
    margin-bottom: 30px;
    color: white;
}

.eval-main-title {
    margin-top: 0;
    color: var(--accent-red);
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 1px;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.eval-section-title {
    color: #fff;
    margin-top: 25px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
}

.eval-list {
    font-size: 0.85rem;
    color: #ccc;
    font-family: var(--font-mono);
    line-height: 1.8;
    margin-left: 20px;
    margin-top: 8px;
}

.eval-metrics-grid {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.eval-metric-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    flex: 1;
    min-width: 250px;
    transition: all 0.3s;
}

.eval-metric-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.eval-metric-title {
    font-family: var(--font-display);
    font-size: 1rem;
}

.eval-metric-body {
    font-size: 0.8rem;
    color: #bbb;
    margin-top: 8px;
    font-family: var(--font-mono);
    line-height: 1.5;
}

.eval-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.eval-result-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
}

.eval-result-card:hover {
    border-color: var(--accent-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 62, 62, 0.15);
}

.eval-result-method {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.eval-result-metric {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.eval-result-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.eval-result-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
}

.eval-result-bar {
    margin-top: 12px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.eval-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* ============ FOOTER ============ */
.app-footer {
    text-align: center;
    color: #555;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 40px 20px;
}

.footer-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.status-dot-inline {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
    margin-right: 4px;
}

/* Glowing Pulse */
@keyframes pulse {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 0px var(--accent-red);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 15px var(--accent-green);
    }

    100% {
        opacity: 0.5;
        box-shadow: 0 0 0px var(--accent-red);
    }
}

/* ============ CUSTOM SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #1a1b26;
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-dim);
        padding: 15px 20px;
    }

    .sidebar-metrics {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
    }

    .primary-target {
        grid-template-columns: 1fr;
    }

    .recs-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .archives-top,
    .archives-bottom {
        grid-template-columns: 1fr;
    }

    .eval-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 1rem;
        gap: 10px;
        margin-bottom: 0;
    }

    .brand {
        font-size: 1.5rem;
    }

    .hero-box {
        padding: 3rem 1rem;
        border-radius: 15px;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }

    .research-container {
        padding: 1.5rem;
    }

    .pipeline-grid {
        grid-template-columns: 1fr;
    }

    .recs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs-container {
        gap: 0;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.65rem;
    }

    .main-content {
        padding: 15px;
    }

    .pipeline-stages {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
    }

    .sigma-badge {
        font-size: 0.6rem;
        padding: 2px 8px;
        letter-spacing: 1px;
    }

    .recs-grid {
        grid-template-columns: 1fr;
    }

    .primary-details h1 {
        font-size: 1.5rem;
    }
}

/* ============ THEME TOGGLE BUTTON ============ */
.theme-toggle-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--accent-blue);
}

/* ============ FEATURE BREAKDOWN (Explainability) ============ */
.cosine-score-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

.cosine-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.cosine-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.shared-features-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.features-table {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.feature-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.feature-row:last-child {
    border-bottom: none;
}

.feat-name {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #ccc;
}

.feat-score {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-gold);
    font-weight: 700;
}

/* ============ EXPLAIN BUTTON ============ */
.explain-btn {
    width: 100%;
    padding: 7px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.explain-btn:hover {
    background: rgba(255, 204, 0, 0.1);
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.15);
}

/* Feature breakdown container (toggled by EXPLAIN button) */
.feature-breakdown {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============ LIGHT MODE ============ */
body[data-theme="light"] {
    /* Linen & Ink Palette */
    --bg-color: #fafaf5;
    /* Warm Linen/Ivory */
    --card-bg: #ffffff;
    /* Elevated Surface */
    --text-main: #0f172a;
    /* Deep Ink */
    --text-muted: #334155;
    /* Slate Blue/Grey */
    --text-dim: #64748b;
    /* Light Slate */
    --accent-red: #e11d48;
    /* Primal Ruby */
    --accent-green: #10b981;
    /* Emerald Ink */
    --accent-gold: #b45309;
    /* Deep Gold */
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-dim: rgba(15, 23, 42, 0.04);
    --glass: rgba(255, 255, 255, 0.85);

    /* Layered Elevation Tokens */
    --shadow-elevation-low: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-elevation-mid: 0 12px 24px rgba(15, 23, 42, 0.06);
    --shadow-elevation-high: 0 30px 60px rgba(15, 23, 42, 0.1);

    background: radial-gradient(circle at 50% 100%, #f1f5f9 0%, var(--bg-color) 100%);
    color: var(--text-main);
}

body[data-theme="light"]::before {
    opacity: 0.05;
    filter: sepia(0.1) contrast(1.05);
}

body[data-theme="light"] .nav-container {
    background: var(--glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-low);
}

body[data-theme="light"] .brand {
    background: linear-gradient(90deg, #0f172a, #e11d48);
    background-clip: text;
    -webkit-background-clip: text;
    text-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

body[data-theme="light"] .sidebar {
    background: #ffffff;
    backdrop-filter: none;
    border-right: 1px solid var(--border-subtle);
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.03);
}

body[data-theme="light"] .sidebar-metrics span:not(.sigma-badge) {
    color: #475569 !important;
}

body[data-theme="light"] .sidebar-info {
    background: rgba(0, 100, 255, 0.05);
    border-color: rgba(0, 100, 255, 0.15);
    color: #2563eb;
}

body[data-theme="light"] .sidebar-code {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

body[data-theme="light"] .sidebar-caption {
    color: #888;
}

body[data-theme="light"] .tab-btn {
    color: #64748b;
}

body[data-theme="light"] .tab-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .tab-btn.active {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

body[data-theme="light"] .hero-box {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    background: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.8)), url('https://images.unsplash.com/photo-1478720568477-152d9b164e26?auto=format&fit=crop&q=80&w=2000');
}

body[data-theme="light"] .hero-box::before {
    background: linear-gradient(transparent, #f8fafc);
}

body[data-theme="light"] .hero-title {
    color: #0f172a;
    text-shadow: 0 4px 12px rgba(255, 255, 255, 0.5);
}

body[data-theme="light"] .hero-subtitle {
    color: #475569;
}

body[data-theme="light"] .movie-select {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a2e;
}

body[data-theme="light"] .movie-select::placeholder {
    color: #aaa;
}

body[data-theme="light"] .autocomplete-dropdown {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .autocomplete-item {
    color: #555;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .autocomplete-item:hover,
body[data-theme="light"] .autocomplete-item.highlighted {
    background: rgba(255, 62, 62, 0.06);
    color: #1a1a2e;
}

body[data-theme="light"] .tech-header {
    background: linear-gradient(90deg, rgba(255, 62, 62, 0.06), transparent);
    color: #1a1a2e;
}

body[data-theme="light"] .sigma-badge {
    background: rgba(0, 255, 65, 0.05);
    border-color: #16a34a;
    color: #16a34a;
    box-shadow: none;
}

body[data-theme="light"] .movie-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-mid);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme="light"] .movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevation-high);
}

body[data-theme="light"] .primary-target {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-high);
    border-radius: 24px;
    padding: 3rem;
}

body[data-theme="light"] .primary-details h1 {
    color: var(--text-main);
}

body[data-theme="light"] .wiki-block {
    background: #f8fafc;
    color: #475569;
    border-left: 5px solid #e11d48;
    line-height: 1.7;
    font-weight: 400;
}

body[data-theme="light"] .movie-title-label {
    color: #333;
}

body[data-theme="light"] .cosine-display {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .cosine-score {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

body[data-theme="light"] .feat-name {
    color: #94a3b8;
}

body[data-theme="light"] .feat-score {
    color: #10b981;
}

body[data-theme="light"] .feature-row {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .explain-btn {
    color: #d97706;
    border-color: #fbbf24;
}

body[data-theme="light"] .explain-btn:hover {
    background: rgba(180, 83, 9, 0.08);
    border-color: #b45309;
}

body[data-theme="light"] .rec-btn {
    box-shadow: 0 4px 15px rgba(255, 62, 62, 0.15);
}



body[data-theme="light"] .research-container {
    background: #ffffff;
    border: 1px solid var(--border-dim);
    box-shadow: var(--shadow-elevation-mid);
    padding: 5rem 4rem;
    border-radius: 24px;
}

body[data-theme="light"] .expander {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-low);
}

body[data-theme="light"] .expander-header {
    color: #0f172a;
}

body[data-theme="light"] .expander-header::after {
    color: #64748b;
}

body[data-theme="light"] .code-block {
    background: #0f172a;
    border-radius: 12px;
    color: #10b981;
    font-size: 0.95rem;
    padding: 2rem;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #1e293b;
}

body[data-theme="light"] .eval-metadata {
    background: #ffffff;
    color: #0f172a;
    border-left: 6px solid #e11d48;
    box-shadow: var(--shadow-md);
    padding: 35px;
}

body[data-theme="light"] .eval-metric-card,
body[data-theme="light"] .eval-result-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-mid);
    border-radius: 16px;
}

body[data-theme="light"] .eval-result-card:hover {
    border-color: #e11d48;
    box-shadow: var(--shadow-md);
}

body[data-theme="light"] .eval-result-method {
    color: #0f172a;
    font-weight: 800;
}

body[data-theme="light"] .eval-result-label {
    color: #64748b;
}

body[data-theme="light"] .app-footer {
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
}

body[data-theme="light"] .theme-toggle-btn {
    border-color: #cbd5e0;
    background: #ffffff;
    color: #475569;
}

body[data-theme="light"] .theme-toggle-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #0ea5e9;
}

body[data-theme="light"] .computing-msg {
    color: var(--accent-red);
}

body[data-theme="light"] .loading-indicator {
    color: #888;
}

body[data-theme="light"] .progress-fill {
    background: linear-gradient(90deg, #10b981, #3b82f6);
}

body[data-theme="light"] .progress-bar {
    background: #f1f5f9;
    box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.08);
}

/* Light mode pipeline */
body[data-theme="light"] .pipeline-grid {
    gap: 16px;
}

body[data-theme="light"] .pipeline-col {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-low);
    border-radius: 20px;
}

body[data-theme="light"] .pipeline-list li {
    color: #475569;
    border-bottom: 1px solid var(--border-dim);
}

body[data-theme="light"] .pipeline-list li strong {
    color: #0f172a;
}

body[data-theme="light"] .pipeline-stage-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevation-mid);
    border-radius: 16px;
}

body[data-theme="light"] .pipeline-stage-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevation-high);
}

body[data-theme="light"] .stage-number {
    color: rgba(15, 23, 42, 0.08);
    /* Midnight Ink with low opacity */
}

body[data-theme="light"] .stage-title {
    color: #0f172a;
    font-weight: 700;
}

body[data-theme="light"] .stage-desc {
    color: #334155;
}

/* Light mode scrollbar */
body[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f0f0f0;
}

body[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #ccc;
    border-color: #f0f0f0;
}

body[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ============ RESPONSIVE REFINEMENTS ============ */
@media (max-width: 1200px) {
    .recs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-dim);
    }

    .primary-target {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .primary-details h1 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .archives-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .recs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
    }
}