:root {
    --bg-color: #0f0f0f;
    --sidebar-bg: #161616;
    --card-bg: #1f1f1f;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #e50914;
    --nav-width: 240px;
    --input-bg: #2a2a2a;
    --border-color: #333;
}

/* Light Mode Variables */
body.light-mode {
    --bg-color: #f5f5f5;
    --sidebar-bg: #ffffff;
    --card-bg: #e0e0e0;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --input-bg: #e5e5e5;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: 0.3s;
    user-select: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sidebar */
.sidebar {
    width: var(--nav-width);
    background-color: var(--sidebar-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    padding-left: 10px;
    margin-top: 15px;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--input-bg);
    color: var(--text-main);
}

.nav-item.active {
    border-left: 3px solid var(--accent);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px;
    position: relative;
}

/* Search */
.search-container {
    margin-bottom: 20px;
    position: relative;
    max-width: 500px;
}

.search-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 12px 20px 12px 45px;
    border-radius: 50px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.search-input:focus {
    border-color: var(--accent);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Slider */
.slider-container {
    width: 100%;
    height: 450px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: flex-end;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, var(--bg-color) 0%, rgba(15, 15, 15, 0.6) 30%, rgba(0, 0, 0, 0) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 50px;
    max-width: 700px;
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 15px;
    color: #ddd;
    margin-bottom: 25px;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: #b20710;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-main);
    margin-left: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- LEGAL PAGE STYLES --- */
.legal-header {
    margin-bottom: 40px;
    background: var(--sidebar-bg); /* Matches dark theme */
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}
.legal-header h1 { font-size: 36px; margin-bottom: 15px; font-weight: 700; color: #fff; }
.legal-header p { color: var(--text-muted); line-height: 1.6; max-width: 800px; font-size: 15px; }

.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.legal-card {
    background: var(--sidebar-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, border-color 0.2s;
}
.legal-card:hover { border-color: #555; }

.legal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.legal-title i { font-size: 22px; color: #fff; } /* Icon color */

.legal-text {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* --- CONTACT BOX STYLES --- */
.contact-box {
    background: var(--sidebar-bg); /* Dark background */
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-top: 30px;
    margin-bottom: 50px;
}

.contact-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.contact-subtext {
    font-size: 14px;
    color: #888; /* Slightly darker/muted than main text */
    line-height: 1.6;
    margin-bottom: 15px;
}

.contact-subtext strong { color: #ccc; }

.legal-footer {
    margin-top: 50px;
    text-align: center;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

/* Mobile Fix */
@media (max-width: 768px) {
    .legal-grid { grid-template-columns: 1fr; }
    .legal-header h1 { font-size: 28px; }
}

/* Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.media-card {
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.media-card:hover {
    transform: translateY(-5px);
}

.poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--input-bg);
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.2s;
}

.media-card:hover .hover-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 40px;
    color: #fff;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffb400;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.media-title {
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-year {
    font-size: 12px;
    color: var(--text-muted);
}

/* Views & Player */
.page-view {
    display: none;
    animation: fadeIn 0.4s;
}

.page-view.active {
    display: block;
}

.player-container {
    max-width: 1200px;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.server-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.server-btn {
    background: var(--input-bg);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.server-btn:hover {
    background: var(--border-color);
}

.server-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Settings */
.settings-card {
    background: var(--sidebar-bg);
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    border: 1px solid var(--border-color);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-title {
    font-weight: 600;
    font-size: 15px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.setting-select {
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    outline: none;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE / MOBILE STYLES --- */

/* Default: Hide Mobile Elements on Desktop */
.bottom-nav, .mobile-menu { display: none; }

/* TABLET & MOBILE (Max Width 768px) */
@media (max-width: 768px) {
    
    /* 1. Hide Desktop Sidebar */
    .sidebar { display: none; }

    /* 2. Adjust Main Content */
    .main-content {
        padding: 15px 15px 100px 15px; /* Extra bottom padding for nav bar */
        margin-left: 0;
        width: 100%;
    }

    /* 3. Mobile Navigation Bar (Fixed Bottom) */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        padding-bottom: 10px; /* Safe area for modern phones */
    }

    .b-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        color: var(--text-muted);
        font-size: 11px;
        cursor: pointer;
        width: 60px;
    }

    .b-nav-item i { font-size: 20px; margin-bottom: 2px; }
    .b-nav-item.active { color: var(--accent); }

    /* 4. Adjust Hero Slider */
    .slider-container { height: 55vh; margin-bottom: 25px; }
    .hero-content { padding: 20px; padding-bottom: 40px; }
    .hero-title { font-size: 32px; }
    .hero-desc { font-size: 13px; line-clamp: 2; margin-bottom: 15px; }

    /* 5. Adjust Grids (2 Columns for Mobile) */
    .media-grid {
        grid-template-columns: repeat(2, 1fr); /* Force 2 columns */
        gap: 15px;
    }
    
    /* 6. Legal & Settings Adjustment */
    .legal-grid { grid-template-columns: 1fr; }
    .contact-box { padding: 20px; }

    /* 7. Mobile Menu Overlay ("More" Page) */
    .mobile-menu {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: var(--bg-color);
        z-index: 2000;
        padding: 20px;
        flex-direction: column;
        overflow-y: auto;
        animation: slideUp 0.3s ease;
    }
    .mobile-menu.active { display: flex; }

    .mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        margin-bottom: 40px; border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }

    .mobile-grid-menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .m-menu-item {
        background: var(--input-bg);
        padding: 20px;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        font-weight: 600;
        font-size: 14px;
        border: 1px solid var(--border-color);
    }
    .m-menu-item i { font-size: 24px; }
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }