:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-hover: #222230;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent: #6c5ce7;
    --accent-hover: #7b6cf6;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --gold: #ffd700;
    --green: #46d369;
    --red: #e74c3c;
    --border: #2a2a3a;
    --shadow: 0 4px 20px rgba(108, 92, 231, 0.2);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
    gap: 30px;
}

.loading-logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: logoPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 25px rgba(108, 92, 231, 0.6));
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 25px rgba(108, 92, 231, 0.6));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 40px rgba(108, 92, 231, 0.9));
    }
}

.loading-bar {
    width: 220px;
    height: 4px;
    background: rgba(108, 92, 231, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loading-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, #6c5ce7, #a29bfe, #6c5ce7, transparent);
    border-radius: 4px;
    animation: loadingBar 1.5s ease-in-out infinite;
}

@keyframes loadingBar {
    0% { left: -40%; }
    100% { left: 100%; }
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(108, 92, 231, 0.2);
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(10,10,18,0.9), transparent);
    transition: var(--transition);
    padding: 15px 0;
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    background: rgba(10,10,18,0.98);
    box-shadow: 0 2px 20px rgba(0,0,0,0.8);
    padding: 10px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-brand img {
    height: 40px;
    width: auto;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

.nav-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.nav-icon:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
}

/* ===== MOBILE SIDEBAR ===== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: var(--bg-secondary);
    z-index: 1100;
    transition: left 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.mobile-brand-icon {
    height: 35px;
    width: auto;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-sidebar a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    margin-bottom: 5px;
}

.mobile-sidebar a:hover,
.mobile-sidebar a.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left: 3px solid var(--accent);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1050;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10,10,18,0.98);
    z-index: 1200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.close-search {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow);
}

.search-dropdown.active {
    display: block;
}

.search-section-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.clear-recent {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.recent-item:hover {
    background: var(--bg-hover);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-item:hover {
    background: var(--bg-hover);
}

.suggestion-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.suggestion-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.suggestion-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== HERO ROTATOR ===== */
.hero-rotator {
    position: relative;
    height: 85vh;
    min-height: 500px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-backdrop::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin-left: 50px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 20px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

.hero-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.match {
    color: var(--green);
    font-weight: 600;
}

.hero-overview {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-play {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-play:hover {
    background: #ccc;
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.hero-dot.active {
    background: var(--accent);
    width: 25px;
    border-radius: 5px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.section-link:hover {
    color: var(--accent);
}

/* ===== CONTENT ROW ===== */
.content-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
}

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

.content-row::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.content-row::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.content-row::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ===== CONTENT CARD ===== */
.content-card {
    min-width: 200px;
    max-width: 200px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.content-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.content-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-info {
    padding: 10px;
    opacity: 0;
    transition: var(--transition);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(10,10,18,0.95), transparent);
    border-radius: 0 0 var(--radius) var(--radius);
}

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

.card-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--text-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--accent);
    color: var(--text-primary);
}

.watchlist-btn {
    background: rgba(255,255,255,0.2);
    color: var(--text-primary);
}

.watchlist-btn.active {
    color: var(--accent);
}

.card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.card-meta {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-rating {
    color: var(--gold);
}

/* ===== SEARCH RESULTS GRID ===== */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.search-results-grid .content-card {
    min-width: auto;
    max-width: none;
}

/* ===== WATCH PAGE ===== */
.watch-container {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.watch-info {
    margin-top: 25px;
}

.watch-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.watch-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.watch-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ===== SERVER SELECTOR ===== */
.server-selector {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.server-selector svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.server-selector:hover,
.server-selector.active {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-hover);
    box-shadow: 0 0 10px var(--accent-glow);
}

.server-selector.active svg {
    color: var(--accent);
}

.servers-section {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.servers-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-right: 12px;
}

.ad-warning {
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.ad-warning svg {
    flex-shrink: 0;
    color: var(--accent);
    width: 18px;
    height: 18px;
}

/* ===== SEASONS & EPISODES ===== */
.seasons-section {
    margin-top: 40px;
}

.seasons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.seasons-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.season-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.season-selector-wrapper label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.season-select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.season-select:hover,
.season-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.season-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.episode-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border: 2px solid transparent;
}

.episode-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.episode-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.episode-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-secondary);
    overflow: hidden;
}

.episode-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 2rem;
}

.episode-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(108, 92, 231, 0.95);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.episode-info {
    padding: 15px;
}

.episode-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.episode-overview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-disclaimer {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-color: var(--green);
    color: var(--green);
}

.notification.error {
    border-color: var(--red);
    color: var(--red);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-content {
        margin-left: 20px;
    }
    
    .hero-overview {
        font-size: 0.9rem;
    }
    
    .content-card {
        min-width: 150px;
        max-width: 150px;
    }
    
    .content-card img {
        height: 210px;
    }
    
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .watch-title {
        font-size: 1.5rem;
    }

    .seasons-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .episodes-grid {
        grid-template-columns: 1fr;
    }

    .watch-meta {
        font-size: 0.85rem;
        gap: 12px;
    }

    .servers-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification {
        bottom: 15px;
        right: 15px;
        left: 15px;
        font-size: 0.85rem;
    }
}