:root {
    --primary-color: #d9534f; /* Red accent like Netflix/Rophim */
    --primary-hover: #c9302c;
    --bg-color: #101010;
    --bg-secondary: #181818;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --header-bg: rgba(16, 16, 16, 0.95);
    --card-bg: #1f1f1f;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

body.light-mode {
    --bg-color: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --header-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Light Mode Specific Overrides */
body.light-mode .lang-select {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

body.light-mode .lang-select option {
    background-color: #fff;
    color: #333;
}

body.light-mode .search-box input {
    background: #eee;
    color: #333;
}

body.light-mode .dropdown-menu {
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

body.light-mode .dropdown-menu li a:hover {
    background-color: #f0f0f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-3d {
    position: relative;
    width: 100px;
    height: 100px;
    transform-style: preserve-3d;
    perspective: 800px;
    animation: rotate3d 2s infinite linear;
}

.loader-3d span {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: var(--primary-color);
    border-bottom-color: #ffb74d; /* Orange-ish accent */
    box-shadow: 0 0 20px var(--primary-color), 0 0 20px #ffb74d;
    filter: blur(1px);
}

.loader-3d span:nth-child(1) {
    transform: rotateX(35deg) rotateY(-45deg);
    animation: spin3d 1.5s infinite linear;
}
.loader-3d span:nth-child(2) {
    transform: rotateX(50deg) rotateY(10deg);
    animation: spin3d-reverse 1.5s infinite linear;
}
.loader-3d span:nth-child(3) {
    transform: rotateX(-35deg) rotateY(25deg);
    animation: spin3d 2s infinite linear;
}

@keyframes rotate3d {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes spin3d {
    0% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg); }
    100% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg); }
}

@keyframes spin3d-reverse {
    0% { transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg); }
    100% { transform: rotateX(50deg) rotateY(10deg) rotateZ(-360deg); }
}

/* Enhanced Hover Effects */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(217, 83, 79, 0.6);
}

.movie-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    border: 1px solid transparent;
}

.movie-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 15px 35px rgba(217, 83, 79, 0.3); /* Colorful glow */
    border-color: rgba(217, 83, 79, 0.5);
    z-index: 10;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Header */
header {
    background-color: transparent;
    padding: 0; /* Removed padding to let nav items fill height */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100000;
    height: 70px; /* Fixed height for consistency */
    display: flex;
    align-items: center;
    transition: background-color 0.4s ease, height 0.4s ease, box-shadow 0.4s ease;
    overflow: visible !important;
}

/* Add background for non-home pages */
body:not(.home-page) header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

header.scrolled {
    background-color: var(--header-bg);
    height: 60px; /* Shrink on scroll */
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%; /* Fill header height */
}

.logo a {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 25px;
    height: 100%;
    align-items: center;
}

.nav-links li {
    position: relative;
    height: 100%; /* Fill nav/header height */
    display: flex;
    align-items: center;
    padding: 0; /* Remove padding as we use flex height */
}

.nav-links a {
    font-weight: 600;
    font-size: 16px;
    position: relative;
    padding: 5px 0; /* Small padding for text */
    display: inline-block;
    white-space: nowrap; /* Force single line */
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%; /* Starts exactly at bottom of header */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #1a1a1a;
    min-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid #333;
    border-radius: 0 0 8px 8px; /* Rounded bottom only */
    border-top: 3px solid var(--primary-color); /* Highlight top */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 20px;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Bridge not strictly needed if li touches dropdown, but good for safety */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.nav-links li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* Search Box */
.search-box {
    display: flex;
    background: #222;
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid #333;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    padding: 5px;
    width: 200px;
}

.search-box button {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
}

.search-box button:hover {
    color: white;
}

/* Language Button */
.btn-lang {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lang:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
}

.btn-login {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(217, 83, 79, 0.3);
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    color: #aaa;
}

.btn-logout:hover {
    color: white;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.language-selector {
    margin-right: 15px;
    position: relative;
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 10px auto;
}

.lang-select:hover, .lang-select:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.lang-select option {
    background-color: #1f1f1f;
    color: #fff;
    padding: 10px;
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Main Wrapper */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 90px 20px 20px; /* 70px header + 20px space */
    min-height: 80vh;
}

/* Homepage specific: No top padding so header overlays hero */
body.home-page .main-wrapper {
    padding-top: 0 !important; /* Force no padding on homepage */
    max-width: 100%; /* Full width for hero */
    padding-left: 0;
    padding-right: 0;
}

body.home-page .section-header, 
body.home-page .movie-grid {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Hide ads to fix layout gap */
.adsbygoogle {
    display: none !important;
    height: 0 !important;
}

/* Hero Section */
.hero-section {
    display: block;
    width: 100%; 
    height: 85vh !important; /* Increased to ~85% viewport height as requested */
    min-height: 550px;
    border-radius: 0; 
    overflow: hidden;
    position: relative;
    margin-bottom: 50px; 
    box-shadow: var(--shadow);
    z-index: 5; 
    clear: both;
}

.hero-slide-item {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer; 
    background-color: #000; 
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Use cover for large banners to avoid distortion */
    object-position: center top; /* Focus on top-center where faces usually are */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 30px; /* Position at bottom */
    left: 30px; /* Position at left */
    top: auto; /* Reset top */
    transform: none; /* Reset transform */
    width: 100%;
    max-width: 700px; 
    padding: 0; 
    z-index: 5; /* Ensure content is above overlay */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.hero-info-box {
    max-width: 100%; 
}

.hero-title {
    font-size: 32px; /* Adjusted font size */
    font-weight: 800;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    line-height: 1.2;
    color: white;
}

.hero-subtitle {
    font-size: 16px;
    color: #ccc;
    font-weight: 600;
    margin-bottom: 10px;
    font-style: italic;
}

.hero-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-badge {
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
}

.meta-badge.quality {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.hero-desc {
    color: #ddd;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    position: relative;
    z-index: 10; /* As requested, high z-index for buttons */
}

.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(217, 83, 79, 0.5);
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    z-index: 1; /* As requested */
    cursor: pointer;
}

.btn-watch:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255,255,255,0.1);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.3);
    z-index: 1; /* As requested */
    cursor: pointer;
}

.btn-detail:hover {
    background-color: white;
    color: #000;
}

/* Swiper Controls Customization */
.swiper-button-next, .swiper-button-prev {
    color: var(--primary-color);
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 20; /* Ensure strictly above overlay and content */
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 18px;
    font-weight: 800;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.6);
    border-color: var(--primary-color);
}

/* Position strictly centered vertically, but closer to content horizontally */
.swiper-button-prev {
    left: 40px; 
}
.swiper-button-next {
    right: 40px; 
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .swiper-button-next, .swiper-button-prev {
        display: none; /* Hide arrows on mobile, use touch swipe */
    }
    .hero-content {
        left: 20px;
        bottom: 20px;
        right: 20px;
    }
    .hero-title {
        font-size: 24px;
    }
    .btn-watch, .btn-detail {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Swiper Controls Customization */
.swiper-button-next, .swiper-button-prev {
    color: var(--primary-color);
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero-meta {
    color: #ddd;
    margin-bottom: 20px;
    font-size: 16px;
}

.btn-watch {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 0 20px rgba(217, 83, 79, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(217, 83, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0); }
}

/* Section Title */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.section-title {
    font-size: 24px;
    color: var(--primary-color);
    text-transform: uppercase;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.view-all {
    font-size: 14px;
    color: var(--text-muted);
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.movie-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
}

.movie-card:hover { /* Removed duplicate definition to keep the file clean, merged into the one above */
    /* This rule is now handled by the block above */
}

.card-thumb {
    position: relative;
    overflow: hidden;
    padding-top: 150%; /* Aspect ratio 2:3 */
}

.card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .card-thumb img {
    transform: scale(1.1);
    filter: brightness(0.7);
}

.play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 50px;
    color: white;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.movie-card:hover .play-btn-overlay {
    transform: translate(-50%, -50%) scale(1.2); /* Slightly larger */
    opacity: 1;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
    box-shadow: 0 0 10px var(--primary-color);
}

.movie-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    color: white;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* Footer */
footer {
    background-color: #0a0a0a;
    padding: 60px 0 20px;
    margin-top: 60px;
    border-top: 1px solid #222;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    padding: 0 20px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.footer-section p {
    color: #aaa;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-section ul li {
    margin-bottom: 12px;
    list-style: none;
}

.footer-section ul li a {
    color: #aaa;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Contact Info */
.contact-info li {
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 15px;
}

.contact-info li i {
    width: 25px;
    color: var(--primary-color);
    margin-right: 10px;
}

.contact-info li span {
    color: #ccc;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #222;
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(217, 83, 79, 0.4);
    border-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid #1a1a1a;
    color: #666;
    font-size: 14px;
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: #1f1f1f;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 4px;
    color: white;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 70px;
        left: 20px;
        width: calc(100% - 40px);
        height: calc(100vh - 70px);
        background-color: #1a1a1a;
        flex-direction: column;
        padding: 0; /* Handle padding in items */
        box-shadow: 0 10px 20px rgba(0,0,0,0.9);
        gap: 0;
        z-index: 200000;
        border-top: 1px solid #333;
        overflow-y: auto;
        padding-bottom: 100px; /* Fix for lost content on scroll */
    }

    /* Prevent header shrinking on mobile to avoid gaps */
    header.scrolled {
        height: 70px !important;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
        text-align: center; /* Parent Left */
        border-bottom: 1px solid #333;
        padding: 0;
        height: auto;
        display: block;
    }
    
    .nav-links > li > a {
        display: block;
        padding: 15px 20px;
        width: 100%;
        text-align: center; /* Parent Left */
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        background: #222;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none; /* Hidden by default */
        grid-template-columns: 1fr 1fr;
        margin-top: 0;
        padding: 15px 5px;
        border: none;
    }
    
    .dropdown-menu li {
        text-align: center; /* Child Center */
        border: none;
        padding: 0;
    }
    
    .dropdown-menu li a {
        text-align: center; /* Child Center */
        padding: 8px 5px;
        font-size: 14px;
        color: #ccc;
        justify-content: center !important;
        align-items: center !important;
        display: flex;
    }
    
    /* Show dropdown when active class is added via JS */
    .nav-links li.active .dropdown-menu {
        display: block !important;
        justify-content: center !important;
        align-items: center !important;
        padding-left: 60px !important;
    }

    .search-box {
        display: none; 
    }
    
    .mobile-menu-btn {
        display: block !important;
        font-size: 22px; /* Slightly smaller */
        cursor: pointer;
        color: var(--text-color);
        padding: 6px 10px;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 5px;
        transition: all 0.3s ease;
        margin-right: 15px;
        justify-content: center !important;
        align-items: center !important;
    }

    .mobile-menu-btn:hover {
        background-color: rgba(255,255,255,0.1);
        color: var(--primary-color);
    }
    
    /* Center Logo on Mobile */
    .logo {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .logo a {
        font-size: 20px;
    }

    /* Compact Auth Buttons on Mobile */
    .auth-buttons {
        gap: 5px;
    }

    .theme-toggle {
        margin-right: 0;
        font-size: 16px;
        padding: 5px;
    }

    .language-selector {
        margin-right: 0;
    }

    .lang-select {
        padding: 4px 20px 4px 8px;
        font-size: 11px;
        background-position: right 5px top 50%;
        height: auto;
        width: auto;
        min-width: 60px; /* Ensure it's not too small */
    }

    .btn-login {
        padding: 5px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .user-menu {
        gap: 5px;
    }
    
    .user-menu span {
        display: none; /* Hide username text on mobile */
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        gap: 15px;
        z-index: 9999;
        border-top: 1px solid rgba(255,255,255,0.1);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .header-container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .hero-meta {
        font-size: 12px;
    }
    
    .dropdown-menu {
        grid-template-columns: 1fr;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animation Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    gap: 15px; /* Increased gap */
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 20px;
    background: #222;
    color: #e0e0e0;
    border-radius: 50%; /* Circular buttons look more modern */
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 16px;
    border: 1px solid #333;
}

.page-link:hover, .page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(217, 83, 79, 0.3);
}

/* Replaced by block above, cleaning up old definitions */
/* Dropdown Menu */
/* .nav-links li style removed as it's redefined above */
/* .dropdown-menu style removed as it's redefined above */
/* .dropdown-menu::before style removed as it's redefined above */
/* .nav-links li:hover .dropdown-menu style removed as it's redefined above */

.dropdown-menu li {
    width: 100%;
    padding: 0; /* Reset padding from parent li */
}

.dropdown-menu a {
    display: block;
    padding: 8px 15px;
    font-size: 14px;
    color: #bbb;
    white-space: nowrap;
    border-radius: 6px;
    transition: all 0.2s;
    background: #252525;
    text-align: center;
}

.dropdown-menu a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.dropdown-menu a::after {
    display: none;
}


/* Episode List */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.episode-btn {
    display: block;
    text-align: center;
    padding: 8px 5px;
    background: #2a2a2a;
    color: #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.episode-btn:hover {
    background: #333;
    color: white;
    border-color: #555;
}

.episode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
}


/* Mobile Search */
.mobile-search {
    display: none;
    width: 100%;
    padding: 10px;
}

.mobile-search form {
    display: flex;
    width: 100%;
    background: #333;
    border-radius: 20px;
    padding: 5px 15px;
}

.mobile-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
}

.mobile-search button {
    background: transparent;
    border: none;
    color: #aaa;
}

@media (max-width: 768px) {
    .mobile-search {
        display: block;
    }
    
    .desktop-search {
        display: none !important;
    }
}


/* --- Christmas 2025 Snow Effect --- */
.snowflake {
    position: fixed;
    top: -20px;
    color: #fff;
    z-index: 99999;
    pointer-events: none;
    user-select: none;
    will-change: transform;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.snowflake.round {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px #fff;
}

@keyframes snowfall {
    0% {
        transform: translate3d(var(--start-x), -20px, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity);
    }
    100% {
        transform: translate3d(var(--end-x), 105vh, 0) rotate(360deg);
        opacity: 0;
    }
}

/* Optional: Add a festive corner badge */
.noel-badge {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 99998;
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(45deg, #d41414, #ff3b3b);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(212, 20, 20, 0.4);
    font-weight: bold;
    transform: rotate(5deg);
    border: 2px solid #fff;
    animation: badge-pulse 2s infinite;
}

@media (max-width: 768px) {
    .noel-badge {
        top: auto;
        bottom: 20px;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: max-content;
    }
}

@keyframes badge-pulse {
    0% { transform: rotate(5deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.05); }
    100% { transform: rotate(5deg) scale(1); }
}


/* --- Skeleton Loading Animation --- */
.skeleton {
    background: #2a2a2a;
    background: linear-gradient(110deg, #2a2a2a 8%, #3a3a3a 18%, #2a2a2a 33%);
    border-radius: 5px;
    background-size: 200% 100%;
    animation: 1.5s shine bg-shine linear infinite;
    opacity: 0.7;
}

body.light-mode .skeleton {
    background: #e0e0e0;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
}

@keyframes bg-shine {
    to {
        background-position-x: -200%;
    }
}

.movie-card.skeleton-card {
    pointer-events: none;
    border: none;
    box-shadow: none;
    background: transparent;
}
.movie-card.skeleton-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}
.skeleton-card .card-thumb {
    height: 0;
    padding-bottom: 145%; /* Aspect ratio for posters */
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
}
.skeleton-card .movie-title {
    height: 20px;
    width: 80%;
    margin-bottom: 8px;
    border-radius: 4px;
}
.skeleton-card .movie-meta {
    height: 15px;
    width: 60%;
    border-radius: 4px;
}

/* --- Fix Search Bar Visibility --- */
/* Ensure mobile search is hidden on desktop, overriding .nav-links li display:flex */
@media (min-width: 769px) {
    .nav-links li.mobile-search {
        display: none !important;
    }
}

