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

body {
    background: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
}

.header {
    background: transparent;
    padding: 20px 40px;
    position: static;
    z-index: 100;
}

.logo {
    color: #e50914;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.main-nav {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #e50914;
}

.genre-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.genre-nav a {
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    background: #333;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 18px;
    min-width: 120px;
    text-align: center;
}

.genre-nav a:hover,
.genre-nav a.active {
    background: #e50914;
    transform: scale(1.05);
}

.content {
    padding: 40px;
}

.section-title {
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
    margin-right: 20px;
    color: #e50914;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
    margin-bottom: 0;
}

.pagination .btn {
    margin: 0 5px;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.movie-card {
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border 0.3s;
    border: 3px solid transparent;
}

.movie-card:hover {
    transform: scale(1.05);
    border-color: #e50914;
    box-shadow: 0 8px 24px rgba(229, 9, 20, 0.5);
    z-index: 10;
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.movie-info {
    padding: 10px;
}

.movie-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    color: #999;
    font-size: 12px;
}

.btn {
    padding: 12px 30px;
    font-size: 18px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover:not(:disabled) {
    background: #e50914;
    transform: scale(1.05);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 16px;
    color: #999;
    margin: 0 10px;
}

/* Toggle Genres Button */
.toggle-genres-btn {
    margin-left: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background: #333;
    color: #fff;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.toggle-genres-btn:hover {
    background: #444;
    border-color: #e50914;
}

/* Hidden state for genres */
.genre-nav.desktop-only.hidden {
    display: none !important;
}

/* Toolbar: sort + pagination row */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* Sort buttons - desktop */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    color: #999;
    font-size: 14px;
    margin-right: 4px;
    white-space: nowrap;
}

.sort-btn {
    padding: 10px 18px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.sort-btn:hover {
    background: #555;
}

.sort-btn.active {
    background: #e50914;
    font-weight: bold;
}

/* Sort buttons - mobile */
.sort-controls-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sort-controls-mobile .sort-label {
    color: #999;
    font-size: 13px;
    margin-right: 2px;
}

.sort-controls-mobile .sort-btn {
    padding: 7px 13px;
    font-size: 13px;
}

/* MOBILE STYLES */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
        position: relative;
        background: #000;
    }

    .logo {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .main-nav {
        gap: 15px;
        margin-bottom: 15px;
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        font-size: 18px;
        padding: 8px 15px;
        flex-shrink: 0;
    }

    .genre-nav {
        display: flex !important;
        gap: 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .genre-nav::-webkit-scrollbar {
        display: none;
    }

    .genre-nav a {
        font-size: 14px;
        padding: 8px 16px;
        min-width: auto;
        flex-shrink: 0;
    }

    .content {
        padding: 20px 15px;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 15px;
        display: block;
    }

    .pagination {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .pagination .btn {
        padding: 10px 20px;
        font-size: 16px;
        min-width: 100px;
    }

    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .movie-card img {
        height: auto;
    }

    .movie-info {
        padding: 8px;
    }

    .movie-title {
        font-size: 12px;
    }

    .movie-meta {
        font-size: 10px;
    }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
    .movie-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .header {
        position: relative !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .logo {
        font-size: 20px;
    }

    .main-nav a {
        font-size: 16px;
        padding: 6px 12px;
    }

    .genre-nav a {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .movie-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1025px) and (max-width: 1400px) {
    .movie-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Hero banner — Saint Milton icon, fixed behind everything site-wide */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 480px;
    background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.85) 75%, #000000 100%),
    url('/public/assets/images/og-homepage-milton-labeled.jpg');
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.scrolled::before {
    opacity: 0;
}

@media (max-width: 768px), (max-height: 768px) and (max-width: 1024px) {
    body::before {
        height: 320px;
        background-position: center 15%;
    }
}
