@import url('party.css');

:root {
    --primary-red: #e50914;
    --dark-bg: #141414;
    --dark-search: #1c1c1c;
    --text-light: #ffffff;
    --text-muted: #e5e5e5;
    --navbar-bg: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0));
    --navbar-scrolled: #141414;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent any element from exceeding viewport width */
    max-width: 100%;
}

/* Reset max-width for known wide containers */
body, .navbar, .hero, .search-view, .main-content,
.row, .row-posters, .player-wrap, .iframe-container {
    max-width: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

html {
    overflow-x: hidden;
    /* Fixes Windows DPI scaling layout bugs */
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-light);
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

.hidden {
    display: none !important;
}

/* Navbar - Ultra Premium Cinematic */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 35px 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    z-index: 2000;
    transition: padding 0.3s ease, background 0.3s ease;
}

.navbar.scrolled {
    padding: 18px 4%;
    background: rgba(0, 0, 0, 0.8);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 70px;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.08);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    transition: color 0.3s ease;
    display: inline-block;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: #fff;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a:active {
    color: #ccc;
}

.nav-links a.active {
    color: #fff;
}

.nav-links a.active::after, .nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* Search Bar Minimal Premium */
.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-icon {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.2s ease;
}

.search-icon:hover {
    color: #fff;
}

#search-input {
    width: 0;
    border: none;
    background: none;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: width 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.search-container.active #search-input {
    width: 280px;
    max-width: 50vw; /* Prevents stretching on ultrawide / Windows high-DPI */
    opacity: 1;
    padding: 8px 0;
}

/* Search Results Grid Elevation */
.search-view {
    padding: 130px 4% 50px;
    min-height: 100vh;
    animation: fadeIn 0.5s ease forwards;
    background: radial-gradient(circle at top, rgba(255,255,255,0.03) 0%, transparent 70%);
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Hero Section - Ultra-Premium Elite Aesthetic */
.hero {
    position: relative;
    height: 98vh;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 0 10%;
    animation: fadeIn 1.5s ease-out;
    overflow: hidden;
}

/* Subtle Cinematic Tint Overlay — runs once then stops */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,0.02), transparent);
    background-size: 200% 100%;
    animation: lightSweep 3s ease-out forwards;
    z-index: 1;
    pointer-events: none;
}

@keyframes lightSweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 50%, transparent 0%, rgba(10,10,10,0.5) 45%, rgba(10,10,10,0.95) 100%),
                linear-gradient(to right, rgba(10,10,10,1) 0%, rgba(10,10,10,0.85) 25%, transparent 60%),
                linear-gradient(to top, rgba(10,10,10,1) 0%, rgba(10,10,10,0.7) 15%, transparent 40%),
                linear-gradient(to bottom, rgba(10,10,10,0.8) 0%, transparent 30%); /* Top Fade */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Staggered Reveal System */
.hero-title, .hero-description, .hero-buttons, .hero-meta {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

.hero-title, .hero-description, .hero-buttons, .hero-meta {
    animation-fill-mode: forwards;
}

/* Re-enable pointer events when fully revealed */
.hero-buttons {
    pointer-events: auto;
}

.hero-meta {
    animation: trailerFadeIn 0.8s cubic-bezier(0.2, 1, 0.3, 1) 0.6s forwards;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    gap: 25px;
    align-items: center;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    font-weight: 700;
}

.hero-title {
    animation: trailerFadeIn 1s cubic-bezier(0.2, 1, 0.3, 1) 0.8s forwards;
    font-family: 'Playfair Display', Georgia, serif;
    /* clamp prevents overflow on Windows at 125%/150% DPI */
    font-size: clamp(2.2rem, 6vw, 5.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -1px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #fff 0%, #ececec 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-description {
    animation: trailerFadeIn 1s cubic-bezier(0.2, 1, 0.3, 1) 1s forwards;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 600px;
    font-weight: 400;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-buttons {
    animation: trailerFadeIn 1s cubic-bezier(0.2, 1, 0.3, 1) 1.2s forwards;
    display: flex;
    gap: 18px;
}

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

.btn {
    height: 48px;
    padding: 0 36px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, background-color 0.15s ease,
                box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Page Load Pulse (Once) — opacity-only for GPU efficiency */
@keyframes singlePulse {
    0%   { opacity: 0.85; }
    50%  { opacity: 1; }
    100% { opacity: 1; }
}

.btn-play {
    background-color: #fff;
    color: #000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    animation: singlePulse 1.5s ease-out 1s;
}

.btn-play:hover {
    background-color: #e8e8e8;
    transform: scale(1.03) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.btn-play:active {
    transform: scale(0.97);
    background-color: #d0d0d0;
}

.btn-info {
    background-color: rgba(109, 109, 110, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.btn-info:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
    transform: scale(1.03) translateY(-2px);
}

.btn-info:active {
    transform: scale(0.97);
    background-color: rgba(109, 109, 110, 0.3);
}

/* Rows & Movie Cards */
.main-content {
    padding: 0 4%;
    position: relative;
    z-index: 2;
    margin-top: -120px; /* Overlap hero */
}

.row {
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    content-visibility: auto;
    contain-intrinsic-size: 0 320px;
}

.row-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
    padding-left: 5px;
    letter-spacing: 0.3px;
    color: rgba(255,255,255,0.9);
}

.row-posters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible; /* CRITICAL FIX: allow cards to scale outside row container */
    padding: 30px 20px;
    margin: 0 -20px;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    min-height: 250px; /* CRITICAL FIX: prevents flex-collapse when images load late */
    scroll-snap-type: x mandatory;
}

.row-posters::-webkit-scrollbar {
    height: 0px; 
}

.row-posters:hover::-webkit-scrollbar {
    height: 8px;
}

.row-posters::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.card {
    position: relative;
    flex: 0 0 calc(100% / 6 - 8px);
    width: calc(100% / 6 - 8px);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform-origin: center center;
    aspect-ratio: 2/3;
    background-color: var(--dark-search);
    flex-shrink: 0;
    scroll-snap-align: start;
    z-index: 5;
    pointer-events: auto;
    overflow: hidden;
    contain: content;
}

.search-grid .card {
    width: 100%;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* No shadow on img itself — shadow is on card:hover below */
    transition: opacity 0.4s ease;
    border-radius: 0; /* card overflow:hidden handles clipping */
}

.card:hover {
    transform: translateY(-4px) scale(1.03);
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

/* Netflix style row expansion logic for extreme left/right edges */
.row-posters .card:first-child:hover { transform-origin: left center; }
.row-posters .card:last-child:hover { transform-origin: right center; }

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; /* Let clicks pass through to the card */
}

.card-overlay * {
    pointer-events: auto; /* Re-enable for buttons inside */
}

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

.card-overlay .play-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: var(--primary-red);
    border-radius: 50%;
    color: white;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
    transition: transform 0.2s;
}

.card:hover .play-icon {
    transform: scale(1.1);
}

.play-icon i {
    margin-left: 2px;
}

/* Lucide adjustments */
.lucide {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.search-icon .lucide {
    color: white;
    transition: transform 0.2s;
}

.search-icon:hover .lucide {
    transform: scale(1.1);
}


/* Animations & Skeletons */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    color: transparent !important;
    text-shadow: none !important;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 1024px) {
    .card { flex: 0 0 calc(100% / 4 - 8px); width: calc(100% / 4 - 8px); }
    .hero { padding: 0 6%; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding: 0 5%; }
    .hero-title { font-size: clamp(1.8rem, 7vw, 2.5rem); }
    .hero-description { font-size: 1rem; margin-bottom: 24px; }
    .card { flex: 0 0 calc(100% / 3 - 8px); width: calc(100% / 3 - 8px); }
    .btn { padding: 12px 28px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .card { flex: 0 0 calc(100% / 2 - 8px); width: calc(100% / 2 - 8px); }
    .hero-buttons { gap: 10px; }
    .btn { padding: 10px 20px; font-size: 0.8rem; }
}

/* Details Page UI Enhancements */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}
.details-hero {
    height: 70vh;
    animation: fadeIn 0.8s ease; /* No panning, maintain center */
    background-size: cover;
    background-position: center 20%;
    overflow: hidden;
}
/* Details hero vignette (referenced by details.html) */
.details-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 50%, transparent 0%, rgba(10,10,10,0.5) 45%, rgba(10,10,10,0.95) 100%),
                linear-gradient(to right, rgba(10,10,10,1) 0%, rgba(10,10,10,0.85) 25%, transparent 60%),
                linear-gradient(to top, rgba(10,10,10,1) 0%, rgba(10,10,10,0.7) 15%, transparent 40%),
                linear-gradient(to bottom, rgba(10,10,10,0.8) 0%, transparent 30%);
    z-index: 2;
    pointer-events: none;
}
.details-main {
    margin-top: -60px; /* Overlap gradient comfortably */
}
.details-meta {
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 8px;
    transition: opacity 0.3s;
}
.meta-rating { color: #46d369; font-weight: 600; }
.meta-year, .meta-runtime { font-weight: 500; }

.details-genres {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: #a3a3a3;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.dot { color: #555; }

/* Episodes UI */
.season-select {
    padding: 8px 16px;
    background: #242424;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    padding-bottom: 40px;
}

.episode-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 16px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s ease;
    /* Single consistent separator — no double border noise */
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.episode-card:hover {
    background: rgba(255,255,255,0.08);
}

.episode-card:active {
    background: rgba(255,255,255,0.06);
}

.ep-img {
    position: relative;
    width: 150px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
}
.ep-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.ep-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.episode-card:hover .ep-img::after {
    opacity: 1;
}

.episode-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.episode-card .play-icon i {
    color: #fff;
    margin-left: 3px; /* Optically center triangle */
}

.episode-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255,255,255,0.2), 0 0 15px rgba(0,0,0,0.5);
}

.ep-info {
    flex-grow: 1;
}
.ep-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}
.ep-runtime {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.ep-desc {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .episode-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .ep-img { width: 100%; max-width: 300px; }
}

/* --- INTERACTIVE POLISH (Card info & Buttons) --- */
.card-info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.card:hover .card-info-btn {
    opacity: 1;
}

.card-info-btn:hover {
    background: white;
    color: black;
    transform: scale(1.1);
}

.btn-list {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}

.btn-list:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

.btn-list.added {
    background-color: white;
    color: black;
}

/* --- MODAL PLAYER (in-page video overlay) --- */
.vailism-modal-player {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.vailism-modal-player.active {
    opacity: 1;
}
.vailism-modal-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}
.vailism-modal-back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10001;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 10px 18px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.15s ease;
}
.vailism-modal-player.active .vailism-modal-back {
    opacity: 1;
}
.vailism-modal-back:hover {
    background: rgba(255,255,255,0.15);
}
.vailism-modal-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 10000;
    transition: opacity 0.3s ease;
}
.vailism-modal-loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.vailism-modal-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(229,9,20,0.15);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: vailism-spin 0.8s linear infinite;
}
@keyframes vailism-spin {
    to { transform: rotate(360deg); }
}
.vailism-modal-loader span {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 16px;
    font-family: 'Outfit', system-ui, sans-serif;
    transition: opacity 0.2s ease;
}
/* Iframe starts hidden behind the loader — revealed only after buffer grace */
.vailism-modal-player iframe {
    position: absolute;
    inset: 0;
}

/* --- MODAL PLAYER SERVER SWITCHER --- */
.vailism-modal-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10001;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.vailism-modal-controls > * {
    pointer-events: auto;
}
.vailism-modal-controls .vailism-modal-back {
    position: static;
    opacity: 1;
}
.vailism-modal-right {
    display: flex;
    gap: 12px;
    position: relative;
}
.vailism-server-container {
    position: relative;
}
.vailism-server-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.vailism-server-btn:hover {
    background: rgba(40, 40, 40, 0.9);
    border-color: rgba(255,255,255,0.3);
}
.vailism-server-dropdown {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: rgba(14, 14, 14, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px;
    min-width: 280px;
    z-index: 10002;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    font-family: 'Outfit', sans-serif;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.vailism-server-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.vailism-server-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vailism-server-option {
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-family: 'Outfit', system-ui, sans-serif;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}
.vailism-server-option:hover {
    background: rgba(255,255,255,0.05);
}
.vailism-server-option.active {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
}
.vailism-server-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.vailism-server-option.active .vailism-server-title {
    color: #e50914;
}
.vailism-server-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    white-space: normal;
}


/* --- MINIMALIST UI CLEANUP --- */
.nav-links, .btn-list, .plus-icon {
    display: none !important;
}

.navbar {
    justify-content: space-between;
    padding-left: 5%;
    padding-right: 5%;
}

@media (min-width: 1200px) {
    .navbar {
        padding-left: 6%;
        padding-right: 6%;
    }
}

/* --- WATCHLIST BUTTON STYLING --- */
.btn-watchlist {
    background-color: rgba(109, 109, 110, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
}
.btn-watchlist.in-list {
    background-color: rgba(70, 211, 105, 0.2);
    border-color: rgba(70, 211, 105, 0.4);
    color: #46d369;
}
.btn-watchlist.in-list:hover {
    background-color: rgba(70, 211, 105, 0.3);
    border-color: rgba(70, 211, 105, 0.5);
}

/* --- CINEMATIC TRAILER MODAL --- */
.trailer-modal {
    position: fixed;
    inset: 0;
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.3s ease;
}
.trailer-modal.show {
    opacity: 1;
    visibility: visible;
}
.trailer-container {
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16/9;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    background: #000;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.trailer-modal.show .trailer-container {
    transform: scale(1.0);
}
.trailer-close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}
.trailer-close-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}
.trailer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- CAST GALLERY --- */
.cast-section {
    contain-intrinsic-size: 0 160px;
}
.cast-card {
    flex: 0 0 120px;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    contain: layout style;
}
.cast-card:hover {
    transform: translateY(-4px);
}
.cast-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    background-color: var(--dark-search);
}
.cast-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}
.cast-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cast-character {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* CLS Reservoirs for watch history and watchlist row offsets */
.main-content {
    min-height: 100vh;
}

/* ── Premium UX Additions ── */

/* Spatial Navigation */
.spatial-focus, :focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 2px;
    transform: scale(1.05) !important;
    z-index: 50 !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    transition: transform 0.2s ease, outline 0.1s ease;
}

/* Skeleton Shimmer */
.skeleton-card {
    background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 6px;
    width: 100%;
    height: 100%;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Binge-Watch Overlay */
.binge-overlay {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    z-index: 100;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}
.binge-overlay.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.binge-info h4 {
    margin: 0;
    font-size: 14px;
    color: #aaa;
    font-weight: 500;
}
.binge-info p {
    margin: 4px 0 0 0;
    font-size: 16px;
    font-weight: 600;
}
.binge-btn {
    background: var(--primary-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.binge-btn:hover {
    background: #f40612;
}

/* PWA Install Button */
#installAppBtn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: none;
    transition: all 0.2s ease;
    margin-right: 15px;
}
#installAppBtn:hover {
    background: #fff;
    color: #000;
}
@media(max-width: 768px) {
    #installAppBtn { display: none !important; }
}

/* Profile Button */
.profile-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}
.profile-btn svg {
    width: 20px;
    height: 20px;
}

/* --- SPLIT PANE AUTH MODAL --- */
.auth-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-modal.hidden {
    display: none !important;
}
.auth-modal-content.split-pane {
    display: flex;
    background: rgba(14, 14, 14, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 900px;
    max-width: 95%;
    min-height: 550px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
    overflow: hidden;
    animation: authModalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes authModalSlideIn {
    from { transform: scale(0.95) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}
.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

/* Left Pane (Visual) */
.auth-visual-panel {
    flex: 1;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.15) 0%, rgba(10, 10, 10, 0.9) 100%),
                url('logo.png') no-repeat center center / cover;
    position: relative;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.auth-visual-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}
.visual-content {
    position: relative;
    z-index: 2;
}
.auth-logo {
    height: 35px;
    margin-bottom: 30px;
}
.visual-content h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 30px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255,255,255,0.8);
}
.auth-features li svg {
    width: 20px;
    height: 20px;
    color: var(--primary-red);
}

/* Right Pane (Form) */
.auth-form-panel {
    flex: 1.1;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    background: rgba(14, 14, 14, 0.95);
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}
.auth-tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}
.auth-tab-btn:hover { color: #fff; }
.auth-tab-btn.active { color: #fff; }
.auth-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; width: 100%; height: 2px;
    background: var(--primary-red);
    box-shadow: 0 0 10px var(--primary-red);
}

/* Panes */
.auth-tab-pane { display: none; animation: fadeIn 0.3s ease; }
.auth-tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: rgba(255, 255, 255, 0.7); margin-bottom: 8px;
}
.form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 14px 16px;
    color: #fff;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-group input:focus {
    outline: none;
    border-color: rgba(229, 9, 20, 0.8);
    background: rgba(229, 9, 20, 0.05);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}
.password-input-wrapper { position: relative; }
.pwd-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.pwd-toggle:hover { color: #fff; }
.pwd-toggle svg { width: 18px; height: 18px; }

/* Options (Remember me / Forgot Pwd) */
.form-options {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: rgba(255,255,255,0.7); cursor: pointer;
}
.forgot-pwd-link {
    font-size: 13px; color: rgba(255,255,255,0.6); text-decoration: none;
    transition: color 0.2s;
}
.forgot-pwd-link:hover { color: #fff; text-decoration: underline; }

/* Buttons */
.btn-primary {
    background: var(--primary-red);
    color: #fff; border: none; border-radius: 8px;
    padding: 14px; font-weight: 600; font-size: 15px;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-primary:hover { background: #f40612; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(229,9,20,0.4); }
.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #fff; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    padding: 14px; font-weight: 600; font-size: 15px;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }

/* Dividers */
.auth-divider {
    display: flex; align-items: center; text-align: center; margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.auth-divider span {
    padding: 0 10px; color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600;
}

/* Google Icon */
.google-icon { width: 20px; height: 20px; }

/* Sync Footer */
.sync-info-footer {
    margin-top: auto; padding-top: 30px;
    text-align: center;
}
.sync-info-footer p {
    font-size: 12px; color: rgba(255,255,255,0.5); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sync-info-footer svg { width: 16px; height: 16px; color: #4caf50; }
.sync-info-footer span { color: #4caf50; font-weight: 600; }

/* Messages */
.form-error { color: #ff4b4b; font-size: 13px; margin-bottom: 15px; min-height: 18px; font-weight: 500; }

/* Profile View when logged in */
#loggedInProfileView { text-align: center; padding: 20px 0; }
.profile-summary { margin-bottom: 30px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.1); margin: 0 auto 15px; display: flex; align-items: center; justify-content: center; }
.profile-avatar svg { width: 40px; height: 40px; color: var(--primary-red); }
.profile-summary h3 { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.profile-summary p { font-size: 14px; color: rgba(255,255,255,0.6); }

/* Responsive adjustments */
@media(max-width: 768px) {
    .auth-modal-content.split-pane { flex-direction: column; width: 100%; height: 100%; border-radius: 0; max-width: 100%; }
    .auth-visual-panel { display: none; }
    .auth-form-panel { padding: 30px 25px; }
}

