/* ============================================================
   PHIMKHOI PHP - DARK THEME STYLESHEET
   Color System: bg #0a0a0a, accent #8FA7C5, text #e2e8f0
   Font: Be Vietnam Pro (display) + Lexend (body)
   ============================================================ */

/* --- RESET & TOKENS --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #0a0a0a;
  --bg2:       #111118;
  --bg3:       #07070b;
  --surface:   rgba(255,255,255,0.04);
  --border:    rgba(255,255,255,0.07);
  --accent:    #8FA7C5;
  --accent2:   #6EE7B7;
  --text:      #e2e8f0;
  --text2:     #94a3b8;
  --text3:     #475569;
  --radius:    10px;
  --header-h:  64px;
  --sidebar-w: 72px;
  --font-d:    'Be Vietnam Pro', system-ui, sans-serif;
  --font-b:    'Lexend', system-ui, sans-serif;
  --shadow:    0 10px 32px rgba(0,0,0,0.6);
  --glow:      0 0 80px rgba(143,167,197,0.12);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* --- LOADING BAR --- */
#loading-bar {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 9999;
  background: linear-gradient(90deg, var(--accent), #a78bfa, var(--accent2));
  animation: loadbar 1.4s ease infinite;
}
@keyframes loadbar { 0%{width:0;opacity:1} 80%{width:90%;opacity:1} 100%{width:100%;opacity:0} }

/* --- SHIMMER SKELETON --- */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* --- HEADER --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background .3s;
}
.site-header.scrolled { background: rgba(7,7,11,0.98); }
.header-inner {
  max-width: 1920px; margin: 0 auto;
  padding: 0 1rem 0 calc(var(--sidebar-w) + 1rem);
  height: 100%; display: flex; align-items: center; gap: 1.5rem;
}

/* --- LOGO --- */
.site-logo { display: flex; align-items: center; font-family: var(--font-d); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; white-space: nowrap; }
.logo-lau  { color: var(--accent); }
.logo-phim { color: var(--text); }
.site-logo:hover { opacity: .85; }

/* --- MAIN NAV --- */
.main-nav {
  display: flex; align-items: center; gap: .25rem;
  flex: 1;
}
.nav-link {
  padding: .45rem .85rem; border-radius: 6px; font-size: .875rem; font-weight: 600;
  color: var(--text2); transition: all .2s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface); }
.chevron { font-size: .7rem; margin-left: .2rem; opacity: .6; }

/* DROPDOWN */
.nav-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + .5rem); left: 0;
  background: rgba(12,12,20,0.98); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; min-width: 220px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .2s; z-index: 200; box-shadow: var(--shadow);
}
.dropdown-wide { min-width: 580px; }
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.dropdown-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: .75rem; }
.dropdown-item { display: block; padding: .35rem .5rem; border-radius: 5px; font-size: .82rem; color: var(--text2); transition: all .15s; }
.dropdown-item:hover { color: var(--text); background: var(--surface); }

/* --- SEARCH --- */
.header-search { margin-left: auto; }
.search-wrap { position: relative; }
.search-wrap input {
  width: 240px; padding: .5rem 2.75rem .5rem 1rem; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: .85rem; outline: none;
  transition: all .2s;
}
.search-wrap input:focus { width: 300px; border-color: rgba(143,167,197,.4); background: rgba(255,255,255,.07); }
.search-wrap input::placeholder { color: var(--text3); }
.search-btn {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  color: var(--text3); transition: color .2s;
}
.search-btn:hover { color: var(--accent); }

/* SEARCH DROPDOWN */
.search-dropdown {
  position: absolute; top: calc(100% + .5rem); right: 0; left: 0;
  background: rgba(12,12,20,0.98); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 420px; overflow-y: auto; z-index: 300;
  box-shadow: var(--shadow);
}
.search-dropdown:empty { display: none; }
.search-result-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; transition: background .15s; cursor: pointer;
}
.search-result-item:hover { background: var(--surface); }
.search-result-thumb { width: 40px; height: 56px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.search-result-info .name  { font-size: .85rem; font-weight: 600; color: var(--text); line-clamp: 1; }
.search-result-info .meta  { font-size: .75rem; color: var(--text3); margin-top: .15rem; }

/* --- SIDEBAR --- */
.sidebar {
  position: fixed; left: 0; top: var(--header-h); bottom: 0;
  width: var(--sidebar-w); background: rgba(7,7,11,.9);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 900; overflow: hidden;
}
.sidebar-nav { display: flex; flex-direction: column; padding: 1rem 0; gap: .25rem; }
.sidebar-link {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .7rem .5rem; border-radius: 8px; margin: 0 .5rem;
  color: var(--text3); font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  transition: all .2s;
}
.sidebar-link svg { width: 20px; height: 20px; }
.sidebar-link:hover, .sidebar-link.active { color: var(--accent); background: rgba(143,167,197,.08); }

/* --- PAGE WRAPPER --- */
.page-wrapper {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* --- MOBILE MENU BUTTON --- */
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: var(--text2); border-radius: 2px; transition: all .3s; }
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE MENU PANEL */
.mobile-menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px;
  background: rgba(7,7,11,.98); backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  z-index: 1100; transform: translateX(-100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-inner { padding: calc(var(--header-h) + 1rem) 0 2rem; }
.mobile-search { padding: 0 1rem 1.5rem; }
.mobile-search-input {
  width: 100%; padding: .65rem 1rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .9rem; outline: none;
}
.mobile-nav { display: flex; flex-direction: column; }
.mobile-nav-link { padding: .75rem 1.5rem; font-size: .9rem; color: var(--text2); border-bottom: 1px solid rgba(255,255,255,.03); transition: all .15s; }
.mobile-nav-link:hover { color: var(--text); background: var(--surface); }
.mobile-section-label { padding: 1rem 1.5rem .35rem; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.mobile-divider { height: 1px; background: var(--border); margin: .75rem 0; }
.mobile-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1099;
  display: none; animation: fadeIn .2s;
}
.mobile-overlay.show { display: block; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.search-btn-sm { background: none; border: none; color: var(--text2); cursor: pointer; padding: 0 .5rem; }

/* --- BOTTOM NAV --- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px; background: rgba(7,7,11,.98); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border); z-index: 900;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: .2rem; color: var(--text3); font-size: .6rem; font-weight: 600;
  transition: color .2s;
}
.bottom-nav-item svg { width: 20px; height: 20px; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--accent); }

/* --- MOVIE CARD --- */
.movie-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg2); transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
  cursor: pointer;
}
.movie-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 50px rgba(0,0,0,.7); }
.movie-card-thumb { position: relative; aspect-ratio: 2/3; overflow: hidden; }
.movie-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.movie-card:hover .movie-card-thumb img { transform: scale(1.06); }
.movie-card-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.4) 50%, transparent 100%);
  opacity: 0; transition: opacity .25s;
}
.movie-card:hover .movie-card-overlay { opacity: 1; }
.movie-card-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.8);
  width: 52px; height: 52px; background: rgba(143,167,197,.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all .25s;
}
.movie-card-play svg { width: 22px; height: 22px; color: #0a0a0a; margin-left: 3px; }
.movie-card:hover .movie-card-play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.movie-card-badges { position: absolute; top: .5rem; left: .5rem; display: flex; flex-direction: column; gap: .3rem; }
.movie-card-info { padding: .7rem .6rem .8rem; }
.movie-card-title { font-size: .82rem; font-weight: 700; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.movie-card-sub   { font-size: .72rem; color: var(--text3); margin-top: .2rem; display: flex; gap: .5rem; }
.quality-badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 4px;
  font-size: .65rem; font-weight: 700; letter-spacing: .05em; border: 1px solid;
}
.ep-badge { background: rgba(143,167,197,.15); color: var(--accent); border: 1px solid rgba(143,167,197,.25); padding: .15rem .5rem; border-radius: 4px; font-size: .65rem; font-weight: 700; }
.new-badge { background: rgba(110,231,183,.15); color: var(--accent2); border: 1px solid rgba(110,231,183,.3); padding: .15rem .5rem; border-radius: 4px; font-size: .65rem; font-weight: 700; }

/* PROGRESS BAR ON CARD (continue watching) */
.card-progress-bar { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--accent); border-radius: 0 2px 0 0; pointer-events: none; }

/* --- MOVIE GRID --- */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

/* --- MOVIE ROW (horizontal scroll) --- */
.movie-row { margin-bottom: 2rem; }
.row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.row-title {
  font-family: var(--font-d); font-size: 1.1rem; font-weight: 900; color: var(--text);
  text-transform: uppercase; letter-spacing: .05em;
  padding-left: .75rem; border-left: 3px solid var(--accent);
}
.row-view-all { font-size: .8rem; font-weight: 600; color: var(--accent); opacity: .8; transition: opacity .2s; }
.row-view-all:hover { opacity: 1; }
.row-scroll { display: flex; gap: .85rem; overflow-x: auto; padding-bottom: .75rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.row-scroll::-webkit-scrollbar { height: 3px; }
.row-scroll::-webkit-scrollbar-track { background: transparent; }
.row-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
.row-scroll .movie-card { flex: 0 0 150px; width: 150px; scroll-snap-align: start; }

/* --- HERO SECTION --- */
.hero-section {
  position: relative; width: 100%; min-height: 75vh; overflow: hidden;
  display: flex; align-items: flex-end;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-gradient-l { position: absolute; inset: 0; background: linear-gradient(to right, #0a0a0a 30%, rgba(10,10,10,.7) 60%, rgba(10,10,10,.2)); }
.hero-gradient-b { position: absolute; inset: 0; background: linear-gradient(to top, #0a0a0a 0%, rgba(10,10,10,.8) 20%, transparent 60%); }
.hero-content {
  position: relative; z-index: 10; padding: 2.5rem 1.5rem 3rem;
  max-width: 620px;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.hero-badge { padding: .25rem .75rem; border-radius: 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: rgba(143,167,197,.15); color: var(--accent); border: 1px solid rgba(143,167,197,.25); }
.hero-title { font-family: var(--font-d); font-size: clamp(1.8rem,4vw,3rem); font-weight: 900; line-height: 1.1; color: #fff; margin-bottom: .5rem; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
.hero-subtitle { font-size: 1rem; color: rgba(255,255,255,.6); margin-bottom: 1rem; font-style: italic; }
.hero-desc { font-size: .875rem; color: rgba(255,255,255,.7); line-height: 1.7; margin-bottom: 1.5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; font-size: .8rem; color: rgba(255,255,255,.6); }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.75rem; border-radius: 30px; font-weight: 800; font-size: .9rem;
  background: var(--accent); color: #0a0a0a;
  transition: all .2s; box-shadow: 0 4px 20px rgba(143,167,197,.35);
}
.btn-primary:hover { transform: scale(1.04); box-shadow: 0 6px 28px rgba(143,167,197,.5); color: #0a0a0a; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: 30px; font-weight: 700; font-size: .9rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: var(--text);
  transition: all .2s;
}
.btn-secondary:hover { background: rgba(255,255,255,.18); color: var(--text); }

/* HERO PAGINATION DOTS */
.hero-dots { display: flex; gap: .4rem; margin-top: 1.5rem; }
.hero-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.3); cursor: pointer; transition: all .2s; }
.hero-dot.active { width: 22px; border-radius: 3px; background: var(--accent); }

/* --- SECTION HEADING --- */
.section-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--accent); opacity: .7; margin-bottom: .5rem; }
.section-title {
  font-family: var(--font-d); font-size: clamp(1.4rem,3vw,2.2rem); font-weight: 900;
  color: var(--text); text-transform: uppercase; letter-spacing: -.01em;
}

/* --- DETAIL PAGE HERO --- */
.detail-hero {
  position: relative; padding: 5rem 1.5rem 2rem;
  display: flex; align-items: flex-end; min-height: 480px; overflow: hidden;
}
.detail-hero-bg { position: absolute; inset: 0; }
.detail-hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.detail-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, #0a0a0a 35%, rgba(10,10,10,.8) 60%, rgba(10,10,10,.3));
}
.detail-hero-grad-b { position: absolute; bottom: 0; left: 0; right: 0; height: 220px; background: linear-gradient(to top, #0a0a0a, transparent); z-index: 1; }
.detail-hero-content { position: relative; z-index: 5; display: flex; gap: 2rem; align-items: flex-end; max-width: 1400px; width: 100%; }
.detail-poster {
  flex-shrink: 0; width: 160px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.8); border: 1px solid rgba(255,255,255,.1);
}
.detail-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.detail-info { flex: 1; }
.detail-title { font-family: var(--font-d); font-size: clamp(1.5rem,3.5vw,2.5rem); font-weight: 900; color: #fff; margin: .75rem 0 .35rem; line-height: 1.15; }
.detail-origin { font-size: 1rem; color: rgba(255,255,255,.5); font-style: italic; margin-bottom: .75rem; }
.detail-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--text2); margin-bottom: 1.25rem; }
.detail-meta span { display: flex; align-items: center; gap: .3rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* --- TABS --- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: .75rem 1.25rem; font-size: .875rem; font-weight: 700; color: var(--text3);
  border-bottom: 2px solid transparent; transition: all .2s; margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-color: var(--accent); }
.tab-btn:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- EPISODE LIST --- */
.episode-servers { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.server-btn {
  padding: .4rem .9rem; border-radius: 6px; font-size: .78rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  transition: all .15s;
}
.server-btn.active { background: rgba(143,167,197,.15); border-color: rgba(143,167,197,.4); color: var(--accent); }
.server-btn:hover { border-color: rgba(143,167,197,.3); color: var(--text); }
.episode-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.ep-btn {
  padding: .45rem .85rem; border-radius: 6px; font-size: .8rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  transition: all .15s; min-width: 60px; text-align: center;
}
.ep-btn:hover { border-color: rgba(143,167,197,.3); color: var(--text); }
.ep-btn.active { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.ep-btn.watched { border-color: rgba(110,231,183,.3); color: var(--accent2); }

/* --- VIDEO PLAYER WRAPPER --- */
.player-wrapper {
  position: relative; aspect-ratio: 16/9; width: 100%;
  background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.player-wrapper iframe,
.player-wrapper video { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
#art-player { width: 100%; height: 100%; }

/* SEEK NOTIFICATION */
.seek-notify {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(10,10,10,.85); border: 1px solid var(--border);
  padding: .75rem 1.25rem; border-radius: 8px; color: var(--accent);
  font-weight: 700; font-size: .9rem; z-index: 20; pointer-events: none;
  animation: seekFade 3s forwards;
}
@keyframes seekFade { 0%{opacity:0;transform:translate(-50%,-60%)} 15%{opacity:1;transform:translate(-50%,-50%)} 70%{opacity:1} 100%{opacity:0} }

/* --- INFO BOX --- */
.info-box {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1.5rem;
}
.info-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .85rem; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text3); }
.info-value { color: var(--text); font-weight: 600; text-align: right; max-width: 60%; }

/* --- CAT PILLS --- */
.cat-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.cat-pill {
  padding: .3rem .75rem; border-radius: 5px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text3);
  transition: all .15s;
}
.cat-pill:hover { color: var(--accent); border-color: rgba(143,167,197,.3); }

/* --- RELATED MOVIES (vertical list) --- */
.related-list { display: flex; flex-direction: column; gap: .75rem; }
.related-item { display: flex; gap: .75rem; align-items: center; padding: .5rem; border-radius: 8px; transition: background .15s; }
.related-item:hover { background: var(--surface); }
.related-thumb { flex-shrink: 0; width: 52px; height: 72px; border-radius: 6px; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-name { font-size: .82rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.related-meta { font-size: .72rem; color: var(--text3); margin-top: .2rem; }

/* --- HISTORY PAGE --- */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1rem; }
.history-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem; display: flex; gap: .85rem; align-items: center; transition: border-color .2s;
}
.history-card:hover { border-color: rgba(143,167,197,.25); }
.history-thumb { flex-shrink: 0; width: 56px; height: 80px; border-radius: 7px; overflow: hidden; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-info { flex: 1; min-width: 0; }
.history-name { font-size: .85rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-ep   { font-size: .75rem; color: var(--accent); margin: .2rem 0; }
.history-time { font-size: .72rem; color: var(--text3); }
.history-progress { height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; margin-top: .5rem; }
.history-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.history-continue {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; color: var(--accent);
  padding: .3rem .7rem; border: 1px solid rgba(143,167,197,.25); border-radius: 20px;
  margin-top: .5rem; transition: all .15s;
}
.history-continue:hover { background: rgba(143,167,197,.1); color: var(--accent); }

/* --- FILTER BAR --- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-select {
  padding: .45rem .9rem; border-radius: 6px; font-size: .8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  outline: none; cursor: pointer; transition: border-color .2s;
}
.filter-select:focus { border-color: rgba(143,167,197,.4); color: var(--text); }
option { background: #0f0f18; }

/* --- PAGINATION --- */
.pagination { display: flex; justify-content: center; margin: 2rem 0; }
.page-list { display: flex; list-style: none; gap: .35rem; flex-wrap: wrap; justify-content: center; }
.page-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 7px; font-size: .85rem; font-weight: 700;
  color: var(--text3); border: 1px solid var(--border); background: var(--surface);
  transition: all .15s;
}
.page-btn:hover { color: var(--text); border-color: rgba(143,167,197,.3); }
.page-btn.active { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.page-ellipsis { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--text3); font-size: .85rem; }

/* --- SEARCH PAGE --- */
.search-header { padding: 2rem 0 1rem; }
.search-results-count { font-size: .85rem; color: var(--text3); margin-top: .5rem; }

/* --- EMPTY STATE --- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5rem 1rem; text-align: center; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: .4; }
.empty-title { font-size: 1.2rem; font-weight: 700; color: var(--text2); margin-bottom: .5rem; }
.empty-desc  { font-size: .875rem; color: var(--text3); max-width: 320px; }

/* --- CONTENT LAYOUT --- */
.content-main {
  max-width: 1920px; margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
}
@media (min-width: 768px) { .content-main { padding: 2rem 2rem 5rem; } }
@media (min-width: 1024px) { .content-main { padding: 2rem 3rem 4rem calc(1rem); } }

/* Detail 2-col layout */
.detail-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .detail-layout { grid-template-columns: 8fr 4fr; } }

/* Watch 2-col layout */
.watch-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 1024px) { .watch-layout { grid-template-columns: 9fr 3fr; } }

/* --- FOOTER --- */
.site-footer { background: var(--bg3); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-left: var(--sidebar-w); }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.footer-top { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 768px) { .footer-top { grid-template-columns: 280px 1fr; } }
.footer-brand { }
.footer-logo { font-size: 1.6rem; margin-bottom: 1rem; }
.footer-tagline { font-size: .82rem; color: var(--text3); line-height: 1.7; max-width: 240px; }
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.footer-col h4 { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: .75rem; }
.footer-col a { display: block; font-size: .82rem; color: var(--text3); padding: .2rem 0; transition: color .15s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.25rem; text-align: center; }
.footer-bottom p { font-size: .75rem; color: var(--text3); margin-bottom: .4rem; }
.footer-disclaimer { opacity: .6; }

/* --- SCROLL TO TOP --- */
.scroll-top-btn {
  position: fixed; bottom: 80px; right: 1rem; z-index: 800;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: var(--shadow);
}
.scroll-top-btn:hover { background: rgba(143,167,197,.15); color: var(--accent); }
.scroll-top-btn svg { width: 16px; height: 16px; }

/* --- QUICK NAV --- */
.quick-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.quick-nav-item {
  padding: .45rem 1rem; border-radius: 20px; font-size: .8rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--text3);
  transition: all .15s; white-space: nowrap;
}
.quick-nav-item:hover { color: var(--accent); border-color: rgba(143,167,197,.3); }
.quick-nav-item.active { background: rgba(143,167,197,.12); border-color: rgba(143,167,197,.3); color: var(--accent); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .page-wrapper { margin-left: 0; }
  .site-footer { margin-left: 0; }
  .header-inner { padding: 0 1rem; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .bottom-nav { display: flex; }
  .page-wrapper { padding-bottom: 60px; }
}
@media (max-width: 640px) {
  .detail-poster { display: none; }
  .hero-content { padding: 1.5rem 1rem 2rem; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .7rem; }
  .row-scroll .movie-card { flex: 0 0 130px; width: 130px; }
  .search-wrap input { width: 180px; }
  .search-wrap input:focus { width: 220px; }
  .footer-links { grid-template-columns: repeat(2,1fr); }
  .history-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1536px) {
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); }
}
