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

body {
    background: #050508;
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Sidebar - now clickable and above content */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: rgba(5, 5, 8, 0.98);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;  /* Higher than main content */
    padding: 28px 20px;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    overflow-y: auto;
}

/* Sidebar links and buttons must have pointer-events auto */
.sidebar a, .sidebar button, .sidebar .studio-btn, .sidebar .genre-trigger {
    pointer-events: auto;
    cursor: pointer;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.logo h1 {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #fff, #e50914, #ff6a00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.logo span {
    background: none;
    color: #e50914;
    text-shadow: 0 0 8px rgba(229,9,20,0.5);
}

.logo-glow {
    position: absolute;
    bottom: -10px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e50914, transparent);
}

.sidebar h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin: 24px 0 12px 8px;
}

.main-nav a, .user-lists a, .top-lists a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #ccc;
    text-decoration: none;
    border-radius: 14px;
    transition: all 0.2s;
    margin: 6px 0;
    font-weight: 500;
}

.main-nav a i, .user-lists a i, .top-lists a i {
    width: 24px;
    font-size: 1.2rem;
}

.main-nav a:hover, .user-lists a:hover, .top-lists a:hover,
.main-nav a.active, .user-lists a.active {
    background: rgba(229, 9, 20, 0.15);
    color: #e50914;
    box-shadow: 0 0 8px rgba(229,9,20,0.3);
}

.studio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 8px;
}

.studio-btn {
    background: #111118;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 8px 14px;
    border-radius: 30px;
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.studio-btn:hover {
    background: #e50914;
    color: white;
    border-color: #e50914;
}

.genre-trigger {
    background: #111118;
    border: 1px solid #e50914;
    padding: 10px;
    border-radius: 40px;
    width: 100%;
    color: #e50914;
    cursor: pointer;
    font-weight: 600;
    margin-top: 5px;
}

/* Main content */
.main-content {
    margin-left: 280px;
    padding: 25px 35px;
    position: relative;
    z-index: 1;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    background: rgba(5,5,8,0.6);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 60px;
    border: 1px solid rgba(255,255,255,0.05);
}

.menu-icon {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

.search-box {
    flex: 1;
    max-width: 350px;
    background: #111118;
    border-radius: 60px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
}

.filter-tabs, .sort-buttons {
    display: flex;
    gap: 8px;
}

.filter-tab, .sort-btn {
    background: #111118;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    color: #aaa;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}

.filter-tab.active, .sort-btn.active {
    background: #e50914;
    color: white;
    box-shadow: 0 0 12px rgba(229,9,20,0.5);
}

/* Slider */
.slider-section {
    margin-bottom: 50px;
}

.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.slider-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 10px 0;
    cursor: grab;
}

.slider-track:active {
    cursor: grabbing;
}

.slider-track::-webkit-scrollbar {
    display: none;
}

.slider-card {
    min-width: 220px;
    background: #0f0f15;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
}

.slider-card:hover {
    transform: translateY(-8px);
    border-color: #e50914;
    box-shadow: 0 15px 25px -10px rgba(229,9,20,0.3);
}

.slider-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.slider-info {
    padding: 12px;
}

.slider-info h4 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slider-info p {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slider-nav {
    position: absolute;
    background: rgba(0,0,0,0.7);
    border: none;
    color: white;
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.slider-nav.prev { left: -20px; }
.slider-nav.next { right: -20px; }

/* Greats sliders */
.greats-row {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 40px 0;
}

.greats-section h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    border-left: 4px solid #e50914;
    padding-left: 15px;
}

.greats-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.great-card {
    min-width: 140px;
    background: #0f0f15;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
}

.great-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.great-card:hover {
    transform: scale(1.02);
}

/* Main grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.movie-card {
    background: #0f0f15;
    border-radius: 18px;
    overflow: hidden;
    transition: 0.25s;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255,255,255,0.03);
}

.movie-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: #e50914;
}

/* Action icons on card */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border-radius: 30px;
    padding: 5px 8px;
}

.card-actions i {
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    pointer-events: auto;
}

.card-actions .fa-heart:hover, .card-actions .fa-clock:hover {
    transform: scale(1.2);
}

/* Hover popup */
.hover-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 340px;
    background: #0a0a10;
    border-radius: 20px;
    padding: 15px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
    border-left: 4px solid #e50914;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.hover-popup iframe {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    border: none;
}

.hover-popup .popup-title {
    font-weight: bold;
    margin-top: 8px;
    font-size: 1rem;
}

.hover-popup .popup-desc {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 5px;
    line-height: 1.3;
}

/* Loader */
.loader {
    text-align: center;
    padding: 20px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

.load-more {
    background: linear-gradient(90deg, #e50914, #b81a1a);
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    margin: 20px auto;
    display: block;
    cursor: pointer;
    transition: 0.2s;
}

.load-more:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(229,9,20,0.6);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #0a0a10;
    border-radius: 32px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
    border: 1px solid rgba(229,9,20,0.3);
}
.genre-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}
.genre-grid button {
    background: #1a1a24;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}
.genre-grid button:hover {
    background: #e50914;
}
.close-modal {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1100;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    .menu-icon {
        display: block;
    }
    .slider-nav {
        display: none;
    }
    .slider-card {
        min-width: 160px;
    }
    .great-card {
        min-width: 110px;
    }
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .movie-card img {
        height: 220px;
    }
    .hover-popup {
        width: 280px;
        left: 10px;
        bottom: 10px;
    }
    .hover-popup iframe {
        height: 140px;
    }
}
