@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --card: #16161f;
  --accent: #e63946;
  --accent2: #ff6b6b;
  --gold: #ffd60a;
  --text: #f0f0f5;
  --text2: #9090a8;
  --text3: #5a5a72;
  --border: #2a2a3a;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10,10,15,0.98) 0%, rgba(10,10,15,0.85) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  text-shadow: 0 0 20px rgba(230,57,70,0.5);
}

.search-bar {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-bar input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 16px 8px 40px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: all 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent);
  background: var(--card);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 14px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 40px 20px 30px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(230,57,70,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,107,107,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 8vw, 64px);
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: 8px;
}

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

.hero p {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ===== SECTION ===== */
.section {
  padding: 24px 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

.see-all {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.see-all:hover { opacity: 1; }

/* ===== HORIZONTAL SCROLL ===== */
.scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }

/* ===== MOVIE CARD ===== */
.movie-card {
  flex-shrink: 0;
  width: 140px;
  cursor: pointer;
  transition: transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.movie-card:hover { transform: scale(1.04); }

.movie-card-poster {
  width: 140px;
  height: 200px;
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.movie-card-poster .poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--bg3), var(--card));
}

.movie-card-poster .poster-placeholder .icon {
  font-size: 36px;
  opacity: 0.4;
}

.movie-card-poster .vip-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ffd60a, #ff9500);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.movie-card-poster .type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--text2);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.movie-card-info {
  padding: 8px 2px 0;
}

.movie-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}

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

.movies-grid .movie-card {
  width: 100%;
}

.movies-grid .movie-card-poster {
  width: 100%;
  height: 0;
  padding-bottom: 143%;
  position: relative;
}

.movies-grid .movie-card-poster .poster-placeholder {
  position: absolute;
  inset: 0;
}

/* ===== GENRE CHIPS ===== */
.genre-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.genre-chips::-webkit-scrollbar { display: none; }

.genre-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.genre-chip:hover, .genre-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== MOVIE DETAIL ===== */
.detail-hero {
  position: relative;
  padding: 30px 20px 24px;
  overflow: hidden;
}

.detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(230,57,70,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.detail-poster-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.detail-poster {
  flex-shrink: 0;
  width: 120px;
  height: 170px;
  background: linear-gradient(135deg, var(--bg3), var(--card));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.detail-info { flex: 1; min-width: 0; }

.detail-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text2);
}

.meta-tag.accent { background: rgba(230,57,70,0.15); border-color: var(--accent); color: var(--accent); }

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.stars { color: var(--gold); font-size: 14px; }
.rating-num { font-weight: 700; font-size: 18px; }
.rating-count { color: var(--text3); font-size: 12px; }

/* ===== WATCH BUTTON ===== */
.watch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #c1121f);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(230,57,70,0.4);
  margin: 20px;
  width: calc(100% - 40px);
}

.watch-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(230,57,70,0.5); }
.watch-btn:active { transform: translateY(0); }
.watch-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.watch-btn .btn-icon { font-size: 20px; }

/* ===== DESCRIPTION ===== */
.description-block {
  padding: 0 20px 20px;
}

.description-block h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.description-block p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text2);
}

/* ===== INFO TABLE ===== */
.info-table {
  padding: 0 20px 20px;
}

.info-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 14px;
}

.info-label { color: var(--text3); width: 100px; flex-shrink: 0; }
.info-value { color: var(--text); }

/* ===== EPISODES LIST ===== */
.episodes-list {
  padding: 0 20px;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.episode-item:active { background: var(--bg3); }

.episode-num {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.episode-info { flex: 1; min-width: 0; }
.episode-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-code { font-size: 12px; color: var(--text3); margin-top: 2px; }

.episode-play {
  color: var(--accent);
  font-size: 20px;
  flex-shrink: 0;
}

/* ===== SEARCH PAGE ===== */
.search-page { padding: 16px 20px; }

.search-input-big {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  color: var(--text);
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.search-input-big:focus { border-color: var(--accent); }

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-select {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  outline: none;
}

.results-count {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 16px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: #2d6a4f; background: #1a3a2a; color: #52b788; }
.toast.error { border-color: var(--accent); background: rgba(230,57,70,0.15); color: var(--accent2); }

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.loading-overlay.show { opacity: 1; pointer-events: all; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text3); font-size: 14px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  height: 56px;
  z-index: 100;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text3);
  font-size: 10px;
  transition: color 0.2s;
}

.bottom-nav a .nav-icon { font-size: 20px; }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--accent); }

.page-content { padding-bottom: 70px; }
