/* =========================================================
   RESET
========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: "Inter", sans-serif; background: #0b0b0b; color: #fff; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
img { max-width: 100%; }

/* =========================================================
   VARIABLES
========================================================= */
:root {
    --gold: #f5c518;
    --gold-hover: #e8b815;
    --black: #0b0b0b;
    --dark: #161616;
    --dark-2: #1d1d1d;
    --dark-3: #242424;
    --white: #ffffff;
    --muted: #a3a3a3;
    --border: #292929;
    --container: 1400px;
}

/* =========================================================
   GLOBAL
========================================================= */
.container { width: min(var(--container), calc(100% - 50px)); margin: auto; }
.section { padding: 55px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 12px; }
.section-title { font-size: 25px; font-weight: 800; }
.section-title span { color: var(--gold); }
.view-all { color: var(--gold); font-size: 14px; font-weight: 600; }
.view-all:hover { text-decoration: underline; }

.page-hero { padding: 130px 0 30px; }
.page-hero h1 { font-size: 34px; font-weight: 900; }
.page-hero p { color: var(--muted); margin-top: 8px; }

.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.alert-error { background: rgba(220, 53, 69, .12); border: 1px solid rgba(220, 53, 69, .3); color: #ff8a97; }
.alert-success { background: rgba(40, 167, 69, .12); border: 1px solid rgba(40, 167, 69, .3); color: #7be495; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state a { color: var(--gold); font-weight: 700; }

/* =========================================================
   NAVBAR
========================================================= */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: 72px; background: rgba(11,11,11,.94); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(255,255,255,.07); z-index: 1000; }
.nav-container { height: 100%; display: flex; align-items: center; gap: 35px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 900; letter-spacing: -1px; }
.logo-box { background: var(--gold); color: #111; padding: 5px 7px; border-radius: 3px; font-size: 20px; font-weight: 900; }
.logo-text { color: white; }
.nav-links { display: flex; align-items: center; gap: 27px; font-size: 14px; font-weight: 500; color: #ddd; }
.nav-links a { transition: .2s; }
.nav-links a:hover { color: var(--gold); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }

.search { position: relative; }
.search input { width: 260px; height: 40px; background: #fff; border: 0; border-radius: 4px; padding: 0 45px 0 15px; color: #111; outline: none; }
.search button { position: absolute; right: 5px; top: 5px; width: 30px; height: 30px; background: transparent; font-size: 17px; }

.search-suggestions {
    position: absolute; top: 46px; left: 0; width: 320px;
    background: var(--dark-2); border: 1px solid var(--border); border-radius: 6px;
    overflow: hidden; display: none; z-index: 1001; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.search-suggestions.active { display: block; }
.search-suggestions a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; }
.search-suggestions a:hover { background: var(--dark-3); }
.search-suggestions img { width: 34px; height: 50px; object-fit: cover; border-radius: 3px; background: var(--dark); }
.search-suggestions .sugg-meta { color: #888; font-size: 11px; }

.user-menu { display: flex; align-items: center; gap: 14px; }
.login-btn { background: transparent; color: #fff; font-weight: 600; }
.login-btn:hover { color: var(--gold); }
.menu-btn { display: none; background: transparent; color: white; font-size: 25px; }

/* =========================================================
   HERO
========================================================= */
.hero {
    min-height: 720px; position: relative; display: flex; align-items: center;
    background:
        linear-gradient(90deg, rgba(5,5,5,.98) 0%, rgba(5,5,5,.88) 35%, rgba(5,5,5,.3) 65%, rgba(5,5,5,.8) 100%),
        linear-gradient(0deg, #0b0b0b 0%, transparent 35%);
    background-size: cover; background-position: center;
}
.hero-content { padding-top: 70px; max-width: 650px; }
.hero-label { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); line-height: .95; font-weight: 900; letter-spacing: -3px; margin-bottom: 20px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; color: #ddd; font-size: 14px; }
.rating { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 800; }
.hero-description { color: #ccc; font-size: 16px; line-height: 1.7; max-width: 590px; margin-bottom: 30px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.btn { height: 46px; padding: 0 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; transition: .2s; }
.btn-primary { background: var(--gold); color: #111; }
.btn-primary:hover { background: var(--gold-hover); transform: translateY(-2px); }
.btn-secondary { background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(10px); }
.btn-secondary:hover { background: rgba(255,255,255,.2); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* =========================================================
   GENRES
========================================================= */
.genres { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; flex-wrap: wrap; }
.genres::-webkit-scrollbar { display: none; }
.genre { flex-shrink: 0; padding: 10px 17px; border: 1px solid var(--border); background: var(--dark); border-radius: 30px; color: #bbb; font-size: 13px; cursor: pointer; transition: .2s; }
.genre:hover, .genre.active { background: var(--gold); border-color: var(--gold); color: #111; }

/* =========================================================
   MOVIE GRID
========================================================= */
.movie-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.movie-card { min-width: 0; position: relative; transition: transform .25s ease; }
.movie-card:hover { transform: translateY(-7px); }
.poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 7px; background: var(--dark); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.movie-card:hover .poster img { transform: scale(1.06); }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent 45%); pointer-events: none; }
.rating-badge { position: absolute; top: 9px; left: 9px; z-index: 2; background: var(--gold); color: #111; padding: 4px 7px; border-radius: 3px; font-size: 12px; font-weight: 800; }
.type-badge { position: absolute; top: 9px; right: 9px; z-index: 2; background: rgba(0,0,0,.65); color: #fff; padding: 4px 7px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.card-info { padding-top: 12px; }
.movie-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 7px; }
.movie-meta { color: #858585; font-size: 12px; }

/* =========================================================
   WIDE FEATURE CARDS
========================================================= */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { position: relative; min-height: 220px; overflow: hidden; border-radius: 8px; background: var(--dark); }
.feature-card img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; transition: .4s; }
.feature-card:hover img { transform: scale(1.06); }
.feature-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.9), rgba(0,0,0,.05)); }
.feature-content { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 20px; }
.feature-content h3 { font-size: 20px; margin-bottom: 7px; }
.feature-content p { font-size: 12px; color: #ccc; }

/* =========================================================
   TOP RATED
========================================================= */
.top-rated { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.top-item { display: flex; align-items: center; gap: 16px; background: var(--dark); padding: 12px; border-radius: 7px; border: 1px solid transparent; transition: .2s; }
.top-item:hover { border-color: var(--border); background: var(--dark-2); }
.top-number { width: 35px; text-align: center; color: #777; font-weight: 800; }
.top-poster { width: 60px; height: 85px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.top-poster img { width: 100%; height: 100%; object-fit: cover; }
.top-info { flex: 1; }
.top-info h3 { font-size: 14px; margin-bottom: 7px; }
.top-info p { color: #777; font-size: 12px; }
.top-score { color: var(--gold); font-weight: 800; font-size: 14px; }

/* =========================================================
   CTA
========================================================= */
.cta { padding: 65px 30px; border-radius: 10px; text-align: center; background: linear-gradient(120deg, rgba(245,197,24,.16), rgba(245,197,24,.03)); border: 1px solid rgba(245,197,24,.15); }
.cta h2 { font-size: 32px; margin-bottom: 12px; }
.cta p { color: #999; margin-bottom: 25px; }

/* =========================================================
   DETAIL PAGE
========================================================= */
.detail-hero { position: relative; min-height: 500px; display: flex; align-items: flex-end; background-size: cover; background-position: center; }
.detail-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #0b0b0b 5%, rgba(11,11,11,.75) 55%, rgba(11,11,11,.35) 100%); }
.detail-hero-inner { position: relative; z-index: 2; display: flex; gap: 34px; padding: 130px 0 40px; align-items: flex-end; flex-wrap: wrap; }
.detail-poster { width: 230px; flex-shrink: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.detail-poster img { width: 100%; display: block; }
.detail-info { flex: 1; min-width: 280px; }
.detail-info h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; margin-bottom: 10px; }
.detail-tagline { color: var(--muted); font-style: italic; margin-bottom: 14px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; color: #ddd; font-size: 14px; margin-bottom: 18px; }
.detail-overview { max-width: 700px; color: #ccc; line-height: 1.7; margin-bottom: 22px; }
.score-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.score-pill { background: var(--dark-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.score-pill .label { color: var(--muted); font-weight: 500; }
.score-pill.gold { color: var(--gold); }

.cast-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.cast-card { flex-shrink: 0; width: 120px; text-align: center; }
.cast-card img { width: 120px; height: 160px; object-fit: cover; border-radius: 6px; background: var(--dark); }
.cast-card .name { font-size: 12px; font-weight: 700; margin-top: 8px; }
.cast-card .role { font-size: 11px; color: var(--muted); }

.trailer-wrap { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 8px; overflow: hidden; background: var(--dark); }
.trailer-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =========================================================
   AUTH FORMS
========================================================= */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 100px 20px 40px; }
.auth-card { width: 100%; max-width: 400px; background: var(--dark); border: 1px solid var(--border); border-radius: 10px; padding: 34px; }
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #ddd; }
.field input { width: 100%; height: 44px; border-radius: 6px; border: 1px solid var(--border); background: var(--dark-3); color: #fff; padding: 0 13px; outline: none; }
.field input:focus { border-color: var(--gold); }
.auth-switch { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-switch a { color: var(--gold); font-weight: 700; }

/* =========================================================
   PAGINATION
========================================================= */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span { padding: 9px 15px; border-radius: 6px; border: 1px solid var(--border); background: var(--dark); font-size: 13px; font-weight: 700; }
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination .current { background: var(--gold); color: #111; border-color: var(--gold); }

/* =========================================================
   FOOTER
========================================================= */
footer { margin-top: 60px; border-top: 1px solid var(--border); background: #0a0a0a; }
.footer { padding: 45px 0; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-brand p { margin-top: 12px; color: #777; font-size: 13px; line-height: 1.7; }
.footer-links { display: flex; gap: 70px; flex-wrap: wrap; }
.footer-column h4 { font-size: 13px; margin-bottom: 15px; }
.footer-column a { display: block; color: #777; font-size: 12px; margin-bottom: 10px; }
.footer-column a:hover { color: var(--gold); }
.copyright { padding: 20px 0; border-top: 1px solid var(--border); color: #555; font-size: 12px; }

/* =========================================================
   MOBILE MENU
========================================================= */
.mobile-menu { position: fixed; top: 64px; left: 0; right: 0; background: #111; border-bottom: 1px solid var(--border); padding: 20px; display: none; z-index: 999; }
.mobile-menu.active { display: block; }
.mobile-menu a { display: block; padding: 13px 0; color: #ccc; border-bottom: 1px solid #222; }
.mobile-menu a:hover { color: var(--gold); }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1200px) { .movie-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1000px) {
    .nav-links { display: none; }
    .menu-btn { display: block; }
    .movie-grid { grid-template-columns: repeat(4, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .container { width: min(100% - 30px, var(--container)); }
    .navbar { height: 64px; }
    .nav-container { gap: 15px; }
    .logo { font-size: 20px; }
    .logo-box { font-size: 17px; }
    .search { display: none; }
    .hero { min-height: 650px; }
    .hero-content { padding-top: 100px; }
    .hero h1 { font-size: 48px; letter-spacing: -2px; }
    .hero-description { font-size: 14px; }
    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .feature-grid { grid-template-columns: 1fr; }
    .top-rated { grid-template-columns: 1fr; }
    .footer { flex-direction: column; }
    .footer-links { gap: 35px; flex-wrap: wrap; }
    .section { padding: 40px 0; }
    .detail-poster { width: 160px; }
}
@media (max-width: 400px) {
    .hero h1 { font-size: 40px; }
    .movie-grid { gap: 12px; }
    .movie-title { font-size: 13px; }
}
