:root {
    --primary: #e50914;
    --bg-dark: #080808;
    --card-bg: #121212;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --glass: rgba(20, 20, 20, 0.8);
    --header-height: 70px;
    --accent-gold: #FFD700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.desktop-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    transition: 0.3s;
    outline: none;
}

.search-bar:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.mobile-search {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    padding: 15px 20px;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 999;
}

.mobile-search.active {
    display: block;
}

.mobile-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 20px;
    color: white;
    outline: none;
    font-size: 16px;
}

.mobile-search input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

/* --- Hero Section --- */
.hero {
    height: 60vh;
    min-height: 400px;
    background: linear-gradient(to bottom, rgba(8, 8, 8, 0.3) 0%, rgba(8, 8, 8, 1) 100%);
    display: flex;
    align-items: flex-end;
    padding: 40px;
    margin-top: var(--header-height);
}

.hero-content {
    max-width: 100%;
}

.hero-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.1;
    display:none;
}

.hero-description {
    color: var(--text-dim);
    max-width: 600px;
    margin-bottom: 20px;
    font-size: 16px;
}

/* --- Content Type Toggle --- */
.content-type-toggle {
    display: flex;
    gap: 10px;
    background: #1a1a1a;
    padding: 4px;
    border-radius: 25px;
    border: 1px solid #333;
}

.toggle-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.toggle-btn:hover:not(.active) {
    background: #2a2a2a;
    color: white;
}

/* --- Main Content --- */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px;
}

.container.search-results {
    margin-top: 100px;
}

.container.with-hero {
    margin-top: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
}

/* --- Genre Filter Chips --- */
.filters {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.genre-chip {
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.genre-chip:hover {
    background: #2a2a2a;
    border-color: var(--primary);
}

.genre-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.genre-dropdown {
    position: relative;
    display: inline-block;
}

.genre-dropdown-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.genre-dropdown-btn:hover {
    background: #2a2a2a;
}

.genre-dropdown-content {
    display: none;
    position: absolute;
    background: #1a1a1a;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
    z-index: 100;
    border-radius: 8px;
    border: 1px solid #333;
    margin-top: 5px;
}

.genre-dropdown-content.show {
    display: block;
}

.genre-dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: 0.2s;
}

.genre-dropdown-content a:hover {
    background: #2a2a2a;
}

.genre-dropdown-content a.active {
    background: var(--primary);
}

/* Sort Dropdown */
.sort-dropdown {
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.sort-dropdown:hover {
    background: #2a2a2a;
}

/* --- Movie/Series Cards Grid --- */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    width: 100%;
}

.movie-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(229, 9, 20, 0.5);
}

.movie-poster-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    height: auto;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 10%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    opacity: 0.9;
}

.overlay-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Content Type Badge */
.content-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(155, 89, 182, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.content-type-badge.movie {
    background: rgba(52, 152, 219, 0.9);
}

.content-type-badge.series {
    background: rgba(155, 89, 182, 0.9);
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: 42px;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.rating-badge {
    background: rgba(229, 9, 20, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
}

.genre-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-dim);
}

.season-badge {
    display: inline-block;
    background: rgba(155, 89, 182, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

/* --- Modern Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 12px 20px;
    background: #1a1a1a;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: 0.3s;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: #2a2a2a;
}

.pagination .active {
    background: var(--primary);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

/* --- Footer --- */
.footer {
    background: #050505;
    padding: 80px 40px 40px;
    border-top: 1px solid #1a1a1a;
    margin-top: 60px;
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-links {
    margin-top: 30px;
    display: flex;
    gap: 30px;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-dim);
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-main);
}

/* Tablet Adjustments (768px - 1024px) */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 30px;
    }

    .container {
        padding: 30px;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    .section-title {
        font-size: 28px;
    }
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }


    /* Header */
    .nav-container {
        padding: 0 15px;
    }

    .logo {
        font-size: 18px;
    }

    .desktop-search,
    .nav-links a {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    /* Hero */
    .hero {
        height: 45vh;
        min-height: 280px;
        margin-top: var(--header-height);
        padding: 20px 15px;
    }

    .hero-title {
        font-size: 26px !important;
    }

    .hero-description {
        font-size: 14px;
        margin-bottom: 10px;
    }

    /* Container */
    .container {
        padding: 20px 15px;
    }

    .container.search-results {
        margin-top: calc(var(--header-height) + 15px);
    }

    .container.with-hero {
        margin-top: 15px;
    }

    /* Section Header */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 20px;
        width: 100%;
    }

    /* Filters - Horizontal swipable */
    .filters {
        width: 100%;
        gap: 8px;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
        padding-right: 15px;
        scroll-behavior: smooth;
        position: relative;
        cursor: grab;
        --show-right-gradient: 1;
        --show-left-gradient: 0;
    }
    
    .filters:active {
        cursor: grabbing;
    }
    
    .filters::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: calc(100% - 8px);
        background: linear-gradient(to left, rgba(8, 8, 8, 1) 0%, rgba(8, 8, 8, 0.8) 50%, transparent 100%);
        pointer-events: none;
        z-index: 1;
        opacity: var(--show-right-gradient);
        transition: opacity 0.3s ease;
    }
    
    .filters::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 60px;
        height: calc(100% - 8px);
        background: linear-gradient(to right, rgba(8, 8, 8, 1) 0%, rgba(8, 8, 8, 0.8) 50%, transparent 100%);
        pointer-events: none;
        z-index: 1;
        opacity: var(--show-left-gradient);
        transition: opacity 0.3s ease;
    }

    .filters::-webkit-scrollbar {
        display: none;
    }
    
    .filters > * {
        flex-shrink: 0 !important;
        position: relative;
        z-index: 2;
    }

    .content-type-toggle {
        flex-shrink: 0 !important;
        margin-bottom: 0;
        order: 1;
    }

    .toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
        user-select: none;
    }

    .genre-dropdown {
        flex-shrink: 0 !important;
        display: inline-block !important;
        order: 2;
    }

    .genre-dropdown-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex-shrink: 0 !important;
        white-space: nowrap;
        min-width: fit-content;
        user-select: none;
    }
    
    .sort-dropdown {
        padding: 8px 12px;
        font-size: 12px;
        flex-shrink: 0 !important;
        white-space: nowrap;
        min-width: 120px;
        order: 3;
        user-select: none;
    }

    .genre-dropdown-content {
        position: fixed;
        left: 10px;
        right: 10px;
        width: auto;
        min-width: auto;
        max-width: calc(100vw - 20px);
    }

    /* ===== MOVIE GRID - 2 COLUMNS ===== */
    .movie-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        width: 100% !important;
    }

        width: 100%;
        min-width: 0;
    }

    .movie-card {
        border-radius: 8px;
        width: 100% !important;
    }

    .movie-card:hover {
        transform: scale(1.02);
    }

    .movie-poster-container {
        width: 100%;
    }

    .movie-card img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 2/3;
    }

    .card-overlay {
        padding: 8px;
    }

    .rating-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    .content-type-badge {
        top: 6px;
        left: 6px;
        font-size: 9px;
        padding: 3px 6px;
    }

    .movie-info {
        padding: 8px;
    }

    .movie-title {
        font-size: 15px;
        line-height: 1.2;
        min-height: 36px;
        margin-bottom: 4px;
    }

    .movie-meta {
        font-size: 12px !important;
    }

    .genre-badge,
    .season-badge {
        font-size: 11px;
        padding: 2px 5px;
    }

    /* Pagination */
    .pagination {
        gap: 5px;
        margin-top: 30px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 35px;
    }

    /* Footer */
    .footer {
        padding: 40px 20px 30px;
    }

    .footer-links {
        gap: 15px;
        font-size: 13px;
        justify-content: center;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {

    .container {
        padding: 15px 12px;
    }

    .section-title {
        font-size: 18px;
    }

    .movie-grid {
        gap: 10px !important;
    }

    .movie-title {
        font-size: 14px;
        min-height: 34px;
    }

    .movie-meta {
        font-size: 11px !important;
    }

    .toggle-btn {
        font-size: 11px;
        padding: 7px 10px;
    }
}

/* Extra Small (max-width: 375px) - iPhone SE */

    .nav-container {
        padding: 0 10px;
    }

    .container {
        padding: 12px 10px;
    }

    .logo {
        font-size: 16px;
    }

    .section-title {
        font-size: 16px;
    }

    .movie-grid {
        gap: 8px !important;
    }

    .movie-title {
        font-size: 13px;
        min-height: 32px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
