:root {
    --bg-color: #050505;
    --accent-color: #E50914;
    --accent-glow: rgba(229, 9, 20, 0.4);
    --text-color: #ffffff;
    --card-width: 200px;
    --card-height: 280px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(15, 15, 15, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* --- PREMIUM LOADER (Fixes image_c52ebf.png) --- */
#main-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #050505; z-index: 9999; display: flex;
    flex-direction: column; justify-content: center; align-items: center; 
    transition: opacity 0.6s ease;
}

.spinner {
    width: 60px; height: 60px; border: 4px solid rgba(255,255,255,0.05);
    border-top: 4px solid var(--accent-color); border-radius: 50%;
    animation: spin 1s linear infinite; box-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 20px;
}

#main-loader p { 
    color: #888; font-size: 0.75rem; letter-spacing: 3px; 
    font-weight: 800; text-transform: uppercase; 
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- PREVENT FLICKER & FADE-IN --- */
#hero-title, #hero-desc, .hero-buttons, #title-text, #desc-text, .server-list {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-ready {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* --- SKELETON SHIMMER --- */
.skeleton {
    background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.8s infinite;
    border-radius: 8px;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- NAVBAR --- */
.navbar {
    position: fixed; top: 0; width: 100%; height: 75px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4%; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    z-index: 1000; transition: var(--transition-smooth);
}

.navbar.scrolled { 
    background: rgba(5, 5, 5, 0.95); 
    border-bottom: 1px solid var(--glass-border); 
    backdrop-filter: blur(25px); height: 65px;
}

.logo { 
    font-size: 1.8rem; font-weight: 900; color: var(--accent-color); 
    letter-spacing: -1.5px; cursor: pointer; 
    text-shadow: 0 0 15px var(--accent-glow);
}

.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: #e5e5e5; font-size: 0.9rem; transition: 0.3s; font-weight: 600; }
.nav-links a:hover { color: var(--accent-color); }

.icon-btn {
    background: transparent; border: none; color: white;
    font-size: 1.2rem; cursor: pointer; transition: 0.3s;
}
.icon-btn:hover { color: var(--accent-color); transform: scale(1.1); }

/* --- GLOBAL SEARCH OVERLAY (YTS STYLE - Fixes image_c4af01.jpg) --- */
#global-search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.94); z-index: 5000;
    display: flex; flex-direction: column; align-items: center; padding-top: 15vh;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); visibility: hidden; opacity: 0; 
    backdrop-filter: blur(15px);
}

#global-search-overlay.active { visibility: visible; opacity: 1; }

.search-wrapper { width: 90%; max-width: 600px; transform: scale(0.95); transition: 0.4s; }
#global-search-overlay.active .search-wrapper { transform: scale(1); }

.search-input-group {
    display: flex; align-items: center; background: #0c0c0c;
    border: 1px solid #222; border-radius: 14px; padding: 10px 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.search-input-group input {
    flex: 1; background: transparent; border: none; color: #fff;
    padding: 15px; font-size: 1.25rem; outline: none; font-weight: 500;
}

.search-input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.15);
}

.results-container {
    background: var(--glass-bg); border-radius: 14px; margin-top: 15px;
    border: 1px solid #222; overflow: hidden; display: none;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}

.search-result-item {
    display: flex; align-items: center; padding: 15px 25px; gap: 20px;
    cursor: pointer; border-bottom: 1px solid #1a1a1a; transition: 0.2s;
}

.search-result-item:hover { background: rgba(229, 9, 20, 0.08); }
.search-result-item img { width: 50px; height: 75px; border-radius: 5px; object-fit: cover; }
.res-info h4 { font-size: 1rem; color: #fff; margin: 0; }
.res-info p { font-size: 0.8rem; color: #888; margin-top: 4px; }

.view-all { 
    display: block; padding: 18px 25px; color: var(--accent-color); 
    text-decoration: none; font-size: 0.85rem; font-weight: 800; 
    background: #080808; text-transform: uppercase; letter-spacing: 1px;
}

/* --- HERO SECTION --- */
.hero {
    position: relative; height: 85vh; width: 100%;
    background-size: cover; background-position: center;
    display: flex; align-items: center; padding: 0 4%;
    transition: background-image 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(75deg, rgba(0,0,0,0.98) 10%, transparent 80%),
                linear-gradient(to top, var(--bg-color) 0%, transparent 45%);
}

.hero-content { position: relative; max-width: 800px; z-index: 10; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; margin-bottom: 15px; letter-spacing: -2px; line-height: 1.1; }
.hero-description { font-size: 1.1rem; line-height: 1.6; margin-bottom: 35px; color: #aaa; max-width: 550px; }

/* --- BUTTONS --- */
.btn { 
    padding: 14px 34px; font-size: 0.95rem; font-weight: 800; border: none; 
    border-radius: 8px; cursor: pointer; margin-right: 15px; transition: 0.3s; 
    display: inline-flex; align-items: center; gap: 10px; 
}
.play-btn { background: #fff; color: #000; }
.play-btn:hover { background: var(--accent-color); color: #fff; transform: translateY(-3px); box-shadow: 0 10px 20px var(--accent-glow); }
.info-btn { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(10px); }
.info-btn:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); }

/* --- CONTENT ROWS --- */
.content-rows { padding: 0 4% 80px 4%; margin-top: -120px; position: relative; z-index: 20; }
.row { margin-bottom: 50px; }
.row-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 22px; color: #fff; letter-spacing: -0.5px; }

.row-container { position: relative; display: flex; align-items: center; }

.row-posters {
    display: flex; overflow-x: auto; padding: 10px 0 35px 0; gap: 18px;
    scroll-behavior: smooth; scrollbar-width: none;
}
.row-posters::-webkit-scrollbar { display: none; }

.scroll-arrow {
    position: absolute; height: calc(100% - 45px); width: 45px;
    background: rgba(0, 0, 0, 0.7); color: white; border: none;
    cursor: pointer; z-index: 100; font-size: 1.4rem;
    opacity: 0; transition: 0.3s; backdrop-filter: blur(10px);
}
.row-container:hover .scroll-arrow { opacity: 1; }
.scroll-arrow:hover { background: var(--accent-color); transform: scale(1.05); }
.left-arrow { left: -15px; border-radius: 0 10px 10px 0; }
.right-arrow { right: -15px; border-radius: 10px 0 0 10px; }

/* --- MOVIE CARDS --- */
.movie-card {
    min-width: var(--card-width); height: var(--card-height);
    transition: var(--transition-smooth);
    cursor: pointer; border-radius: 12px; overflow: hidden; flex-shrink: 0;
    position: relative; border: 1px solid var(--glass-border);
}
.movie-card img { width: 100%; height: 100%; object-fit: cover; }

.movie-card:hover { 
    transform: scale(1.06) translateY(-10px); 
    z-index: 50; border-color: var(--accent-color); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.9); 
}

.card-info {
    position: absolute; bottom: 0; width: 100%; padding: 40px 15px 15px;
    background: linear-gradient(to top, #050505 25%, transparent);
    opacity: 0; transition: 0.3s ease;
}
.movie-card:hover .card-info { opacity: 1; }
.card-info h3 { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.card-meta { font-size: 0.7rem; font-weight: 900; color: var(--accent-color); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    :root { --card-width: 140px; --card-height: 200px; }
    .nav-links { display: none; }
    .hero { height: 75vh; }
    .hero-content { text-align: center; }
    .hero-buttons { justify-content: center; }
    .search-wrapper { width: 95%; padding-top: 5vh; }
}