/* =========================================================
   CINEVAULT — PREMIUM MOVIE UI
========================================================= */

:root {
    --bg: #070707;
    --bg-soft: #101010;
    --card: #151515;
    --card-hover: #1b1b1b;
    --text: #ffffff;
    --muted: #969696;
    --border: rgba(255,255,255,.09);
    --accent: #ff4d1f;
    --accent-2: #ff7a18;
    --gold: #ffc107;
    --danger: #ff304f;
    --shadow: 0 20px 60px rgba(0,0,0,.35);
    --radius: 16px;
    --max: 1240px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

body.light-mode {
    --bg: #f5f5f5;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-hover: #fafafa;
    --text: #151515;
    --muted: #666;
    --border: rgba(0,0,0,.1);
    --shadow: 0 20px 50px rgba(0,0,0,.12);
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
}

.container {
    width: min(var(--max), 92%);
    margin: auto;
}

.section {
    padding: 90px 0;
}

.section-dark {
    background: var(--bg-soft);
}

/* =========================================================
   NAVBAR
========================================================= */

.navbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: 76px;
    background: rgba(7,7,7,.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.light-mode .navbar {
    background: rgba(255,255,255,.85);
}

.nav-container {
    width: min(var(--max), 92%);
    height: 100%;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 45px;
}

.logo {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
}

.nav-menu a {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: .25s;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    transition: .25s;
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
}

#watchlistCount {
    display: inline-flex;
    min-width: 19px;
    height: 19px;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    margin-left: 3px;
    border-radius: 20px;
    background: var(--accent);
    color: white;
    font-size: 10px;
}

/* =========================================================
   HERO
========================================================= */

.hero {
    min-height: 760px;
    padding-top: 76px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;

    background:
        linear-gradient(
            90deg,
            rgba(5,5,5,.98) 0%,
            rgba(5,5,5,.88) 35%,
            rgba(5,5,5,.45) 70%,
            rgba(5,5,5,.92) 100%
        ),
        url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1800&q=85")
        center/cover;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 180px;
    background: linear-gradient(transparent, var(--bg));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.hero-kicker {
    display: inline-flex;
    padding: 7px 12px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,77,31,.4);
    border-radius: 50px;
    background: rgba(255,77,31,.1);
    color: #ff7957;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.hero h1 {
    font-size: clamp(48px, 7vw, 86px);
    line-height: .98;
    letter-spacing: -4px;
    margin-bottom: 22px;
}

.hero h1 span {
    color: var(--accent);
}

.hero-description {
    max-width: 580px;
    color: #b9b9b9;
    font-size: 15px;
    margin-bottom: 27px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #c7c7c7;
    font-size: 12px;
    margin-bottom: 28px;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 19px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 800;
    transition: .25s;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 30px rgba(255,77,31,.2);
}

.btn-primary:hover {
    background: #ff632f;
    transform: translateY(-3px);
}

.btn-secondary {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.16);
    color: white;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: #ff7957;
}

/* =========================================================
   HEADINGS
========================================================= */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 35px;
}

.section-heading.centered {
    display: block;
    text-align: center;
}

.section-label {
    display: block;
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.section-heading h2 {
    font-size: clamp(30px, 4vw, 45px);
    letter-spacing: -2px;
    line-height: 1.05;
}

.section-heading p {
    color: var(--muted);
    font-size: 13px;
}

/* =========================================================
   SEARCH
========================================================= */

.search-area {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.search-box {
    max-width: 650px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 15px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,77,31,.08);
}

.search-box input {
    width: 100%;
    padding: 11px 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--muted);
}

.search-box button {
    border: 0;
    background: transparent;
    color: var(--muted);
}

/* =========================================================
   FILTERS
========================================================= */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-btn,
.filter-select {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--muted);
    font-size: 11px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filter-select {
    outline: 0;
}

/* =========================================================
   MOVIE ROW
========================================================= */

.movie-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.movie-card {
    min-width: 0;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    transition: .3s ease;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(255,77,31,.55);
    box-shadow: var(--shadow);
}

.poster {
    position: relative;
    height: 330px;
    overflow: hidden;
    background: #191919;
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .45s ease;
}

.movie-card:hover .poster img {
    transform: scale(1.06);
}

.poster::after {
    content: "";
    position: absolute;
    inset: 50% 0 0;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    pointer-events: none;
}

.rating {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(0,0,0,.75);
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
}

.favorite-btn {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    background: rgba(0,0,0,.7);
    color: white;
    transition: .25s;
}

.favorite-btn:hover,
.favorite-btn.saved {
    background: var(--accent);
    border-color: var(--accent);
}

.movie-card-content {
    padding: 15px;
}

.movie-card-content h3 {
    overflow: hidden;
    margin-bottom: 5px;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.movie-info {
    display: flex;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
}

.movie-info .genre {
    color: var(--accent);
}

.card-button {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    transition: .2s;
}

.card-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================================================
   TRENDING NUMBER CARDS
========================================================= */

.trending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.trending-card {
    position: relative;
    overflow: hidden;
    min-height: 380px;
    border-radius: 17px;
    background: var(--card);
    border: 1px solid var(--border);
}

.trending-card img {
    height: 100%;
    object-fit: cover;
    transition: .4s;
}

.trending-card:hover img {
    transform: scale(1.05);
}

.trending-card::after {
    content: "";
    position: absolute;
    inset: 40% 0 0;
    background: linear-gradient(transparent, rgba(0,0,0,.95));
}

.trending-rank {
    position: absolute;
    left: 12px;
    bottom: 8px;
    z-index: 3;
    font-size: 85px;
    line-height: .8;
    font-weight: 900;
    color: rgba(255,255,255,.85);
}

.trending-title {
    position: absolute;
    left: 85px;
    right: 15px;
    bottom: 16px;
    z-index: 4;
}

.trending-title h3 {
    font-size: 15px;
}

.trending-title p {
    color: #aaa;
    font-size: 10px;
}

/* =========================================================
   GENRE CARDS
========================================================= */

.genre-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.genre-card {
    min-height: 150px;
    padding: 23px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 15px;
    background:
        linear-gradient(145deg, rgba(255,77,31,.13), transparent 60%),
        var(--card);
    color: var(--text);
    transition: .3s;
}

.genre-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
}

.genre-card span {
    display: block;
    margin-bottom: 18px;
    font-size: 30px;
}

.genre-card strong {
    display: block;
    font-size: 15px;
}

.genre-card small {
    color: var(--muted);
    font-size: 10px;
}

/* =========================================================
   FEATURE STRIP
========================================================= */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature-card {
    padding: 27px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card);
}

.feature-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 11px;
    background: rgba(255,77,31,.1);
    font-size: 20px;
}

.feature-card h3 {
    margin-bottom: 7px;
    font-size: 16px;
}

.feature-card p {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   PAGE HERO
========================================================= */

.page-hero {
    padding: 160px 0 70px;
    background:
        radial-gradient(
            circle at 80% 30%,
            rgba(255,77,31,.18),
            transparent 35%
        ),
        var(--bg);
}

.page-hero h1 {
    font-size: clamp(40px,6vw,65px);
    letter-spacing: -3px;
    margin-bottom: 12px;
}

.page-hero h1 span {
    color: var(--accent);
}

.page-hero p {
    max-width: 600px;
    color: var(--muted);
}

/* =========================================================
   WATCHLIST
========================================================= */

.empty-state {
    padding: 80px 20px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 17px;
    background: var(--card);
}

.empty-state .icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.empty-state h3 {
    margin-bottom: 7px;
}

.empty-state p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

/* =========================================================
   MODAL
========================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.86);
    backdrop-filter: blur(10px);
}

.modal-box {
    position: relative;
    z-index: 2;
    width: min(850px, 95vw);
    max-height: 90vh;
    overflow: auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.modal-poster {
    min-height: 430px;
}

.modal-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 40px;
}

.modal-info .genre {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.modal-info h2 {
    margin: 10px 0;
    font-size: 35px;
    line-height: 1.1;
}

.modal-info p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    margin: 20px 0;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    background: rgba(0,0,0,.7);
    color: white;
}

.modal-close:hover {
    background: var(--accent);
}

/* =========================================================
   FOOTER
========================================================= */

.footer {
    padding: 50px 0 25px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-container {
    width: min(var(--max), 92%);
    margin: auto;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.footer p {
    color: var(--muted);
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 11px;
}

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

.copyright {
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {

    .movie-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .movie-row .movie-card:nth-child(5) {
        display: none;
    }

    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {

    .nav-menu {
        position: absolute;
        top: 76px;
        left: 4%;
        width: 92%;
        padding: 20px;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 13px;
    }

    .nav-menu.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

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

    .movie-row .movie-card:nth-child(4),
    .movie-row .movie-card:nth-child(5) {
        display: none;
    }

    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .modal-box {
        grid-template-columns: 1fr;
    }

    .modal-poster {
        min-height: 300px;
        max-height: 300px;
    }
}

@media (max-width: 560px) {

    .section {
        padding: 70px 0;
    }

    .hero {
        min-height: 680px;
    }

    .hero h1 {
        font-size: 45px;
        letter-spacing: -2px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .section-heading {
        display: block;
    }

    .section-heading > p {
        margin-top: 10px;
    }

    .movie-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .movie-row .movie-card:nth-child(n+3) {
        display: none;
    }

    .poster {
        height: 270px;
    }

    .trending-grid,
    .genre-grid {
        grid-template-columns: 1fr;
    }

    .search-area {
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }

    .modal-info {
        padding: 25px;
    }

    .modal-info h2 {
        font-size: 27px;
    }
}