/* Projects Page Styles */

.banner-section {
    height: auto;
    min-height: 25rem;
    max-height: 85vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.banner-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Banner Hover Overlay */
.banner-overlay {
    position: absolute;
    bottom: -6.25rem;
    /* Hidden initially */
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(0.3125rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.banner-section:hover .banner-overlay {
    bottom: 0;
}

.overlay-left {
    display: flex;
    flex-direction: column;
}

.spy-font {
    font-family: 'Courier New', Courier, monospace;
    /* Spy/Typewriter feel */
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.3125rem;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
}

.clock-font {
    font-family: 'Courier', monospace;
    /* Digital/Monospace feel */
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin: 0.3125rem 0 0 0;
    letter-spacing: 0.125rem;
}

.btn-watch {
    padding: 0.8rem 2.5rem;
    background: var(--accent-gold);
    color: #000;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-watch:hover {
    background: #fff;
    transform: scale(1.05);
}

.banner-placeholder {
    display: none;
}

.projects-list-section {
    padding: 4rem 5%;
    background-color: var(--bg-dark);
}

#projects-content {
    padding-top: 8rem;
}

.container {
    max-width: 75rem;
    margin: 0 auto;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 4rem;
    text-align: center;
    letter-spacing: 0.125rem;
    color: #fff;
}

.project-category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    color: var(--accent-gold);
    border-left: 0.25rem solid var(--accent-gold);
    padding-left: 1.5rem;
}

/* Thumbnail Grid */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 2.5rem;
}

/* Music Carousel Styles */
.carousel-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    gap: 1rem;
}

.carousel-track-container {
    flex: 1;
    overflow: hidden;
    padding: 0.625rem 0;
}

.carousel-track {
    display: flex;
    gap: 2.5rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-track .project-card {
    flex: 0 0 17.5rem;
    /* Fixed width for all carousel items */
    max-width: 17.5rem;
}

.carousel-nav {
    background: none;
    border: none;
    color: #444;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    padding: 0 0.625rem;
    line-height: 1;
    margin-top: 4.0625rem;
    /* Centers arrows vertically relative to the 16:9 thumbnail height */
    z-index: 10;
    position: relative;
}

.carousel-nav:hover {
    color: #fff;
    transform: scale(1.1);
}

.carousel-nav:disabled {
    color: #222;
    cursor: default;
    transform: none;
}

.project-card {
    cursor: pointer;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-0.3125rem);
}

.thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    border-radius: 0.9375rem;
    /* Rounded corners */
    overflow: hidden;
    margin-bottom: 1rem;
    border: 0.0625rem solid #333;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .thumbnail img {
    transform: scale(1.05);
}

/* Ensure music thumbnails fit correctly with black bars */
.music-card .thumbnail {
    background: #000;
}

.music-card .thumbnail img {
    object-fit: cover;
    /* Default back to stretch-to-fit */
}

.music-card .thumbnail img.fit-contain {
    object-fit: contain;
    /* Specific fit for selected tracks */
}

.duration {
    position: absolute;
    bottom: 0.625rem;
    right: 0.625rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 400;
}


.project-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-light);
    margin-top: 0.3rem;
    /* Reduced margin to bring closer to role */
    line-height: 1.5;
    letter-spacing: 0.03125rem;
}

.project-role {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.09375rem;
    color: var(--accent-gold);
    margin-top: 0.8rem;
    margin-bottom: 0;
}

/* Video Player (Theatre Mode) */
.theatre-mode {
    margin-top: 3rem;
    margin-bottom: 3rem;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease;
    max-height: 62.5rem;
    opacity: 1;
}

.theatre-mode.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 0.9375rem;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.btn-close {
    position: absolute;
    top: 0.9375rem;
    right: 0.9375rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: var(--transition);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Music Player Bar */
.music-player-bar {
    position: relative;
    /* Add this to position the close button relative to the bar */
    background: #111;
    padding: 1.5rem 2rem;
    border-radius: 0.9375rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
    border: 0.0625rem solid #222;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease, margin 0.4s ease, padding 0.4s ease, border-width 0.4s ease;
    max-height: 12.5rem;
    opacity: 1;
}

.music-player-bar.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.music-player-bar #music-close {
    position: absolute;
    top: 0.625rem;
    right: 0.875rem;
    width: 2.125rem;
    height: 2.125rem;
    background: none;
    border: none;
    color: #444;
    /* Burned-in look */
    font-size: 1.35rem;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;
    transition: color 0.3s ease;
}

.music-player-bar #music-close:hover {
    color: #fff;
    background: none;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
    padding-right: 2.5rem;
    /* keep controls from overlapping the close button hit area */
}

.btn-control {
    background: var(--text-light);
    color: var(--bg-dark);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 1.25rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-control:hover {
    background: var(--accent-gold);
}

.playback-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    font-family: monospace;
}

.progress-bar {
    flex: 1;
    height: 0.375rem;
    background: #333;
    border-radius: 0.1875rem;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gold);
    border-radius: 0.1875rem;
    width: 0%;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
}

.volume-container label {
    color: #b8b8b8;
    font-weight: 600;
}

#volume-slider {
    --volume-percent: 100%;
    -webkit-appearance: none;
    appearance: none;
    accent-color: #ffffff;
    width: 8.125rem;
    height: 1.125rem;
    background: transparent;
    border-radius: 62.4375rem;
    outline: none;
    cursor: pointer;
    padding: 0;
}

#volume-slider:focus {
    border-color: #ffffff;
    outline: none;
    box-shadow: none;
}

#volume-slider:focus-visible {
    outline: 0.125rem solid #ffffff;
    outline-offset: 0.25rem;
}

/* Chrome, Safari, Edge, Opera */
#volume-slider::-webkit-slider-runnable-track {
    height: 0.375rem;
    border-radius: 62.4375rem;
    background: linear-gradient(to right,
            #ffffff 0%,
            #ffffff var(--volume-percent),
            #2b2b2b var(--volume-percent),
            #2b2b2b 100%);
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    margin-top: -0.3125rem;
    border-radius: 50%;
    background: #fff;
    border: 0.125rem solid #ffffff;
    box-shadow: 0 0 0 0.125rem rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease;
}

#volume-slider:hover::-webkit-slider-thumb,
#volume-slider:active::-webkit-slider-thumb {
    transform: scale(1.08);
}

/* Firefox */
#volume-slider::-moz-range-track {
    height: 0.375rem;
    background: #2b2b2b;
    border-radius: 62.4375rem;
}

#volume-slider::-moz-range-progress {
    height: 0.375rem;
    background: #ffffff;
    border-radius: 62.4375rem;
}

#volume-slider::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    border: 0.125rem solid #ffffff;
    cursor: pointer;
    box-shadow: 0 0 0 0.125rem rgba(0, 0, 0, 0.35);
}

#now-playing-title {
    font-size: 0.9rem;
    font-weight: 300;
    color: #888;
}

/* Music Thumbnail Specifics */
.music-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    color: #444;
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
}

/* --- Mobile Optimization --- */
@media (max-width: 1100px) {
    .container {
        padding: 0 2.5rem;
    }
}

/* --- Tablet Optimization (769px to 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .banner-section {
        height: 35rem;
        /* Taller than mobile, shorter than desktop */
    }

    .banner-overlay {
        bottom: 0;
        /* Always visible on touch-friendly tablet view */
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(10px);
        padding: 2.5rem 5%;
        flex-direction: column;
        justify-content: center;
        gap: 1.5rem;
        text-align: center;
        height: auto;
    }

    .spy-font {
        font-size: 2.4rem;
        letter-spacing: 0.2rem;
        margin-bottom: 0.5rem;
    }

    .clock-font {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .btn-watch {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    .projects-list-section {
        padding: 5rem 0;
    }

    .main-title {
        font-size: 2.6rem;
        margin-bottom: 4rem;
    }

    #projects-content {
        padding-top: 6rem;
    }

    .category-title {
        font-size: 1.8rem;
        margin-bottom: 2.5rem;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
        gap: 2rem;
    }

    /* Carousel Tablet Refinement */
    .carousel-track .project-card {
        flex: 0 0 20rem;
        max-width: 20rem;
    }

    .carousel-nav {
        margin-top: 5.6rem;
        /* Perfectly centers arrows on the 16:9 tablet thumbnails */
    }

    .carousel-btn {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 2rem;
    }

    /* Players */
    .video-player-container {
        padding: 2rem;
        border-radius: 1.5rem;
    }

    .lang-dropdown-btn,
    .lang-dropdown-menu .lang-btn {
        font-size: 2rem;
    }

    .music-player-bar {
        padding: 1.5rem 2.5rem;
    }
}


@media (max-width: 768px) {
    .banner-section {
        min-height: 20rem;
        max-height: 50vh;
    }

    .banner-overlay {
        bottom: 0;
        /* Always visible on mobile */
        padding: 1.5rem 5%;
        background: rgba(10, 10, 10, 0.7);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .spy-font {
        font-size: 1.4rem;
        letter-spacing: 0.15rem;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .clock-font {
        font-size: 0.9rem;
        color: #ccc;
    }

    .btn-watch {
        padding: 0.7rem 1.8rem;
        font-size: 0.85rem;
        border-radius: 0.4rem;
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    }

    .projects-list-section {
        padding: 2rem 1.5rem;
    }

    #projects-content {
        padding-top: 4.5rem;
    }

    .main-title {
        font-size: 2.4rem;
        margin-bottom: 3rem;
        letter-spacing: 0.05rem;
    }

    .category-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
        gap: 2rem;
    }

    .project-card:active {
        transform: scale(0.98);
    }

    /* Carousel Mobile Experience */
    .carousel-container {
        margin: 0 -1.5rem;
        /* Full width bleed */
    }

    .carousel-track-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 1rem 1.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Hide scrollbar Firefox */
    }

    .carousel-track-container::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar Chrome/Safari */
    }

    .carousel-track {
        gap: 1.5rem;
    }

    .carousel-track .project-card {
        scroll-snap-align: start;
        flex: 0 0 16rem;
        max-width: 16rem;
    }

    .carousel-nav {
        display: none;
        /* Swipe is better on mobile */
    }

    .project-title {
        font-size: 1rem;
    }

    .project-role {
        font-size: 0.7rem;
    }

    /* Players */
    .video-player-container,
    .music-player-bar {
        background: rgba(20, 20, 20, 0.85);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 1rem;
        grid-column: 1 / -1;
        /* Ensure it spans the full grid width on mobile */
    }

    .player-controls {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }

    .btn-control {
        width: 100%;
        padding: 0.8rem;
        border-radius: 0.5rem;
        background: var(--accent-gold);
        color: #000;
    }

    .volume-container {
        justify-content: space-between;
    }

    .music-player-bar {
        padding: 2rem 1.5rem;
    }

    .music-player-bar #music-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.8rem;
        color: #fff;
        opacity: 0.7;
    }

    #now-playing-title {
        text-align: center;
        margin-top: 1rem;
        font-size: 0.8rem;
        color: var(--accent-gold);
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .spy-font {
        font-size: 1.2rem;
    }

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

    .carousel-track .project-card {
        flex: 0 0 14rem;
    }

    .video-wrapper {
        border-radius: 0.5rem;
    }

    .btn-close {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.8rem;
        background: rgba(0, 0, 0, 0.5);
    }

    .lang-dropdown-btn,
    .lang-dropdown-menu .lang-btn {
        font-size: 1.8rem;
    }
}