/* Overlay Backdrop for Movie/TV Overlays */
.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover; /* cover to fill whole viewport */
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #000;
    z-index: 1999;
    opacity: 1;
    pointer-events: none; /* Allow clicks to pass through to elements above */
}
/* Movie Overlay and Thumbnail History Styles */

/* Movie Overlay */
.movie-overlay,
.tv-overlay,
.person-overlay,
.collection-overlay {
    position: fixed;
    inset: 0; /* shorthand for top:0; right:0; bottom:0; left:0 */
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    padding: 0;
    background: #000; /* fully opaque backdrop to block underlying page */
    z-index: 2000;
    display: flex;
    align-items: flex-start; /* allow content to start at top while filling width */
    justify-content: center; /* center horizontally */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.person-overlay {
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 236, 255, 0.45) rgba(20, 24, 36, 0.6);
}

.person-overlay::-webkit-scrollbar {
    width: 10px;
}

.person-overlay::-webkit-scrollbar-track {
    background: rgba(16, 28, 44, 0.6);
    border-radius: 999px;
}

.person-overlay::-webkit-scrollbar-thumb {
    background: rgba(196, 236, 255, 0.45);
    border-radius: 999px;
}

.movie-overlay:not(.hidden),
.tv-overlay:not(.hidden),
.person-overlay:not(.hidden),
.collection-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    
    .overlay-credit-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.close-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    pointer-events: auto !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.close-overlay:hover {
    background: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Movie Backdrop - Full original size, no cropping */
.movie-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover; /* ensure it fills viewport */
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #000;
    z-index: 1999;
    filter: none;
}

/* Movie Content */
.overlay-main {
    position: relative;
    z-index: 2000; /* above backdrop */
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 32px;
    max-width: 1200px;
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: clamp(48px, 6vh, 80px) clamp(32px, 6vw, 64px) clamp(56px, 7vh, 88px);
    box-sizing: border-box;
    flex-wrap: wrap;
    opacity: 0.1;
    transition: opacity var(--transition-base);
}

.overlay-main:hover {
    opacity: 1;
}

.person-overlay-main {
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 32px;
    max-width: 1200px;
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 3vw, 32px) clamp(32px, 4vw, 48px) clamp(56px, 6vw, 72px);
    box-sizing: border-box;
}

.person-backdrop-source-btn {
    position: absolute;
    top: clamp(18px, 3vw, 36px);
    left: clamp(24px, 6vw, 72px);
    z-index: 2002;
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(164, 214, 255, 0.35);
    background: linear-gradient(135deg, rgba(12, 24, 42, 0.82), rgba(18, 36, 62, 0.78));
    color: #e9f6ff;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 42px rgba(4, 12, 26, 0.55);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.person-backdrop-source-btn:hover,
.person-backdrop-source-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(212, 238, 255, 0.65);
    box-shadow: 0 20px 48px rgba(6, 16, 34, 0.6);
    outline: none;
}

.person-backdrop-source-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(108, 194, 255, 0.4), 0 20px 48px rgba(6, 16, 34, 0.6);
}

.person-backdrop-source-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.72;
}

.person-backdrop-source-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.person-backdrop-source-year {
    font-size: 0.9rem;
    opacity: 0.75;
}

.person-overlay-spacer {
    flex: 0 0 240px;
    width: 240px;
    min-height: 1px;
    pointer-events: none;
}

.person-overlay-info {
    position: relative;
    z-index: 2001;
    color: white;
    background: linear-gradient(180deg, rgba(16, 24, 36, 0.62), rgba(10, 16, 26, 0.48));
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: 24px;
    padding: clamp(28px, 3vw, 36px);
    box-shadow: 0 26px 68px rgba(4, 10, 22, 0.55);
    border: 1px solid rgba(164, 214, 255, 0.22);
    width: 100%;
    max-width: 820px;
}

.person-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: clamp(18px, 2.8vw, 26px);
}

.person-overlay-notice {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(24, 42, 68, 0.62);
    border: 1px solid rgba(186, 226, 255, 0.28);
    color: rgba(220, 238, 255, 0.92);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.person-header .overlay-title {
    margin: 0;
}

.person-header .overlay-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.person-overview-block {
    position: relative;
    margin-bottom: clamp(20px, 3vw, 32px);
    min-height: 160px;
}

.person-portrait-floating {
    float: right;
    width: clamp(180px, 24vw, 240px);
    margin: 0 0 clamp(16px, 2vw, 22px) clamp(20px, 3vw, 28px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(4, 10, 24, 0.55);
    border: 1px solid rgba(182, 232, 255, 0.28);
    background: rgba(10, 20, 36, 0.6);
}

.person-portrait-floating img,
.person-no-poster {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.person-no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 0;
    font-size: 3rem;
    color: rgba(220, 242, 255, 0.78);
    background: linear-gradient(145deg, rgba(8, 24, 40, 0.92), rgba(16, 48, 68, 0.82));
}

.person-overview-text {
    font-size: 1.02rem;
    line-height: 1.78;
    color: rgba(234, 244, 255, 0.94);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.52);
    max-height: min(48vh, 520px);
    overflow-y: auto;
    padding-right: 10px;
    margin-right: -10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 236, 255, 0.45) rgba(180, 220, 255, 0.12);
}

.person-overview-text p {
    margin: 0 0 1rem;
}

.person-overview-text p:last-child {
    margin-bottom: 0;
}

.person-overview-text::-webkit-scrollbar {
    width: 8px;
}

.person-overview-text::-webkit-scrollbar-track {
    background: rgba(180, 220, 255, 0.12);
    border-radius: 999px;
}

.person-overview-text::-webkit-scrollbar-thumb {
    background: rgba(196, 236, 255, 0.45);
    border-radius: 999px;
}

.person-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.person-section h3 {
    letter-spacing: 0.1em;
    font-size: 0.92rem;
    color: rgba(198, 238, 255, 0.88);
    text-transform: uppercase;
}

.person-filmography-scroll {
    max-height: min(60vh, 620px);
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.95) 92%, rgba(0,0,0,0.35));
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 236, 255, 0.45) rgba(180, 220, 255, 0.12);
}

.person-filmography-scroll::-webkit-scrollbar {
    width: 8px;
}

.person-filmography-scroll::-webkit-scrollbar-track {
    background: rgba(180, 220, 255, 0.12);
    border-radius: 999px;
}

.person-filmography-scroll::-webkit-scrollbar-thumb {
    background: rgba(196, 236, 255, 0.45);
    border-radius: 999px;
}

.overlay-credit-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.overlay-credit-card--person {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 190px;
    border-radius: 18px;
    border: none;
    background: rgba(12, 24, 40, 0.68);
    border: 1px solid rgba(184, 232, 255, 0.18);
    box-shadow: 0 16px 40px rgba(4, 12, 26, 0.46);
    cursor: pointer;
    padding: 0;
    font: inherit;
    appearance: none;
    color: inherit;
    text-align: left;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.overlay-credit-card--person:hover,
.overlay-credit-card--person:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(210, 248, 255, 0.45);
    box-shadow: 0 22px 48px rgba(6, 18, 36, 0.55);
    outline: none;
}

.overlay-credit-card__art {
    width: 100%;
    position: relative;
}

.overlay-credit-card__art img,
.overlay-credit-card__art .no-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.05);
}

.overlay-credit-card__art .no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(214, 236, 255, 0.68);
}

.overlay-credit-card--person .credit-title {
    padding: 12px 14px 6px;
    font-size: 0.86rem;
    font-weight: 600;
    min-height: 38px;
}

.overlay-credit-card--person .credit-meta {
    padding: 0 14px 14px;
    font-size: 0.72rem;
    color: rgba(214, 235, 255, 0.7);
}

.person-filmography-grid {
    gap: 14px;
}

.collection-overlay-main {
    flex-direction: column;
    width: min(1020px, 95vw);
    margin: 80px auto 48px;
    gap: 32px;
    padding: 0;
}

.collection-hero {
    display: flex;
    align-items: flex-start;
    gap: clamp(24px, 3.5vw, 40px);
    background: linear-gradient(180deg, rgba(10, 24, 38, 0.82), rgba(8, 18, 30, 0.72));
    border-radius: 28px;
    padding: clamp(28px, 3.2vw, 36px);
    border: 1px solid rgba(160, 220, 255, 0.2);
    box-shadow: 0 24px 60px rgba(6, 18, 34, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.collection-hero-art {
    flex: 0 0 clamp(180px, 22vw, 240px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(4, 12, 26, 0.58);
    border: 1px solid rgba(186, 236, 255, 0.28);
}

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

.collection-hero-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: rgba(226, 244, 255, 0.94);
}

.collection-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(200, 250, 255, 0.16);
    color: rgba(226, 244, 255, 0.86);
    font-size: 0.75rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.collection-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0;
    line-height: 1.15;
    color: rgba(236, 248, 255, 0.96);
}

.collection-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
    color: rgba(214, 236, 255, 0.78);
}

.collection-home {
    color: rgba(214, 246, 255, 0.92);
    text-decoration: underline;
}

.collection-home:hover,
.collection-home:focus-visible {
    color: rgba(246, 255, 255, 0.98);
}

.collection-home:focus-visible {
    outline: 2px solid rgba(214, 246, 255, 0.8);
    outline-offset: 3px;
}

.collection-overview {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(224, 242, 255, 0.92);
    max-width: 78ch;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding-bottom: 12px;
}

.collection-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(10, 24, 38, 0.7);
    border-radius: 18px;
    border: 1px solid rgba(170, 228, 255, 0.18);
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(4, 12, 26, 0.46);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.collection-card:hover,
.collection-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(210, 248, 255, 0.45);
    box-shadow: 0 22px 48px rgba(4, 12, 26, 0.55);
    outline: none;
}

.collection-card-art {
    position: relative;
}

.collection-card img,
.collection-card-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.05);
}

.collection-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(214, 236, 255, 0.65);
}

.collection-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px 16px;
    color: rgba(224, 242, 255, 0.92);
    text-align: left;
}

.collection-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.collection-card-year {
    font-size: 0.78rem;
    color: rgba(196, 222, 240, 0.72);
}

.collection-card--current {
    border-color: rgba(250, 232, 138, 0.55);
    box-shadow: 0 22px 48px rgba(250, 208, 94, 0.25);
}

.collection-card-current-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 220, 120, 0.85);
    color: rgba(40, 26, 4, 0.92);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.collection-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 36px 18px;
    border-radius: 18px;
    background: rgba(12, 30, 46, 0.65);
    border: 1px dashed rgba(200, 230, 255, 0.25);
    color: rgba(210, 236, 255, 0.8);
}

.overlay-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.overlay-column-left {
    flex-shrink: 0;
}

.overlay-column-right {
    flex: 1 1 480px;
    min-width: 340px;
}

.movie-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 20px;
    min-height: auto;
    gap: 24px;
}

.movie-poster-large {
    flex-shrink: 0;
    width: 260px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.movie-poster-large img {
    width: 100%;
    height: auto;
    display: block;
}

.movie-info-detailed {
    flex: 1;
    color: white;
    max-width: 720px;
    background: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 18px;
    padding: 28px 32px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Transparent hover sections for movie details */
.movie-detail-section {
    position: relative;
    padding: 10px;
    margin: 5px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.movie-detail-section:has(.movie-streaming) {
    cursor: default;
}

.movie-detail-section:hover {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateX(5px);
}

.movie-detail-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.movie-detail-section:hover::before {
    opacity: 1;
}

.movie-logo {
    max-width: 400px;
    max-height: 100px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

.movie-title-large {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.movie-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.movie-meta span {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.genre-tag {
    padding: 6px 14px;
    background: var(--accent);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.movie-overview {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
}

.movie-cast h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.cast-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cast-member {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Cast Grid */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.cast-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.cast-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

.cast-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.no-profile {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    font-size: 2rem;
}

.cast-info {
    padding: 8px;
}

.cast-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
    line-height: 1.2;
}

.cast-character {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Cast grid scrollbar */
.cast-grid::-webkit-scrollbar {
    width: 6px;
}

.cast-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.cast-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

/* Livestreaming Button */
.movie-streaming h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent);
}


/* Minimal streaming link rules for overlays - visual controlled in movie-grid.css */
.streaming-container { pointer-events: none; }
.streaming-container a { pointer-events: auto; }
a.livestreaming { background: none; border: 0; box-shadow: none; }

/* Production Companies */
.movie-production h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.production-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.production-company {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Person Filmography */
.person-filmography h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.filmography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.filmography-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.filmography-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

.filmography-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.no-poster {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    font-size: 2rem;
    border-radius: 8px 8px 0 0;
}

.filmography-info {
    padding: 10px;
}

.film-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
    line-height: 1.2;
}

.film-year {
    font-size: 0.7rem;
    color: var(--accent);
    margin-bottom: 3px;
}

.film-character {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Filmography scrollbar */
.filmography-grid::-webkit-scrollbar {
    width: 6px;
}

.filmography-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.filmography-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

/* Thumbnail History - Collapsible Panel */
.thumbnail-history {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 1500;
    display: flex;
    align-items: flex-end;
}



.history-panel {
    display: inline-flex;
    align-items: stretch;
    gap: 12px;
    pointer-events: auto;
    transition: gap 0.2s ease;
}

.thumbnail-history--collapsed .history-panel {
    gap: 0;
}

.history-trigger {
    border: 1px solid rgba(120, 216, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 20px;
    cursor: pointer;
    color: rgba(172, 239, 255, 0.92);
    background: linear-gradient(160deg, rgba(8, 28, 46, 0.68), rgba(18, 70, 102, 0.42));
    box-shadow: 0 12px 26px rgba(5, 24, 46, 0.48);
    transition: background 160ms ease, box-shadow 160ms ease, transform 120ms ease, color 160ms ease, border-color 160ms ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    will-change: transform;
    padding: 0;
}

.history-trigger:hover,
.history-trigger:focus-visible,
.thumbnail-history--open .history-trigger {
    transform: translateY(-1px);
}

.history-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(180, 244, 255, 0.55), 0 14px 28px rgba(6, 32, 58, 0.45);
}

.history-trigger--closed {
    background: linear-gradient(160deg, rgba(10, 34, 60, 0.72), rgba(20, 80, 118, 0.46));
    border-color: rgba(120, 216, 255, 0.32);
}

.history-trigger--closed:hover,
.history-trigger--closed:focus-visible {
    background: rgba(255, 255, 255, 0.36);
    border-color: rgba(196, 244, 255, 0.46);
    color: rgba(12, 48, 72, 0.86);
    box-shadow: 0 18px 34px rgba(8, 40, 68, 0.42);
}

.history-trigger--open {
    background: rgba(255, 255, 255, 0.32);
    color: rgba(12, 48, 74, 0.88);
    border-color: rgba(184, 240, 255, 0.48);
    box-shadow: 0 16px 30px rgba(6, 38, 64, 0.4);
}

.history-trigger--open:hover,
.history-trigger--open:focus-visible {
    background: rgba(255, 255, 255, 0.46);
    color: rgba(6, 36, 64, 0.92);
    border-color: rgba(208, 248, 255, 0.56);
}

.history-trigger--pinned {
    background: rgba(255, 255, 255, 0.44);
    color: rgba(8, 40, 68, 0.88);
    border-color: rgba(164, 236, 255, 0.54);
    box-shadow: 0 18px 34px rgba(6, 34, 58, 0.42);
}

.history-trigger__icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    background: currentColor;
    -webkit-mask: url('../images/history-archive.svg') no-repeat center / contain;
    mask: url('../images/history-archive.svg') no-repeat center / contain;
    opacity: 0.92;
    transition: opacity 120ms ease;
}

.history-trigger:hover .history-trigger__icon,
.history-trigger:focus-visible .history-trigger__icon,
.thumbnail-history--open .history-trigger__icon {
    opacity: 1;
}

.history-shell {
    display: flex;
    overflow: hidden;
    transform-origin: left center;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 auto;
    max-width: 0;
}

.thumbnail-history--collapsed .history-shell {
    transform: scaleX(0);
    opacity: 0;
    max-width: 0;
}

.thumbnail-history--collapsed .history-shell,
.thumbnail-history--collapsed .history-container {
    pointer-events: none;
}

.thumbnail-history--open .history-shell {
    transform: scaleX(1);
    opacity: 1;
    max-width: 420px;
}

.thumbnail-history--pinned .history-shell {
    transform: scaleX(1);
    opacity: 1;
    max-width: 420px;
}

.history-panel {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: fit-content;
    min-width: 280px;
    max-width: 400px;
    transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumbnail-history--collapsed .history-container {
    opacity: 0;
    transform: translateX(-18px);
}

.history-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.history-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.history-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.history-clear-btn {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.history-clear-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.history-clear-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.history-clear-btn:disabled,
.history-clear-btn[aria-disabled="true"] {
    cursor: default;
    opacity: 0.4;
}

.history-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.history-thumbnails::-webkit-scrollbar {
    height: 0;
}

.history-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.history-thumbnail:hover {
    transform: scale(1.05);
}

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

.thumbnail-overlay {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px;
}

.thumbnail-remove {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.thumbnail-remove:hover {
    background: rgba(255, 0, 0, 0.8);
}

.history-tooltip-bubble {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, calc(-100% - 12px)) scale(0.96);
    transform-origin: 50% 100%;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(12, 16, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.35;
    letter-spacing: 0.01em;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    z-index: 2400;
    transition: opacity 160ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
    max-width: min(220px, 60vw);
    white-space: normal;
}

.history-tooltip-bubble.visible {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 12px)) scale(1);
}

.history-tooltip-bubble[data-placement="below"] {
    transform-origin: 50% 0%;
    transform: translate(-50%, 12px) scale(0.96);
}

.history-tooltip-bubble.visible[data-placement="below"] {
    transform: translate(-50%, 12px) scale(1);
}

.thumb-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    font-size: 0.7rem;
    padding: 8px 4px 4px;
    text-align: center;
    line-height: 1.2;
    opacity: 0;
    transition: var(--transition);
    transform: translateY(100%);
}

.history-thumbnail:hover .thumb-title {
    opacity: 1;
    transform: translateY(0);
}

.history-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
    z-index: 4;
}

.history-thumbnail:hover .history-remove,
.history-remove:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.history-remove:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.history-empty {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Movie Poster */
.overlay-poster {
    width: 240px;
    opacity: 0.95;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.55);
}

/* Movie Info Detailed */
.overlay-info {
    position: relative;
    z-index: 2001;
    color: white;
    background: linear-gradient(180deg, rgba(20,20,20,0.6), rgba(8,8,8,0.6));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    margin: 0;
    width: 100%;
    max-width: none;
}

.overlay-info-top {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 12px;
}

.overlay-title-group {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

.overlay-title-group .overlay-title {
    margin: 0;
}

.overlay-collection-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(164, 232, 255, 0.35);
    background: linear-gradient(145deg, rgba(12, 48, 80, 0.62), rgba(18, 66, 104, 0.38));
    color: rgba(210, 248, 255, 0.92);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    white-space: nowrap;
}

.overlay-collection-btn:hover,
.overlay-collection-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(210, 248, 255, 0.6);
    background: rgba(230, 249, 255, 0.28);
    color: rgba(12, 44, 66, 0.9);
    box-shadow: 0 12px 28px rgba(8, 24, 44, 0.45);
}

.overlay-collection-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(210, 248, 255, 0.55), 0 12px 28px rgba(8, 24, 44, 0.45);
}

.overlay-collection-icon {
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url('../images/icon-collection.svg') no-repeat center / contain;
    mask: url('../images/icon-collection.svg') no-repeat center / contain;
    opacity: 0.95;
}

.overlay-collection-text {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overlay-info-top .overlay-title {
    flex: 1;
    margin: 0;
}

.overlay-stream-slot {
    display: flex;
    flex-shrink: 0;
}

.overlay-stream-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    padding: 10px 20px;
}

.overlay-stream-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.overlay-credits {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.overlay-cast-scroll {
    display: flex;
    flex-direction: row;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.overlay-cast-scroll::-webkit-scrollbar {
    height: 8px;
}

.overlay-cast-scroll::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.overlay-cast-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.overlay-cast-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.overlay-cast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    flex: 0 0 calc((100% - 72px) / 5); /* 5 items with 18px gaps (4 gaps = 72px) */
    min-width: 120px;
    max-width: 180px;
    text-align: center;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    scroll-snap-align: start;
}

.overlay-cast-thumb {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
}

.overlay-cast-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-cast-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.2);
}

.overlay-cast-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.overlay-cast-item::-moz-focus-inner {
    border: 0;
}

.overlay-cast-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.overlay-cast-character {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
}

.overlay-cast-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.overlay-section h3 {
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.overlay-credit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
}

.overlay-credit-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 20, 20, 0.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    min-height: 220px;
}

.overlay-credit-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.18);
}

.overlay-credit-card img,
.overlay-credit-card .no-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.overlay-credit-card .no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.overlay-credit-card .credit-title {
    padding: 12px 14px 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    min-height: 44px;
}

.overlay-credit-card .credit-meta {
    padding: 0 14px 14px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .overlay-main {
        margin: 48px 28px;
    }
    
    .overlay-column-right {
        flex: 1 1 100%;
    }

    .person-overlay-main {
        width: min(920px, 94vw);
        margin: 56px auto 36px;
        gap: 24px;
    }

    .person-overlay-info {
        padding: clamp(24px, 3vw, 32px);
    }

    .collection-overlay-main {
        width: min(920px, 95vw);
        margin: 64px auto 40px;
    }
}

@media (max-width: 768px) {
    .overlay-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .overlay-main {
        flex-direction: column;
        margin: 32px 20px;
        gap: 24px;
    }
    
    .overlay-column-left,
    .overlay-column-right {
        width: 100%;
        flex: 1 1 100%;
    }
    
    .overlay-poster {
        width: 200px;
    }
    
    .overlay-info {
        padding: 24px 20px;
    }

    .overlay-info-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .overlay-stream-slot {
        width: 100%;
    }

    .overlay-stream-btn {
        width: 100%;
        justify-content: center;
    }

    .person-overlay-main {
        width: 100%;
        margin: 40px 20px 28px;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .person-overlay-spacer {
        display: none;
    }

    .person-overlay-info {
        max-width: none;
        width: 100%;
        padding: 24px 20px;
    }

    .person-portrait-floating {
        float: none;
        width: min(68vw, 260px);
        margin: 0 auto 20px;
    }

    .person-overview-block {
        min-height: auto;
    }

    .person-overview-text {
        font-size: 1rem;
    }

    .person-filmography-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .person-filmography-scroll {
        max-height: none;
        padding-right: 0;
        margin-right: 0;
        mask-image: none;
    }

    .collection-overlay-main {
        width: 100%;
        margin: 40px auto 24px;
    }

    .collection-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .collection-hero-art {
        width: min(70vw, 260px);
        margin: 0 auto;
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .thumbnail-history {
        bottom: 70px;
        left: 10px;
        max-width: 250px;
    }
    
    .history-container {
        padding: 10px;
        gap: 8px;
    }
    
    .history-thumbnail {
        width: 40px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .overlay-main {
        margin: 28px 16px;
    }

    .overlay-poster {
        width: 160px;
    }

    .overlay-cast-scroll {
        gap: 12px;
    }
    
    .overlay-cast-item {
        flex: 0 0 calc((100% - 48px) / 4); /* 4 items on smaller screens */
        min-width: 100px;
    }

    .close-overlay {
        width: 40px;
        height: 40px;
        top: 15px;
        right: 15px;
        font-size: 1.2rem;
    }

    .collection-hero-art {
        width: min(80vw, 240px);
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .thumbnail-history {
        bottom: 60px;
        left: 5px;
        max-width: 200px;
    }

    .history-thumbnail {
        width: 35px;
        height: 52px;
    }

    .person-overlay-info {
        padding: 20px 16px;
    }

    .person-portrait-floating {
        width: min(72vw, 220px);
    }

    .overlay-credit-grid--compact {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .person-filmography-scroll {
        max-height: none;
    }

    /* Mobile livestreaming button - keep simple size, no pseudo-elements */
    a.livestreaming {
        width: 180px;
        height: 88px;
        background: none;
        box-shadow: none;
        border: 0;
    }
}

/* Responsive Thumbnail History */
@media (max-width: 768px) {
    .thumbnail-history {
        bottom: 20px;
        left: 10px;
    }

    .history-trigger {
        padding: 10px 18px;
        font-size: 0.85rem;
        min-width: 140px;
    }

    .history-container {
        min-width: 250px;
        max-width: calc(100vw - 80px);
    }

    .history-thumbnails {
        max-height: 100px;
        gap: 8px;
    }

    .history-thumbnail {
        width: 60px;
        height: 90px;
    }
}

@media (max-width: 480px) {
    .thumbnail-history {
        bottom: 15px;
        left: 5px;
    }

    .history-trigger {
        padding: 10px 16px;
        font-size: 0.8rem;
        min-width: 128px;
    }

    .history-container {
        min-width: 200px;
        padding: 12px;
    }

    .history-thumbnails {
        gap: 6px;
    }

    .history-thumbnail {
        width: 50px;
        height: 75px;
    }
}

/* Animation for overlay show/hide */
@keyframes overlayShow {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes overlayContentShow {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.movie-overlay:not(.hidden) {
    animation: overlayShow 0.4s ease-out;
}

.movie-overlay:not(.hidden) .overlay-content {
    animation: overlayContentShow 0.4s ease-out;
}

/* =============================================
   Videos & Trailers Section
   ============================================= */
.overlay-videos {
    margin-top: 24px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    pointer-events: auto;
    position: relative;
    z-index: 5;
}

.overlay-videos h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

.overlay-videos-scroll {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 236, 255, 0.45) rgba(20, 24, 36, 0.6);
}

.overlay-videos-scroll::-webkit-scrollbar {
    width: 6px;
}

.overlay-videos-scroll::-webkit-scrollbar-track {
    background: rgba(20, 24, 36, 0.6);
    border-radius: 4px;
}

.overlay-videos-scroll::-webkit-scrollbar-thumb {
    background: rgba(196, 236, 255, 0.45);
    border-radius: 4px;
}

.overlay-video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-align: center;
    font: inherit;
    appearance: none;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.overlay-video-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.overlay-video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

.overlay-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    transition: all 0.2s ease;
}

.overlay-video-item:hover .overlay-video-play-icon {
    background: rgba(255, 0, 0, 0.85);
    transform: translate(-50%, -50%) scale(1.1);
}

.overlay-video-name {
    font-weight: 500;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.overlay-video-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
}

/* YouTube Player Overlay */
.youtube-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-overlay .overlay-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    overflow: visible;
}

.youtube-overlay .close-overlay {
    position: absolute;
    top: -50px;
    right: 0;
    z-index: 2147483647;
}

.youtube-player-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.youtube-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.youtube-close-btn {
    position: absolute;
    top: -60px;
    right: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.youtube-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (max-width: 1200px) {
    .overlay-videos-scroll {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .overlay-videos-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
}