/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: #0a0a0a; color: #fff; font-family: 'Segoe UI', Arial, sans-serif; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; outline: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #e50914; border-radius: 3px; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: #111; height: 64px;
  border-bottom: 1px solid #1e1e1e;
}
.navbar.scrolled { background: #0d0d0dee; backdrop-filter: blur(8px); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.menu-toggle { background: none; color: #fff; font-size: 22px; padding: 6px 10px; border-radius: 6px; transition: background 0.2s; }
.menu-toggle:hover { background: #222; }
.logo { font-size: 20px; font-weight: 800; color: #e50914; white-space: nowrap; flex-shrink: 0; }
.search-box { display: flex; align-items: center; margin-left: auto; background: rgba(255,255,255,0.08); border-radius: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); }
.search-box input { background: none; border: none; outline: none; color: #fff; padding: 9px 16px; font-size: 14px; width: 260px; }
.search-box input::placeholder { color: #666; }
.search-box button { background: #e50914; color: #fff; padding: 9px 16px; font-size: 14px; transition: background 0.2s; }
.search-box button:hover { background: #c40812; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 64px; left: 0; bottom: 0;
  width: 200px; background: #0f0f0f;
  border-right: 1px solid #1a1a1a;
  overflow-y: auto; z-index: 900;
  padding: 12px 0; transition: transform 0.3s;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; color: #999; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-item:hover { color: #fff; background: #1a1a1a; }
.sidebar-item.active { color: #e50914; background: #1a0000; border-left-color: #e50914; }
.s-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-divider { border-top: 1px solid #1e1e1e; margin: 10px 0; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 850; }

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: 200px; padding-top: 64px; min-height: 100vh; }

/* ===== HERO ===== */
.hero {
  position: relative; height: 52vh; min-height: 320px;
  background: #111 center/cover no-repeat;
  display: flex; align-items: flex-end;
  padding-bottom: 50px; transition: background-image 0.8s ease;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.85) 35%, transparent 75%),
              linear-gradient(to top, #0a0a0a 0%, rgba(0,0,0,0.2) 60%);
}
.hero-content { position: relative; z-index: 2; padding: 0 40px; max-width: 620px; transition: opacity 0.4s ease; }
.hero-content.fade { opacity: 0; }
.hero-badge { display: inline-block; background: #e50914; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 4px; margin-bottom: 14px; letter-spacing: 1px; text-transform: uppercase; }
.hero-content h1 { font-size: clamp(26px, 3.5vw, 50px); font-weight: 800; line-height: 1.1; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }
.hero-content p { font-size: 14px; color: #ccc; line-height: 1.6; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; gap: 14px; font-size: 13px; color: #aaa; margin-bottom: 22px; flex-wrap: wrap; }
.hero-meta span { display: flex; align-items: center; gap: 4px; }
.hero-btns { display: flex; gap: 12px; }
.btn-play { background: #e50914; color: #fff; padding: 12px 28px; border-radius: 6px; font-size: 15px; font-weight: 700; transition: background 0.2s, transform 0.1s; }
.btn-play:hover { background: #c40812; transform: scale(1.03); }
.btn-info { background: rgba(255,255,255,0.15); color: #fff; padding: 12px 28px; border-radius: 6px; font-size: 15px; backdrop-filter: blur(4px); transition: background 0.2s; border: 1px solid rgba(255,255,255,0.2); }
.btn-info:hover { background: rgba(255,255,255,0.25); }

/* ===== HERO ARROWS ===== */
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; font-size: 46px; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; transition: background 0.2s; backdrop-filter: blur(4px); }
.hero-arrow:hover { background: rgba(229,9,20,0.85); }
.hero-arrow-left { left: 16px; }
.hero-arrow-right { right: 16px; }

/* ===== HERO DOTS ===== */
.hero-dots { position: absolute; bottom: 18px; right: 40px; display: flex; gap: 7px; z-index: 10; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.35); cursor: pointer; transition: all 0.3s; border: none; }
.hero-dot.active { background: #fff; width: 26px; border-radius: 5px; }

/* ===== SECTIONS ===== */
.section { padding: 18px 24px 26px; max-width: 100%; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 18px; font-weight: 700; color: #fff; }
.more-btn { font-size: 13px; color: #aaa; font-weight: 600; transition: color 0.2s; white-space: nowrap; }
.more-btn:hover { color: #e50914; }
.hidden { display: none !important; }

/* ===== SCROLL ROW ===== */
.scroll-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.scroll-row::-webkit-scrollbar { height: 3px; }

/* ===== GRID ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }

/* ===== MOVIE CARD ===== */
.card {
  flex: 0 0 155px; scroll-snap-align: start;
  border-radius: 8px; overflow: hidden;
  background: #141414; cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}
.card:hover { transform: scale(1.07); box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 2; }
.card-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: #1a1a1a; }
.card-body { padding: 8px 9px 10px; }
.card-title { font-size: 12px; font-weight: 600; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 11px; color: #777; margin-top: 3px; display: flex; justify-content: space-between; }
.card-rating { color: #f5c518; font-weight: 600; }
.card-badge { position: absolute; top: 6px; left: 6px; background: #e50914; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; }
.card-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.65); opacity: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; transition: opacity 0.2s; }
.card:hover .card-overlay { opacity: 1; }

/* ===== UPCOMING CARD ===== */
.upcoming-card {
  flex: 0 0 155px; scroll-snap-align: start;
  border-radius: 8px; overflow: hidden;
  background: #141414; cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}
.upcoming-card:hover { transform: scale(1.07); box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 2; }
.upcoming-card .card-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: #1a1a1a; }
.upcoming-date-badge { position: absolute; top: 0; left: 0; background: #e50914; color: #fff; font-size: 11px; font-weight: 800; padding: 6px 8px; text-align: center; line-height: 1.2; border-radius: 0 0 8px 0; min-width: 44px; }
.upcoming-date-badge .day { font-size: 16px; display: block; }
.upcoming-card .card-body { padding: 8px 9px 10px; }
.upcoming-card .card-title { font-size: 12px; font-weight: 600; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-card .card-meta { font-size: 11px; color: #777; margin-top: 3px; }

/* ===== PLAYER PAGE ===== */
.player-page { padding-top: 64px; }
.player-wrapper { background: #000; width: 100%; aspect-ratio: 16/9; max-height: 80vh; }
.player-wrapper iframe { width: 100%; height: 100%; border: none; }
.server-bar { background: #111; padding: 12px 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid #1e1e1e; }
.server-label { color: #888; font-size: 14px; }
.server-btn { background: #1e1e1e; color: #ccc; padding: 6px 16px; border-radius: 4px; font-size: 13px; transition: all 0.2s; }
.server-btn:hover { background: #2a2a2a; color: #fff; }
.server-btn.active { background: #e50914; color: #fff; }

/* ===== EPISODE SELECTOR ===== */
.episode-section { background: #111; padding: 16px 24px; border-bottom: 1px solid #1e1e1e; }
.season-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.season-tab { background: #1e1e1e; color: #ccc; padding: 6px 18px; border-radius: 4px; font-size: 13px; cursor: pointer; transition: all 0.2s; border: none; }
.season-tab.active { background: #e50914; color: #fff; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(55px, 1fr)); gap: 8px; max-height: 180px; overflow-y: auto; }
.ep-btn { background: #1e1e1e; color: #ccc; padding: 10px 4px; border-radius: 4px; font-size: 13px; text-align: center; cursor: pointer; transition: all 0.2s; border: none; }
.ep-btn:hover { background: #2a2a2a; color: #fff; }
.ep-btn.active { background: #e50914; color: #fff; }

/* ===== MOVIE INFO BAR ===== */
.movie-info-bar { display: flex; gap: 24px; padding: 24px; max-width: 1200px; }
.movie-poster-wrap img { width: 160px; height: 240px; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.7); }
.movie-details { flex: 1; }
.movie-details h1 { font-size: clamp(20px, 2.5vw, 34px); font-weight: 800; margin-bottom: 10px; }
.meta-row { display: flex; gap: 16px; font-size: 14px; color: #aaa; margin-bottom: 12px; flex-wrap: wrap; }
.rating-star { color: #f5c518; }
.genre-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.genre-tag { background: rgba(255,255,255,0.08); color: #bbb; padding: 4px 12px; border-radius: 20px; font-size: 12px; border: 1px solid rgba(255,255,255,0.12); }
.overview { font-size: 14px; color: #bbb; line-height: 1.7; }

/* ===== LOADER ===== */
.loader { position: fixed; inset: 0; background: #0a0a0a; z-index: 9999; display: flex; align-items: center; justify-content: center; transition: opacity 0.4s; }
.loader.hidden { opacity: 0; pointer-events: none; }
.spinner { width: 46px; height: 46px; border: 4px solid #1e1e1e; border-top-color: #e50914; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
.footer { background: #0f0f0f; padding: 30px 24px; text-align: center; margin-top: 30px; border-top: 1px solid #1a1a1a; }
.footer-inner { max-width: 600px; margin: auto; }
.footer .logo { font-size: 20px; font-weight: 800; color: #e50914; margin-bottom: 8px; display: block; }
.footer p { color: #666; font-size: 13px; line-height: 1.6; }
.footer-note { color: #444; font-size: 11px; margin-top: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .search-box input { width: 160px; }
}
@media (max-width: 768px) {
  .hero { height: 70vh; }
  .hero-content { padding: 0 16px; }
  .section { padding: 14px 12px 20px; }
  .card { flex: 0 0 120px; }
  .upcoming-card { flex: 0 0 120px; }
  .movie-info-bar { flex-direction: column; padding: 16px; }
}
@media (max-width: 480px) {
  .card { flex: 0 0 105px; }
  .upcoming-card { flex: 0 0 105px; }
  .hero-btns { flex-wrap: wrap; }
  .btn-play, .btn-info { padding: 10px 18px; font-size: 14px; }
}
