/* ============================================
   Big Picture Policies - Project Page Styles
   Clean white academic theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8888a0;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --success: #16a34a;
    --failure: #dc2626;
    --border: #e5e7eb;
    --border-light: #f0f0f4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --container-max: 1100px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    text-align: center;
    padding: 50px 24px 60px;
}

.venue-badge {
    display: inline-block;
    padding: 6px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.hero-authors {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-authors .author {
    white-space: nowrap;
}

.hero-authors .author sup {
    font-size: 0.7em;
    margin-left: 1px;
}

.hero-affiliations {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.hero-affiliations sup {
    font-size: 0.75em;
}

/* Tooltip for equal advising asterisk */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-trigger .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: #fff;
    font-size: 0.75rem;
    font-style: italic;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 100;
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.hero-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s;
}

.hero-link-primary {
    background: var(--accent);
    color: #fff;
}

.hero-link-primary:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.hero-link-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.hero-link-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.hero-video-wrap {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.hero-video-wrap video {
    width: 100%;
    display: block;
}

/* ============================================
   Sections
   ============================================ */
.section {
    padding: 20px 0;
}

.section-alt {
    background: var(--bg-light);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* ============================================
   Abstract
   ============================================ */
.abstract-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.abstract-content p {
    margin-bottom: 16px;
}

.abstract-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Problem Motivation
   ============================================ */
.problem-text {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
}

.method-text {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
}

.failure-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.failure-item {
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--failure);
    background: #fff;
}

.failure-item video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.failure-item .video-caption {
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    color: var(--failure);
    background: #fef2f2;
}

.figure-wrap {
    max-width: 600px;
    margin: 0 auto 32px;
    text-align: center;
}

.figure-wrap.figure-wide {
    max-width: 800px;
}

.figure-wrap img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.figure-caption {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.5;
}

/* ============================================
   Takeaway Box
   ============================================ */
.takeaway-box {
    max-width: 700px;
    margin: 0 auto 40px;
    padding: 20px 24px 20px 24px;
    background: #dbeafe;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow-md);
}

.takeaway-box p {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Scroll Animation
   ============================================ */
.scroll-section {
    position: relative;
}

/* Gradient overlay removed - background transition now handled dynamically by JS */

.scroll-section-header {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90%;
    max-width: 800px;
    z-index: 10;
    pointer-events: none;
    transition: color 0.15s ease-out;
    color: var(--text-primary); /* Initially black */
}

.scroll-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.scroll-section-desc {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.85;
}

.scroll-container {
    position: relative;
}

.scroll-sticky {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 115px 20px 20px 20px;
    overflow: hidden;
    background: var(--bg-light); /* Same as section-alt (#f8f9fa) */
    transition: background-color 0.15s ease-out;
}

.scroll-overhead-wrap {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto 12px;
}

.scroll-overhead-wrap canvas,
.scroll-overhead-wrap video {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    transition: filter 0.3s ease;
}

.scroll-overhead-wrap.blurred canvas,
.scroll-overhead-wrap.blurred video {
    filter: blur(8px);
}

.scroll-frame-strip {
    display: flex;
    gap: 6px;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 16px;
}

.scroll-frame-slot {
    position: relative;
    flex: 0 0 calc((100% - 24px) / 5);
    aspect-ratio: 848 / 480;
    background: #1a1a24;
    border-radius: 6px;
    overflow: visible;
    border: 2px solid rgba(255,255,255,0.15);
    transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s, visibility 0.3s;
}

.scroll-frame-slot canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
}

.scroll-frame-slot .keyframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(34, 197, 94, 0.85);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.15s ease-out;
    pointer-events: none;
}

.scroll-frame-slot .frame-label {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.85rem;
    color: #000;
    background: none;
    padding: 6px 0 0;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.scroll-frame-slot.empty .frame-label {
    color: rgba(0,0,0,0.35);
    background: none;
}

.scroll-frame-slot.current {
    border-color: rgba(255,255,255,0.4);
}

/* Naive styling */
.scroll-strip-naive {
    justify-content: flex-end;
}

.scroll-strip-naive .scroll-frame-slot.current {
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239,68,68,0.4);
}

.scroll-strip-naive .scroll-frame-slot.failure-highlight {
    border-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251,191,36,0.35);
}

/* BPP styling */
.scroll-strip-bpp {
    justify-content: flex-end;
}

.scroll-strip-bpp .scroll-frame-slot.current {
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59,130,246,0.4);
}


.scroll-strip-label {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.scroll-strip-label.naive-label {
    color: #ef4444;
}

/* Frame strips wrapper - controls layout and gap between strips */
.frame-strips-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    gap: 24px; /* Always reserve gap space */
}

#scrollNaiveContainer {
    position: relative;
    padding: 2px 20px 18px 20px;
    border-radius: 12px;
    transition: background-color 0.4s ease-out, transform 0.1s ease-out, order 0s;
    /* Light grey background matching BPP style */
    background: #e4e6eb;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    order: -1; /* Position at top by default (when BPP is hidden) */
}

#scrollNaiveContainer.bottom {
    order: 1; /* Move to bottom when BPP is visible */
}

#scrollNaiveContainer.dark-bg {
    background-color: #52525e;
}

#scrollNaiveContainer.dark-bg .frame-label {
    color: #fff;
}

#scrollBppContainer {
    visibility: hidden;
    opacity: 0;
    padding: 2px 20px 18px 20px;
    border-radius: 12px;
    background: #e4e6eb;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: opacity 0.3s ease-out, visibility 0.3s;
}

#scrollBppContainer.visible {
    visibility: visible;
    opacity: 1;
}

#scrollBppContainer .frame-label {
    color: #1a1a2e;
}

/* Policy input highlight box */
.policy-input-highlight {
    position: absolute;
    top: -8px;
    left: -12px;
    right: -12px;
    bottom: -40px;
    border: 3px solid #fbbf24;
    border-radius: 14px;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.policy-input-label {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #1a1a2e;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    white-space: nowrap;
}

.scroll-strip-label.bpp-label {
    color: #60a5fa;
}

/* Scroll messages — positioned by JS, with blurred light background */
.scroll-message {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(120px);
    max-width: 600px;
    width: 90%;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    /* Blurred light background */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 28px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.scroll-message em {
    font-style: italic;
    color: var(--accent);
}

.scroll-bpp-title {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    /* Dark blurred background for white text */
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 20px 40px;
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

/* Loading overlay — light theme */
.scroll-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 16px;
    transition: opacity 0.5s;
}

.scroll-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-loading-bar {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.scroll-loading-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s;
    border-radius: 2px;
}

.scroll-loading-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   Results Table
   ============================================ */
.results-table-wrap {
    overflow-x: auto;
    margin: 0 auto 40px;
    max-width: 800px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table th,
.results-table td {
    padding: 12px 18px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.results-table th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.results-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.results-table .highlight-col {
    background: #eff6ff;
    color: var(--accent);
    font-weight: 700;
}

.results-table th.highlight-col {
    background: #dbeafe;
    color: var(--accent-dark);
}

.results-table .avg-row td {
    border-top: 2px solid var(--text-primary);
    font-weight: 700;
}

/* ============================================
   Video Comparisons
   ============================================ */
.env-section {
    margin-bottom: 48px;
}

.env-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
    color: var(--text-primary);
}

.video-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.video-card {
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: #fff;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-3px);
}

.video-card.success {
    border-color: var(--success);
}

.video-card.failure {
    border-color: var(--failure);
}

.video-card video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.video-card .video-label {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.video-card.success .video-label {
    background: #f0fdf4;
    color: var(--success);
}

.video-card.failure .video-label {
    background: #fef2f2;
    color: var(--failure);
}

.badge-success, .badge-failure {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success);
    color: #fff;
}

.badge-failure {
    background: var(--failure);
    color: #fff;
}

/* ============================================
   Citation
   ============================================ */
.citation-box {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

.citation-box pre {
    overflow-x: auto;
    margin: 0;
}

.citation-box code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.copy-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================
   Fade-in animation
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero { padding: 50px 16px 40px; }
    .hero-title { font-size: 1.4rem; }
    .section { padding: 50px 0; }
    .section-title { font-size: 1.4rem; }

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

    .video-row {
        grid-template-columns: 1fr;
    }

    .results-table th,
    .results-table td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .scroll-section-header {
        top: 24px;
    }

    .scroll-section-title {
        font-size: 1.3rem;
    }

    .scroll-section-desc {
        font-size: 0.9rem;
    }

    .scroll-sticky {
        padding-top: 100px;
        justify-content: flex-start;
    }

    .scroll-overhead-wrap {
        max-width: min(100%, 480px);
    }

    .scroll-message {
        font-size: 1rem;
    }

    .scroll-bpp-title {
        font-size: 1.4rem;
    }

    .scroll-frame-strip {
        max-width: 100%;
    }

    .hero-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .failure-grid {
        grid-template-columns: 1fr;
    }

    .scroll-section-header {
        top: 16px;
    }

    .scroll-section-title {
        font-size: 1.1rem;
    }

    .scroll-section-desc {
        font-size: 0.85rem;
    }

    .scroll-sticky {
        padding-top: 90px;
    }

    .scroll-overhead-wrap {
        max-width: min(100%, 380px);
    }
}

/* ============================================
   Height-based Responsive (for short viewports)
   ============================================ */

/* Medium-short viewports */
@media (max-height: 700px) {
    .scroll-section-header {
        top: 24px;
    }

    .scroll-section-title {
        font-size: 1.3rem;
    }

    .scroll-section-desc {
        font-size: 0.9rem;
    }

    .scroll-overhead-wrap {
        max-width: 520px;
    }

    .frame-strips-wrapper {
        max-width: 680px;
    }

    .scroll-frame-strip {
        max-width: 680px;
    }
}

/* Short viewports */
@media (max-height: 550px) {
    .scroll-section-header {
        top: 12px;
    }

    .scroll-section-title {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }

    .scroll-section-desc {
        font-size: 0.85rem;
    }

    .scroll-sticky {
        padding-top: 70px;
        justify-content: flex-start;
    }

    .scroll-overhead-wrap {
        max-width: 420px;
        margin-bottom: 10px;
    }

    .frame-strips-wrapper {
        max-width: 560px;
    }

    .scroll-frame-strip {
        max-width: 560px;
        margin-bottom: 20px;
    }

    .scroll-frame-slot .frame-label {
        font-size: 0.75rem;
        padding-top: 4px;
    }

    .scroll-message {
        font-size: 1rem;
        padding: 14px 20px;
    }

    .scroll-bpp-title {
        font-size: 1.2rem;
        padding: 14px 28px;
    }
}

/* Very short viewports */
@media (max-height: 450px) {
    .scroll-section-header {
        top: 8px;
    }

    .scroll-section-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .scroll-section-desc {
        display: none;
    }

    .scroll-sticky {
        padding-top: 45px;
    }

    .scroll-overhead-wrap {
        max-width: 340px;
        margin-bottom: 8px;
    }

    .frame-strips-wrapper {
        max-width: 450px;
    }

    .scroll-frame-strip {
        max-width: 450px;
        margin-bottom: 15px;
        gap: 4px;
    }

    .scroll-frame-slot .frame-label {
        font-size: 0.7rem;
    }

    .scroll-message {
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    .scroll-bpp-title {
        font-size: 1rem;
        padding: 10px 20px;
    }
}

/* Mobile landscape - scale based on limiting dimension */
@media (max-width: 768px) and (max-height: 500px) {
    .scroll-overhead-wrap {
        max-width: min(90vw, 45vh);
    }

    .frame-strips-wrapper {
        max-width: min(95vw, 60vh);
    }

    .scroll-frame-strip {
        max-width: min(95vw, 60vh);
    }

    .scroll-section-title {
        font-size: clamp(0.9rem, 2.5vh, 1.1rem);
    }

    .scroll-message {
        max-width: min(85vw, 70vh);
    }
}

/* ============================================
   Trajectory Time Slider (shows video time with robot arm)
   ============================================ */
.trajectory-slider-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 12px auto 24px;
    padding: 0 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trajectory-slider-container.visible {
    opacity: 1;
}

.trajectory-slider-track {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.trajectory-slider-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 2px;
    width: 0%;
}

.trajectory-slider-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-25%, -100%) translateY(-2px);
    width: 28px;
    height: 33px;
}

.robot-arm-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

/* Trajectory slider adapts to background color */
.trajectory-slider-container.light-bg .trajectory-slider-track {
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================
   Animation Controls (at bottom, with play/pause)
   ============================================ */
.animation-controls {
    width: 100%;
    max-width: 500px;
    padding: 0 24px;
    margin-top: 20px;
    margin-bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 20;
}

.animation-controls.visible {
    opacity: 1;
}

/* Play/Pause Button */
.play-pause-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.play-pause-btn:active {
    transform: scale(0.95);
}

.play-pause-btn svg {
    width: 14px;
    height: 14px;
}

.play-pause-btn .play-icon {
    display: block;
}

.play-pause-btn .pause-icon {
    display: none;
}

.play-pause-btn.playing .play-icon {
    display: none;
}

.play-pause-btn.playing .pause-icon {
    display: block;
}

/* Light background mode */
.animation-controls.light-bg .play-pause-btn {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.animation-controls.light-bg .play-pause-btn:hover {
    background: rgba(0, 0, 0, 0.18);
}

/* Animation Slider Track */
.animation-slider-track {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    flex: 1;
    cursor: pointer;
    transition: height 0.15s ease;
}

.animation-slider-track:hover {
    height: 6px;
}

.animation-slider-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}

.animation-slider-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.animation-slider-track:hover .animation-slider-thumb {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Animation slider adapts to background color */
.animation-controls.light-bg .animation-slider-track {
    background: rgba(0, 0, 0, 0.15);
}

.animation-controls.light-bg .animation-slider-progress {
    background: rgba(0, 0, 0, 0.35);
}

.animation-controls.light-bg .animation-slider-thumb {
    background: var(--text-primary);
}

/* ============================================
   Interactive Bar Chart (Chart.js)
   ============================================ */
.interactive-chart-wrap {
    max-width: 900px;
    margin: 0 auto;
    background: #F9F8F3;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.interactive-chart-wrap canvas {
    width: 100% !important;
    height: auto !important;
}

