/* TIMELINE SCROLLBAR - CINEMATIC EDITION */
/* Hide default scrollbars */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    /* Create space at the top of the body for the fixed timeline so content doesn't get hidden */
    padding-top: 36px;
}

.navbar {
    /* Push navbar down so it sits below the timeline */
    top: 36px;
}

.mobile-menu {
    /* Adjust mobile menu top distance due to timeline offset */
    top: 116px;
    /* 80px nav + 36px timeline */
}

.cinematic-hero {
    /* Adjust hero margin to properly hit the top of the viewport under the navbar */
    margin-top: -116px;
}

.page-transition {
    /* Adjust page-transition padding so content starts below navbar */
    padding-top: 80px;
    min-height: calc(100vh - 116px);
}

/* Timeline Container Fixed at Top */
.timeline-scrollbar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: #08080c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    user-select: none;
}

/* Background Waveform Animation */
.timeline-waveform-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    /* Double width for seamless scroll translation */
    height: 100%;
    opacity: 0.15;
    background-image:
        repeating-linear-gradient(to right,
            transparent,
            transparent 2px,
            var(--accent) 3px,
            transparent 4px,
            transparent 6px,
            var(--accent) 8px,
            transparent 9px,
            transparent 13px,
            rgba(255, 255, 255, 0.5) 14px,
            transparent 15px);
    background-size: 150px 100%;
    background-position: center bottom;
    pointer-events: none;
    /* Transformation handled by JS based on scroll for dynamic moving effect */
    transition: transform 0.1s linear;
}

/* The Track holding markers and playhead */
.timeline-track {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Timecode Markers */
.timeline-marker {
    position: absolute;
    bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    transform: translateX(-50%);
    /* Center the text over the exact percentage node */
    color: var(--text-secondary);
    transition: var(--transition);
}

.timeline-marker:hover .marker-time {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.timeline-marker:hover .marker-tick {
    background: var(--text-primary);
    height: 8px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.marker-time {
    font-family: 'Outfit', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
    pointer-events: none;
}

.marker-tick {
    width: 1px;
    height: 4px;
    background: var(--text-secondary);
    transition: var(--transition);
    pointer-events: none;
}

/* Glowing Playhead Indicator */
.timeline-playhead {
    position: absolute;
    bottom: 0;
    left: 0;
    /* Updated dynamically via JS (Left %) */
    width: 2px;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--gradient-primary);
    z-index: 10;
    pointer-events: none;
    transition: left 0.1s ease-out;
}

/* Playhead triangle pointer at bottom */
.timeline-playhead::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid var(--accent);
}

/* Playhead line extension */
.timeline-playhead::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Drops a vertical guide line down the whole screen */
    background: linear-gradient(to bottom, rgba(0, 212, 255, 0.2), transparent);
    width: 1px;
    transform: translateX(0.5px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-scrollbar-container:hover .timeline-playhead::before {
    opacity: 1;
}

@media (max-width: 768px) {
    .marker-time {
        display: none;
        /* Hide text on mobile to save space */
    }

    .timeline-marker {
        width: 12px;
        /* Bigger tap target */
    }

    .marker-tick {
        height: 6px;
        /* slightly larger tick on mobile */
    }

    .timeline-scrollbar-container {
        height: 24px;
        /* Slimmer on mobile */
    }

    body {
        padding-top: 24px;
    }

    .navbar {
        top: 24px;
    }

    .mobile-menu {
        top: 104px;
    }

    .cinematic-hero {
        margin-top: -104px;
    }

    .page-transition {
        min-height: calc(100vh - 104px);
    }
}