/* ============================
   NexusVault — Professional CSS
   Inspired by Netflix / Crunchyroll
   ============================ */

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

:root {
    --bg:       #0d0d0d;
    --bg2:      #141414;
    --bg3:      #1a1a1a;
    --bg4:      #222;
    --surface:  #1f1f1f;
    --border:   rgba(255,255,255,0.08);
    --border2:  rgba(255,255,255,0.15);
    --text:     #e5e5e5;
    --text2:    #b3b3b3;
    --text3:    #737373;
    --red:      #E50914;
    --red-h:    #f40212;
    --green:    #46D369;
    --yellow:   #f5c518;
    --font:     'Manrope', system-ui, -apple-system, sans-serif;
    --radius:   6px;
    --max-w:    1320px;
    --transition: 200ms ease;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
select { font-family: inherit; }

/* ====== NAV ====== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
    padding: 0 48px; height: 64px; display: flex; align-items: center;
    transition: background 300ms;
}
.nav.solid { background: rgba(13,13,13,0.97); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: var(--max-w); margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); }
.nav-brand span { letter-spacing: -0.3px; }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nm-item {
    padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text2);
    border-radius: 4px; transition: color var(--transition); display: inline-flex; align-items: center; gap: 4px;
}
.nm-item:hover, .nm-item.active { color: var(--text); }
.nm-drop { position: relative; }
.drop-list {
    position: absolute; top: 100%; left: 0; min-width: 200px;
    background: var(--bg3); border: 1px solid var(--border2);
    border-radius: var(--radius); padding: 6px; display: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.nm-drop:hover .drop-list { display: block; }
.drop-list a { display: block; padding: 8px 12px; font-size: 13px; color: var(--text2); border-radius: 4px; transition: var(--transition); }
.drop-list a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-search-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--text2); transition: var(--transition);
}
.nav-search-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.nav-burger { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.nav-burger span { width: 18px; height: 2px; background: var(--text2); border-radius: 1px; }

/* ====== SEARCH MODAL ====== */
.search-modal { position: fixed; inset: 0; z-index: 1000; display: none; }
.search-modal.open { display: flex; flex-direction: column; align-items: center; }
.search-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.75); }
.search-box {
    position: relative; z-index: 1; width: 100%; max-width: 640px;
    margin-top: 100px; background: var(--bg3); border-radius: 12px;
    overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.search-input-wrap {
    display: flex; align-items: center; gap: 12px; padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.search-input-wrap svg { flex-shrink: 0; }
.search-input-wrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; }
.search-input-wrap kbd {
    padding: 2px 8px; font-size: 11px; background: rgba(255,255,255,0.08);
    border: 1px solid var(--border2); border-radius: 4px; color: var(--text3);
}
.search-results { max-height: 400px; overflow-y: auto; }
.sr-empty { padding: 32px; text-align: center; color: var(--text3); font-size: 14px; }
.sr-item {
    display: flex; gap: 12px; padding: 12px 20px; transition: background var(--transition); cursor: pointer;
}
.sr-item:hover { background: rgba(255,255,255,0.04); }
.sr-item img { width: 40px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: var(--bg4); }
.sr-info { flex: 1; min-width: 0; }
.sr-info h4 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-info span { font-size: 12px; color: var(--text3); }
.sr-info .sr-overview { font-size: 12px; color: var(--text3); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ====== HERO ====== */
.hero { position: relative; height: 75vh; min-height: 480px; max-height: 700px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; transition: opacity 800ms; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to right, rgba(13,13,13,0.95) 0%, rgba(13,13,13,0.6) 40%, transparent 70%),
                linear-gradient(to top, var(--bg) 0%, transparent 40%);
}
.hero-inner { position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto; padding: 0 48px; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.hero-content { max-width: 520px; }
.hero-tags { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-tag {
    padding: 3px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
    border-radius: 3px; letter-spacing: 0.5px;
}
.hero-tag.t-quality { background: var(--red); color: #fff; }
.hero-tag.t-type { background: rgba(255,255,255,0.1); color: var(--text2); }
.hero-tag.t-lang { border: 1px solid var(--border2); color: var(--text2); }
.hero-title { font-size: 42px; font-weight: 800; line-height: 1.1; margin-bottom: 12px; letter-spacing: -0.5px; }
.hero-desc { font-size: 15px; color: var(--text2); line-height: 1.6; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; font-size: 13px; color: var(--text3); }
.hero-meta .hm-rating { color: var(--yellow); font-weight: 700; }
.hero-meta .hm-year { color: var(--text2); }
.hero-meta .hm-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text3); }
.hero-btns { display: flex; gap: 10px; }
.hero-dots { position: absolute; bottom: 40px; left: 48px; display: flex; gap: 6px; }
.hero-dot { width: 24px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.25); cursor: pointer; transition: var(--transition); }
.hero-dot.active { background: var(--red); width: 32px; }

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px;
    font-size: 14px; font-weight: 700; border-radius: var(--radius); transition: var(--transition);
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-h); }
.btn-ghost { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.15); }
.btn-sm { padding: 7px 16px; font-size: 13px; }

/* ====== MAIN CONTENT ROWS ====== */
.main { position: relative; z-index: 1; padding: 0 0 48px; }
.row { max-width: var(--max-w); margin: 0 auto; padding: 32px 48px 0; }
.row-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.row-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
    scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar { display: none; }

/* ====== CARD (Netflix-style) ====== */
.card {
    flex-shrink: 0; width: 175px; scroll-snap-align: start;
    cursor: pointer; position: relative; border-radius: var(--radius);
    overflow: hidden; transition: transform 300ms, box-shadow 300ms;
}
.card:hover { transform: scale(1.08); z-index: 10; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
.card-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg4); display: block; }
.card-badge {
    position: absolute; top: 6px; left: 6px; padding: 2px 6px;
    font-size: 10px; font-weight: 700; border-radius: 3px; z-index: 2;
}
.card-badge.badge-new { background: var(--red); color: #fff; }
.card-badge.badge-hd { background: rgba(0,0,0,0.7); color: var(--green); }
.card-rating {
    position: absolute; top: 6px; right: 6px; padding: 2px 6px;
    font-size: 11px; font-weight: 700; background: rgba(0,0,0,0.7);
    border-radius: 3px; color: var(--yellow); z-index: 2;
}
.card-bar {
    position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: rgba(255,255,255,0.15);
}
.card-bar-fill { height: 100%; background: var(--red); }

/* Grid card (genre page) */
.grid-card {
    border-radius: var(--radius); overflow: hidden; cursor: pointer;
    transition: transform 300ms, box-shadow 300ms; position: relative; background: var(--bg3);
}
.grid-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.grid-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg4); }
.grid-card .gc-info { padding: 10px 12px; }
.grid-card .gc-title { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-card .gc-meta { font-size: 12px; color: var(--text3); margin-top: 4px; display: flex; gap: 8px; }
.grid-card .gc-meta .gc-rating { color: var(--yellow); font-weight: 600; }

/* ====== SKELETON ====== */
.sk { background: var(--bg3); border-radius: var(--radius); animation: sk-pulse 1.5s ease-in-out infinite; }
@keyframes sk-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.7; } }
.sk-card { width: 175px; height: 262px; flex-shrink: 0; border-radius: var(--radius); }
.sk-banner { width: 100%; height: 400px; }
.sk-poster { width: 200px; height: 300px; }
.sk-line { height: 16px; border-radius: 4px; margin-top: 12px; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }
.sk-line.w80 { width: 80%; }

/* ====== GENRE PAGE ====== */
.page-head {
    padding: 100px 48px 0; max-width: var(--max-w); margin: 0 auto;
}
.page-head h1 { font-size: 32px; font-weight: 800; margin-bottom: 20px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.f-select {
    padding: 8px 32px 8px 12px; font-size: 13px; color: var(--text); background: var(--bg3);
    border: 1px solid var(--border2); border-radius: var(--radius); outline: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23737373' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; cursor: pointer;
}
.f-select option { background: var(--bg3); }
.grid-page {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px;
    max-width: var(--max-w); margin: 0 auto; padding: 0 48px;
}
.pager { display: flex; justify-content: center; gap: 6px; padding: 32px 48px; }
.pg-btn {
    min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; border-radius: var(--radius);
    background: var(--bg3); border: 1px solid var(--border); color: var(--text2); transition: var(--transition);
}
.pg-btn:hover { border-color: var(--text3); color: var(--text); }
.pg-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ====== DETAIL PAGE ====== */
.detail-skeleton { max-width: var(--max-w); margin: 0 auto; padding: 100px 48px 0; display: flex; gap: 32px; }
.detail-wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 48px 48px; }
.det-hero { position: relative; margin: -64px -48px 0; height: 50vh; min-height: 360px; max-height: 500px; overflow: hidden; }
.det-hero img { width: 100%; height: 100%; object-fit: cover; }
.det-hero-grad {
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--bg) 0%, rgba(13,13,13,0.5) 50%, transparent 100%);
}
.det-body { display: flex; gap: 32px; margin-top: -100px; position: relative; z-index: 2; }
.det-poster { flex-shrink: 0; width: 220px; }
.det-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.det-info { flex: 1; min-width: 0; }
.det-title { font-size: 30px; font-weight: 800; line-height: 1.15; margin-bottom: 12px; letter-spacing: -0.3px; }
.det-tagline { font-size: 15px; font-style: italic; color: var(--text3); margin-bottom: 16px; }
.det-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; align-items: center; }
.det-pill {
    padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 4px;
}
.det-pill.p-rating { background: rgba(245,197,24,0.15); color: var(--yellow); }
.det-pill.p-year { background: rgba(255,255,255,0.08); color: var(--text2); }
.det-pill.p-lang { background: rgba(255,255,255,0.08); color: var(--text2); }
.det-pill.p-runtime { background: rgba(255,255,255,0.08); color: var(--text2); }
.det-pill.p-quality { background: var(--red); color: #fff; }
.det-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.det-genre {
    padding: 4px 12px; font-size: 12px; background: rgba(255,255,255,0.05);
    border: 1px solid var(--border); border-radius: 20px; color: var(--text2);
    transition: var(--transition);
}
.det-genre:hover { border-color: var(--text3); color: var(--text); }
.det-overview h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.det-overview p { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 24px; }

/* Download Section */
.det-dl {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; margin-bottom: 32px;
}
.det-dl-head {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700;
}
.det-dl-head svg { color: var(--red); }
.det-dl-table { width: 100%; border-collapse: collapse; }
.det-dl-table th {
    padding: 10px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text3); text-align: left;
    background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border);
}
.det-dl-table td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.det-dl-table tr:last-child td { border-bottom: none; }
.det-dl-table tr:hover { background: rgba(255,255,255,0.02); }
.dl-quality {
    display: inline-block; padding: 3px 10px; font-size: 11px; font-weight: 700;
    border-radius: 4px;
}
.dl-quality.q4k { background: var(--red); color: #fff; }
.dl-quality.q1080 { background: #0d7377; color: #fff; }
.dl-quality.q720 { background: #b8860b; color: #fff; }
.dl-quality.q480 { background: rgba(255,255,255,0.1); color: var(--text2); }
.dl-server { display: flex; align-items: center; gap: 6px; }
.dl-server-dot { width: 8px; height: 8px; border-radius: 50%; }
.dl-server-dot.gdrive { background: #4285F4; }
.dl-server-dot.mega { background: #D9272E; }
.dl-server-dot.one { background: #0078D4; }
.dl-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
    font-size: 12px; font-weight: 700; background: var(--red); color: #fff;
    border-radius: 4px; transition: var(--transition);
}
.dl-btn:hover { background: var(--red-h); }
.dl-btn svg { width: 14px; height: 14px; }

/* Cast */
.det-cast { margin-bottom: 24px; }
.det-cast h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.det-cast-list { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.det-cast-list::-webkit-scrollbar { display: none; }
.det-cast-item { text-align: center; flex-shrink: 0; width: 80px; }
.det-cast-item img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 6px; background: var(--bg4); }
.det-cast-item span { font-size: 11px; color: var(--text3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.det-cast-item .dci-char { font-size: 10px; color: var(--text3); }

/* ====== FOOTER ====== */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 48px 0 0; margin-top: 48px; }
.foot-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 48px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-brand p { font-size: 13px; color: var(--text3); margin-top: 12px; line-height: 1.6; max-width: 320px; }
.foot-links h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.foot-links a { display: block; font-size: 13px; color: var(--text3); padding: 3px 0; transition: color var(--transition); }
.foot-links a:hover { color: var(--text2); }
.foot-bottom { max-width: var(--max-w); margin: 32px auto 0; padding: 16px 48px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 12px; color: var(--text3); }
.foot-disclaimer { max-width: 400px; text-align: right; }

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
    .hero-inner, .row, .page-head, .grid-page, .detail-wrap, .foot-inner, .foot-bottom { padding-left: 24px; padding-right: 24px; }
    .nav { padding: 0 24px; }
    .det-body { flex-direction: column; }
    .det-poster { width: 180px; }
    .foot-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-menu {
        position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
        background: var(--bg); flex-direction: column; padding: 24px;
        transform: translateX(-100%); transition: transform 300ms; z-index: 899;
    }
    .nav-menu.open { transform: translateX(0); }
    .nav-burger { display: flex; }
    .nm-drop .drop-list { position: static; display: none; box-shadow: none; border: none; padding-left: 16px; }
    .nm-drop.open .drop-list { display: block; }
    .hero { height: 60vh; }
    .hero-title { font-size: 28px; }
    .hero-desc { -webkit-line-clamp: 2; }
    .hero-dots { display: none; }
    .card { width: 140px; }
    .grid-page { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .det-body { margin-top: -60px; }
    .det-poster { width: 140px; }
    .det-title { font-size: 22px; }
    .detail-wrap { padding: 0 16px 24px; }
    .detail-skeleton { padding: 100px 16px 0; }
    .foot-inner { grid-template-columns: 1fr; }
    .foot-bottom { flex-direction: column; gap: 6px; }
    .foot-disclaimer { text-align: left; }
    .hero-inner, .row, .page-head, .grid-page, .detail-wrap, .foot-inner, .foot-bottom { padding-left: 16px; padding-right: 16px; }
    .nav { padding: 0 16px; }
    .row { padding: 24px 16px 0; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 24px; }
    .hero-btns { flex-direction: column; }
    .card { width: 120px; }
    .grid-page { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .det-dl-table { font-size: 12px; }
    .det-dl-table th, .det-dl-table td { padding: 8px; }
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
