:root {
    /* CineHub Color Palette */
    --bg-deep: #070A12;
    --bg-card: #0F1320;
    --bg-elevated: #161B2E;
    --accent-cyan: #00D2F5;
    --accent-gold: #FFB300;
    --accent-red: #E53935;
    --text-high: #EEF2FF;
    --text-med: #8892B0;
    --glass-bg: rgba(15, 19, 32, 0.7);
    --glass-border: rgba(0, 210, 245, 0.2);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Transitions */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-high);
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 210, 245, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 179, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(229, 57, 53, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Noise Texture Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: overlay;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 100;
    animation: slideDown 0.6s var(--transition-smooth);
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-high);
    cursor: pointer;
    transition: transform 0.3s var(--transition-bounce);
    letter-spacing: 1px;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 210, 245, 0.4);
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 var(--spacing-lg);
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-high);
    font-family: var(--font-body);
    font-size: 0.875rem;
    transition: all 0.3s var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 210, 245, 0.1), 0 0 20px rgba(0, 210, 245, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-med);
    pointer-events: none;
}

.download-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-cyan);
    border: none;
    border-radius: 12px;
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 210, 245, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 210, 245, 0.5);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
    width: 240px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: var(--spacing-lg) 0;
    z-index: 90;
    animation: slideRight 0.6s var(--transition-smooth);
    overflow-y: auto;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 89;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--transition-smooth);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

@keyframes slideRight {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-med);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-cyan);
    transform: scaleY(0);
    transition: transform 0.3s var(--transition-smooth);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-high);
    background: rgba(0, 210, 245, 0.05);
}

.nav-item:hover::before, .nav-item.active::before {
    transform: scaleY(1);
}

.nav-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s var(--transition-bounce);
}

.nav-item:hover .nav-icon {
    transform: scale(1.2) rotate(5deg);
}

/* Main Content */
.main-content {
    margin-left: 240px;
    margin-top: 70px;
    padding: var(--spacing-xl) var(--spacing-md);
    padding-bottom: 2rem;
    min-height: calc(100vh - 70px);
}

/* Page Transition */
.page-view {
    opacity: 0;
    animation: fadeIn 0.5s var(--transition-smooth) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    position: relative;
    height: 500px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.8s var(--transition-smooth);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(7, 10, 18, 1) 5%, rgba(7, 10, 18, 0.4) 60%, transparent 100%),
                linear-gradient(to top, rgba(7, 10, 18, 1) 0%, transparent 40%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-xl);
    max-width: 700px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.2s backwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text-high);
    animation: fadeInUp 0.8s var(--transition-smooth) 0.3s backwards;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-med);
    margin-bottom: 2rem;
    line-height: 1.6;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.4s backwards;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.5s backwards;
}

.btn-primary {
    padding: 1rem 2rem;
    background: var(--text-high);
    border: none;
    border-radius: 12px;
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--accent-cyan);
    box-shadow: 0 6px 25px rgba(0, 210, 245, 0.4);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-high);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.btn-secondary:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 245, 0.2);
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s var(--transition-smooth) forwards;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
}

.section-icon { font-size: 1.5rem; }

.section-more {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s var(--transition-smooth);
    cursor: pointer;
}

.section-more:hover {
    gap: 0.75rem;
    text-shadow: 0 0 10px rgba(0, 210, 245, 0.5);
}

/* Horizontal Scroller */
.movies-scroller {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) var(--bg-card);
}

.movies-scroller::-webkit-scrollbar { height: 8px; }
.movies-scroller::-webkit-scrollbar-track { background: var(--bg-card); border-radius: 4px; }
.movies-scroller::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 4px; }

/* Movie Card - FIXED ASPECT RATIO */
.movie-card {
    position: relative;
    min-width: 200px;
    width: 200px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s var(--transition-smooth);
    background: var(--bg-card);
}

.movie-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 210, 245, 0.4);
}

.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(7, 10, 18, 0.9), transparent);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s var(--transition-smooth);
}

.movie-card:hover::before { opacity: 1; }

.movie-poster {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s var(--transition-smooth);
}

.movie-card:hover .movie-poster { transform: scale(1.1); }

.movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.3s var(--transition-smooth);
}

.movie-card:hover .movie-info { transform: translateY(0); }

.movie-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-med);
}

.movie-rating {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.625rem;
    background: var(--accent-cyan);
    color: var(--bg-deep);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.3s var(--transition-bounce);
    box-shadow: 0 0 30px rgba(0, 210, 245, 0.5);
}

.movie-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1);
}

.play-icon {
    width: 0; height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid var(--accent-cyan);
    margin-left: 4px;
}

/* ============================================= */
/* DETAILS PAGE STYLES */
/* ============================================= */

.detail-page {
    display: none;
}

.detail-page.active {
    display: block;
}

.detail-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    margin: -3rem -1.5rem 3rem;
    overflow: hidden;
}

.detail-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
}

.detail-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(7, 10, 18, 1) 0%, rgba(7, 10, 18, 0.7) 50%, transparent 100%),
                linear-gradient(to right, rgba(7, 10, 18, 0.9) 0%, rgba(7, 10, 18, 0.3) 50%, transparent 100%);
}

.detail-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.back-button {
    position: absolute;
    top: 2rem;
    left: 2rem;
    padding: 0.75rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-high);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.back-button:hover {
    border-color: var(--accent-cyan);
    transform: translateX(-5px);
}

.detail-poster {
    width: 300px;
    aspect-ratio: 2/3;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
    padding-left: 3rem;
}

.detail-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text-high);
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-cyan);
    color: var(--bg-deep);
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.125rem;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-med);
    font-size: 0.9375rem;
}

.detail-genre-tags {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.genre-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-high);
}

.detail-description {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-med);
    margin-bottom: 2rem;
    max-width: 700px;
}

.detail-buttons {
    display: flex;
    gap: 1rem;
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.0625rem;
}

/* Detail Body */
.detail-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.detail-section {
    margin-bottom: 3rem;
}

.detail-section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-high);
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.cast-member {
    text-align: center;
}

.cast-photo {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    background: var(--bg-elevated);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-name {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    color: var(--text-high);
}

.cast-character {
    font-size: 0.8125rem;
    color: var(--text-med);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-med);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    color: var(--text-high);
    line-height: 1.5;
}

/* Loading Spinner */
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Mobile Bottom Navigation */
.bottom-nav { display: none; }

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content { margin-left: 240px; padding: var(--spacing-lg) var(--spacing-md); }
    .hero-content { padding: 0 var(--spacing-lg); }
    .detail-content { padding: 2rem; }
    .detail-poster { width: 240px; }
    .detail-info { padding-left: 2rem; }
    .detail-title { font-size: 2.75rem; }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s var(--transition-smooth); z-index: 200; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: var(--spacing-md); }
    .search-container { margin: 0 var(--spacing-sm); max-width: 400px; }
    .hero-title { font-size: 3rem; }
    .movie-card { min-width: 180px; width: 180px; }
    .movie-poster { height: 270px; }
    .detail-content { flex-direction: column; align-items: flex-start; }
    .detail-poster { width: 200px; margin-bottom: 2rem; }
    .detail-info { padding-left: 0; }
    .detail-title { font-size: 2.25rem; }
}

@media (max-width: 768px) {
    :root { --spacing-xs: 0.375rem; --spacing-sm: 0.75rem; --spacing-md: 1rem; --spacing-lg: 1.5rem; --spacing-xl: 2rem; }
    .top-nav { padding: 0 1rem; height: 60px; }
    .logo { font-size: 1.25rem; }
    .logo-icon { width: 28px; height: 28px; }
    .search-container { display: none; }
    .download-btn { padding: 0.625rem 1rem; font-size: 0.75rem; }
    .sidebar { top: 60px; }
    .main-content { padding: var(--spacing-md) var(--spacing-sm); margin-top: 60px; margin-bottom: 80px; }
    .hero { height: 350px; border-radius: 16px; margin-bottom: var(--spacing-lg); }
    .hero-content { padding: 0 var(--spacing-md); }
    .hero-badge { font-size: 0.625rem; padding: 0.375rem 0.75rem; }
    .hero-title { font-size: 2rem; line-height: 1.1; }
    .hero-description { font-size: 0.875rem; margin-bottom: 1.5rem; }
    .hero-buttons { flex-direction: row; gap: 0.75rem; }
    .btn-primary, .btn-secondary { padding: 0.875rem 1.25rem; font-size: 0.875rem; flex: 1; justify-content: center;}
    .content-section { margin-bottom: 2rem; }
    .section-header { margin-bottom: 1rem; }
    .section-title { font-size: 1.25rem; gap: 0.5rem; }
    .section-icon { font-size: 1.25rem; }
    .section-more { font-size: 0.875rem; }
    .movie-card { min-width: 150px; width: 150px; border-radius: 12px; }
    .movie-poster { height: 225px; }
    .play-overlay { width: 50px; height: 50px; }
    .play-icon { border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid var(--accent-cyan); margin-left: 3px; }
    .movie-rating { font-size: 0.625rem; padding: 0.25rem 0.5rem; }
    .movie-title { font-size: 0.875rem; }
    .movie-meta { font-size: 0.625rem; }
    
    /* Detail Page Mobile */
    .detail-hero { margin: -1rem -0.75rem 2rem; height: 60vh; min-height: 400px; }
    .detail-content { padding: 1.5rem; }
    .back-button { top: 1rem; left: 1rem; padding: 0.5rem 0.875rem; font-size: 0.75rem; }
    .detail-poster { width: 160px; }
    .detail-title { font-size: 1.75rem; }
    .detail-rating { font-size: 1rem; padding: 0.375rem 0.75rem; }
    .detail-meta-item { font-size: 0.8125rem; }
    .genre-tag { font-size: 0.6875rem; padding: 0.375rem 0.75rem; }
    .detail-description { font-size: 0.9375rem; }
    .detail-buttons { flex-direction: column; }
    .btn-large { padding: 1rem 2rem; font-size: 0.9375rem; width: 100%; justify-content: center; }
    .detail-section-title { font-size: 1.375rem; }
    .cast-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 1rem; }
    .cast-name { font-size: 0.8125rem; }
    .cast-character { font-size: 0.6875rem; }
    
    /* Mobile Bottom Navigation */
    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 70px;
        background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--glass-border); z-index: 100; justify-content: space-around;
        align-items: center; padding: 0 var(--spacing-sm); animation: slideUp 0.6s var(--transition-smooth);
    }
    @keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    
    .bottom-nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 0.25rem; color: var(--text-med);
        text-decoration: none; font-size: 0.625rem; font-weight: 600; padding: 0.5rem 1rem;
        border-radius: 12px; transition: all 0.3s var(--transition-bounce); position: relative;
        cursor: pointer;
    }
    .bottom-nav-item.active { color: var(--accent-cyan); background: rgba(0, 210, 245, 0.1); transform: scale(1.1); }
    .bottom-nav-item:active { transform: scale(0.95); }
    .bottom-nav-icon { width: 24px; height: 24px; transition: transform 0.3s var(--transition-bounce); }
    .bottom-nav-item.active .bottom-nav-icon { transform: scale(1.2); }
}

@media (max-width: 480px) {
    .hero { height: 300px; }
    .hero-title { font-size: 1.75rem; }
    .hero-description { font-size: 0.8125rem; line-height: 1.5; }
    .btn-primary, .btn-secondary { padding: 0.75rem 1rem; font-size: 0.8125rem; }
    .movie-card { min-width: 130px; width: 130px; }
    .movie-poster { height: 195px; }
    .play-overlay { width: 45px; height: 45px; }
    .play-icon { border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid var(--accent-cyan); margin-left: 2px; }
    .section-title { font-size: 1.125rem; }
    .download-btn { padding: 0.5rem 0.875rem; font-size: 0.6875rem; }
    .logo { font-size: 1.125rem; }
    .bottom-nav { height: 65px; }
    .bottom-nav-item { padding: 0.375rem 0.625rem; font-size: 0.5625rem; }
    .bottom-nav-icon { width: 20px; height: 20px; }
    .detail-title { font-size: 1.5rem; }
    .detail-description { font-size: 0.875rem; }
}

@media (min-width: 769px) { .bottom-nav { display: none; } }

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-high);
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 1024px) {
    .menu-btn { display: block; }
}
/* ─────────────────────────────────────────────
   Hero Slider — poster + blurred bg layout
───────────────────────────────────────────── */
.hero-slider {
    height: 520px;
    position: relative;
    overflow: hidden;
}

.hero-slides-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: all;
}

/* Blurred background — fills the whole hero */
.hero-bg-blur {
    position: absolute;
    inset: -20px;                  /* slightly oversized so blur edges don't show */
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.35) saturate(1.2);
    transform: scale(1.08);        /* hides the blurred edge fringing */
    z-index: 0;
}

/* Dark gradient on top of blurred bg */
.hero-slide .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(7,10,18,0.55) 0%,
        rgba(7,10,18,0.15) 50%,
        rgba(7,10,18,0.55) 100%
    ), linear-gradient(
        to top,
        rgba(7,10,18,0.9) 0%,
        transparent 50%
    );
    z-index: 1;
}

/* Two-column inner layout */
.hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 2rem 3rem;
}

/* Poster column */
.hero-poster-wrap {
    flex-shrink: 0;
    width: 200px;
    height: 300px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08);
}

.hero-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Info column */
.hero-slide .hero-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
    padding: 0;               /* reset the old padding since hero-inner handles it */
    height: auto;
}

/* Badge row */
.hero-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-high);
    width: fit-content;
    margin-bottom: 0;
}

.hero-badge-rating {
    background: rgba(255, 179, 0, 0.15);
    border-color: rgba(255, 179, 0, 0.5);
    color: var(--accent-gold);
}

.hero-badge-type {
    background: rgba(0, 210, 245, 0.1);
    border-color: rgba(0, 210, 245, 0.4);
    color: var(--accent-cyan);
}

.hero-badge-year {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
}

/* Genre tags inside hero */
.hero-genre-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.hero-genre-tag {
    padding: 0.22rem 0.7rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-med);
    background: rgba(255,255,255,0.05);
}

/* Prev / Next arrows */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-high);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0;
}

.hero-slider:hover .hero-arrow { opacity: 1; }

.hero-arrow:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-deep);
    box-shadow: 0 0 18px rgba(0, 210, 245, 0.4);
}

.hero-arrow-prev { left: 1rem; }
.hero-arrow-next { right: 1rem; }

/* Dot indicators */
.hero-dots {
    position: absolute;
    bottom: 1.1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-dot.active {
    background: var(--accent-cyan);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 210, 245, 0.6);
}

.hero-dot:hover { background: rgba(255,255,255,0.6); }

/* Mobile: stack vertically, hide poster */
@media (max-width: 640px) {
    .hero-slider { height: 420px; }
    .hero-inner  { padding: 1.5rem; gap: 1.25rem; }
    .hero-poster-wrap { width: 110px; height: 165px; border-radius: 10px; }
    .hero-title  { font-size: 1.6rem !important; }
    .hero-description { display: none; }
}

/* ─────────────────────────────────────────────
   Coming Soon Cards
───────────────────────────────────────────── */
.coming-soon-card {
    position: relative;
    cursor: pointer;
}

/* Greyed out poster to signal "not yet available" */
.coming-soon-card .movie-poster {
    filter: brightness(0.55) saturate(0.6);
    transition: filter 0.3s ease;
}

.coming-soon-card:hover .movie-poster {
    filter: brightness(0.7) saturate(0.8);
}

/* Release date ribbon at top */
.coming-soon-ribbon {
    position: absolute;
    top: 10px;
    left: 0;
    z-index: 4;
    background: var(--accent-cyan);
    color: var(--bg-deep);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem 0.25rem 0.5rem;
    border-radius: 0 6px 6px 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}

/* Clock icon overlay in center */
.coming-soon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    color: rgba(255,255,255,0.55);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.coming-soon-card:hover .coming-soon-overlay {
    opacity: 1;
}

/* ─────────────────────────────────────────────
   Netflix-style Full Screen Video Player
───────────────────────────────────────────── */
.video-player-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    cursor: none;
}

.video-player-overlay:hover { cursor: default; }

/* Actual video — fills the whole screen */
.video-element {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    outline: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ── Loading spinner ── */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    gap: 1.25rem;
}

.player-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.player-loading-text {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Error state ── */
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    gap: 1rem;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 2rem;
}

.player-error svg { opacity: 0.5; }
.player-error p   { font-size: 1rem; max-width: 360px; line-height: 1.5; }

/* ── Top bar ── */
.player-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
    transition: opacity 0.35s ease;
}

.player-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.player-back-btn:hover { background: rgba(255,255,255,0.2); }

.player-title-text {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
}

/* ── Bottom controls ── */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    padding: 1rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    transition: opacity 0.35s ease;
}

/* Progress bar */
.player-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.player-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: height 0.15s ease;
}

.player-progress-bar:hover { height: 6px; }

.player-progress-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: var(--accent-cyan);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.player-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.player-progress-bar:hover .player-progress-thumb { transform: translate(-50%, -50%) scale(1); }

.player-time-current,
.player-time-total {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    min-width: 42px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Button row */
.player-btn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player-btn-left,
.player-btn-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.player-btn:hover { background: rgba(255,255,255,0.12); transform: scale(1.1); }
.player-btn:active { transform: scale(0.95); }

.player-btn-play {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.1);
}

.player-btn-play:hover { background: var(--accent-cyan) !important; color: var(--bg-deep); }

/* Volume slider */
.player-volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.player-volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* ── Player loading message (legacy compat) ── */
.player-msg { display: none; }

/* ─────────────────────────────────────────────
   Season Tabs & Episodes List
───────────────────────────────────────────── */
.season-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.season-tab {
    padding: 0.45rem 1.1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-med);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.season-tab:hover {
    border-color: var(--accent-cyan);
    color: var(--text-high);
}

.season-tab.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-deep);
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.episode-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.episode-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 210, 245, 0.05);
    transform: translateX(4px);
}

.episode-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 210, 245, 0.1);
    border: 1px solid rgba(0, 210, 245, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-cyan);
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-high);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-sub {
    font-size: 0.75rem;
    color: var(--text-med);
    margin-top: 0.2rem;
}

.episode-play-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-high);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.episode-card:hover .episode-play-btn {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-deep);
}

/* ─────────────────────────────────────────────
   Player loading message
───────────────────────────────────────────── */
.player-msg {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-med);
    font-size: 1rem;
    font-weight: 600;
    background: rgba(0,0,0,0.6);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    z-index: 10001;
    text-align: center;
}

/* ─────────────────────────────────────────────
   Player Quality Menu
───────────────────────────────────────────── */
.quality-menu {
    position: absolute;
    bottom: calc(100% + 16px);
    right: 0;
    background: rgba(10, 13, 24, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 0.6rem;
    min-width: 160px;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 10010;
    box-shadow: 0 16px 48px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
}

/* Title row inside menu */
.quality-menu::before {
    content: 'Quality';
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0.3rem;
}

.quality-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-body);
    text-align: left;
    letter-spacing: 0.01em;
}

.quality-option:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.quality-option.active {
    color: var(--accent-cyan);
    background: rgba(0, 210, 245, 0.1);
}

.quality-option.active svg {
    flex-shrink: 0;
}

/* Quality button itself */
#quality-btn {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 8px !important;
    width: auto !important;
    padding: 0 0.75rem !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.03em;
    color: #fff !important;
    height: 36px;
    transition: all 0.2s ease !important;
}

#quality-btn:hover {
    background: rgba(0, 210, 245, 0.2) !important;
    border-color: var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
}

/* ─────────────────────────────────────────────
   Search Filter Bar
───────────────────────────────────────────── */
.search-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 0 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.search-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 140px;
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-med);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.filter-select {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-high);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892B0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.filter-select:focus, .filter-select:hover {
    border-color: var(--accent-cyan);
}

.filter-select option {
    background: var(--bg-elevated);
    color: var(--text-high);
}

.filter-clear-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: var(--text-med);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    align-self: flex-end;
    white-space: nowrap;
}

.filter-clear-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.search-results-header {
    margin-bottom: 1rem;
}

.search-results-count {
    font-size: 0.82rem;
    color: var(--text-med);
    font-weight: 600;
}

@media (max-width: 640px) {
    .search-filter-bar { gap: 0.75rem; }
    .search-filter-group { min-width: 120px; flex: 1; }
}

/* ─────────────────────────────────────────────
   Search Results Grid
───────────────────────────────────────────── */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    padding-bottom: 2rem;
}

.search-results-grid .movie-card {
    width: 100%;
    min-width: unset;
}

.search-results-grid .movie-poster {
    height: 240px;
}

@media (max-width: 640px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }
    .search-results-grid .movie-poster { height: 195px; }
}

/* ─────────────────────────────────────────────
   Player Download Button
───────────────────────────────────────────── */
#player-download-btn {
    color: #fff;
    transition: all 0.2s ease !important;
}

#player-download-btn:hover {
    background: var(--accent-cyan) !important;
    color: var(--bg-deep) !important;
}

/* Download button on detail page */
.btn-download {
    padding: 1rem 1.5rem;
    background: rgba(0, 210, 245, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 210, 245, 0.4);
    border-radius: 12px;
    color: var(--accent-cyan);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-download:hover {
    background: var(--accent-cyan);
    color: var(--bg-deep);
    box-shadow: 0 6px 25px rgba(0, 210, 245, 0.35);
}

/* ─────────────────────────────────────────────
   Pre-Play Modal (Inline Player + Resources)
───────────────────────────────────────────── */
.preplay-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 1rem;
}
.preplay-modal-overlay.active { opacity: 1; }

.preplay-modal {
    display: flex;
    width: 100%;
    max-width: 980px;
    max-height: 92vh;
    background: #111318;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    position: relative;
    transform: translateY(16px);
    transition: transform 0.25s ease;
}
.preplay-modal-overlay.active .preplay-modal { transform: translateY(0); }

.preplay-close {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    z-index: 10;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.preplay-close:hover { background: var(--accent-red); }

/* Left: video + info */
.preplay-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preplay-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    flex-shrink: 0;
}

.preplay-video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    background: #000;
    z-index: 2;
}

.preplay-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.preplay-video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 1;
}

.preplay-info {
    padding: 1.1rem 1.4rem;
    flex: 1;
    overflow-y: auto;
}

.preplay-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-high);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.preplay-meta {
    display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.5rem;
}

.preplay-rating {
    font-size: 0.78rem; font-weight: 700; color: var(--accent-gold);
    background: rgba(255,179,0,0.12); border: 1px solid rgba(255,179,0,0.3);
    padding: 0.2rem 0.55rem; border-radius: 20px;
}

.preplay-year { font-size: 0.78rem; color: var(--text-med); }

.preplay-desc {
    font-size: 0.82rem; color: var(--text-med); line-height: 1.5; margin: 0;
}

/* Right: resources panel */
.preplay-right {
    width: 210px;
    flex-shrink: 0;
    background: #1a1d24;
    border-left: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    gap: 0.6rem;
    overflow-y: auto;
}

.preplay-panel-title {
    font-size: 0.72rem; font-weight: 700; color: var(--text-med);
    text-transform: uppercase; letter-spacing: 0.07em;
    display: flex; align-items: center; gap: 0.4rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0.1rem;
}

.preplay-panel-divider {
    font-size: 0.68rem; font-weight: 700; color: var(--text-med);
    text-transform: uppercase; letter-spacing: 0.07em;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 0.2rem;
}

/* Quality selector row */
.preplay-quality-row {
    display: flex; flex-direction: column; gap: 0.4rem;
}
.preplay-quality-label {
    font-size: 0.68rem; color: var(--text-med); font-weight: 600; text-transform: uppercase;
}
.preplay-quality-btns {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.preplay-qual-btn {
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--text-med);
    font-size: 0.75rem; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-body);
}
.preplay-qual-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.preplay-qual-btn.active { background: var(--accent-cyan); border-color: var(--accent-cyan); color: var(--bg-deep); }

/* Fullscreen button */
.preplay-watch-btn {
    width: 100%; padding: 0.7rem 0.9rem;
    background: var(--accent-cyan); border: none; border-radius: 10px;
    color: var(--bg-deep); font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 0.45rem; transition: all 0.2s ease;
}
.preplay-watch-btn:hover { background: #00eeff; box-shadow: 0 4px 20px rgba(0,210,245,0.35); }

/* Action buttons */
.preplay-action-btn {
    width: 100%; padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: var(--text-high);
    font-family: var(--font-body); font-size: 0.83rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 0.55rem;
    transition: all 0.2s ease;
}
.preplay-action-btn:hover { background: rgba(255,255,255,0.1); }
.preplay-share-btn:hover { border-color: rgba(255,255,255,0.3); }

/* Download buttons per quality */
.preplay-download-list {
    display: flex; flex-direction: column; gap: 0.35rem;
}
.preplay-dl-btn {
    width: 100%; padding: 0.55rem 0.9rem;
    background: rgba(0,210,245,0.06);
    border: 1px solid rgba(0,210,245,0.25);
    border-radius: 8px; color: var(--accent-cyan);
    font-family: var(--font-body); font-size: 0.8rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
    transition: all 0.15s ease;
}
.preplay-dl-btn:hover { background: rgba(0,210,245,0.15); border-color: var(--accent-cyan); }
.preplay-dl-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
    .preplay-modal { flex-direction: column; overflow-y: auto; }
    .preplay-right { width: 100%; border-left: none; border-top: 1px solid rgba(255,255,255,0.07); }
}