/* =============================================
   DRACINHUB — PREMIUM STREAMING THEME
   Dark cinematic aesthetic, Bebas Neue display
   ============================================= */

:root {
  --bg: #070b14;
  --bg2: #0d1424;
  --bg3: #111929;
  --card: #111929;
  --card-hover: #17213a;
  --accent: #e63946;
  --accent2: #ff6b6b;
  --gold: #f4c430;
  --text: #e8eaf0;
  --text-muted: #7a8aaa;
  --border: rgba(255,255,255,0.07);
  --glow: rgba(230,57,70,0.4);
  --radius: 12px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===========================
   SCROLLBAR
=========================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(7,11,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 2px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s;
}
.logo:hover { color: var(--accent); }
.logo-icon { color: var(--accent); font-size: 1.3rem; }

.search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
#search {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 9px 16px 9px 38px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search::placeholder { color: var(--text-muted); }
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.15);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg3); }

/* ===========================
   HERO
=========================== */
.hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 60px 24px 50px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 60% 50%, rgba(230,57,70,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(100,30,200,0.1) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  animation: fadeUp 0.7s ease both;
}

.hero-badge {
  display: inline-block;
  background: rgba(230,57,70,0.2);
  border: 1px solid rgba(230,57,70,0.4);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 14px;
}

.hero-accent {
  color: var(--accent);
  display: block;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.3rem; font-weight: 700; color: #fff; }
.stat span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-div { width: 1px; height: 32px; background: var(--border); }

/* ===========================
   GENRE BAR
=========================== */
.genre-bar {
  display: flex;
  gap: 8px;
  padding: 0 24px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.genre-bar::-webkit-scrollbar { display: none; }

.genre-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.genre-tag:hover, .genre-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===========================
   SECTION HEAD
=========================== */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 24px 24px 12px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: #fff;
}
.section-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================
   LOADING
=========================== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  color: var(--text-muted);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================
   GRID
=========================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 8px 24px 32px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
  animation: fadeUp 0.5s ease both;
}
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--bg3);
  transition: opacity 0.3s;
}
.card img[src=""] { opacity: 0; }

.title {
  padding: 10px 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   DETAIL PAGE
=========================== */
.detail-wrap {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 24px;
  align-items: start;
  animation: fadeUp 0.4s ease both;
}

.poster img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  border: 1px solid var(--border);
}

.info button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s, border-color 0.2s;
}
.info button:hover { background: var(--accent); border-color: var(--accent); }

.info h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 10px;
}

.info p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.synopsis {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-top: 14px;
  max-height: 140px;
  overflow: hidden;
  position: relative;
}
.synopsis::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--bg));
}

/* ===========================
   EPISODE LIST
=========================== */
.episodes {
  padding: 0 24px 32px;
}
.episodes h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 1px;
  margin-bottom: 14px;
  color: #fff;
}

.ep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ep {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.ep:hover, .ep.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--glow);
}

/* ===========================
   PLAYER
=========================== */
.player {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px 24px;
}
.player h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 1px;
  margin-bottom: 14px;
  color: #fff;
}

.player-box {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  border: 1px solid var(--border);
}
.player-box iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border: 0;
}

.server {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.server button {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 8px 18px;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s;
}
.server button:hover, .server button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===========================
   SEO KEYWORD SECTION
=========================== */
.seo-section {
  padding: 32px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
.seo-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 16px;
}

.keyword-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.keyword-grid .card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  animation: none;
}
.keyword-grid .card:hover {
  background: rgba(230,57,70,0.15);
  border-color: var(--accent);
  color: var(--accent2);
  transform: none;
  box-shadow: none;
}

/* ===========================
   SEO TEXT
=========================== */
.seo-text {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.seo-text-inner {
  max-width: 860px;
  margin: 0 auto;
}
.seo-text h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 16px;
}
.seo-text p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 12px;
}
.seo-text strong { color: var(--text); font-weight: 600; }

/* ===========================
   FOOTER
=========================== */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 36px 24px;
  text-align: center;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-copy { color: var(--text-muted); font-size: 13px; }
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-disclaimer {
  color: #3a4a66;
  font-size: 12px;
}

/* ===========================
   EXTERNAL SERVER NOTICE
=========================== */
.ext-notice {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #070b14;
  padding: 24px;
  text-align: center;
}
.ext-icon { font-size: 3rem; }
.ext-notice p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
}
.ext-notice small {
  color: #3a4a66;
  font-size: 12px;
}
.btn-open {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.btn-open:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

.server-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 4px;
}
.server-hint strong { color: var(--text); }

/* ===========================
   POSTER PLACEHOLDER
=========================== */
.poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg3);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-align: center;
  gap: 10px;
}
.poster-placeholder small {
  font-size: 11px;
  padding: 0 12px;
  line-height: 1.4;
}

/* ===========================
   PLAYER NOTICE
=========================== */
.player-notice {
  background: rgba(244, 196, 48, 0.08);
  border: 1px solid rgba(244, 196, 48, 0.25);
  color: #b8a060;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.player-notice a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.player-notice a:hover { text-decoration: underline; }

/* ===========================
   ANIMATION
=========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .hero { padding: 40px 16px 32px; min-height: auto; }
  .hero h1 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 8px 12px 24px; }
  .detail-wrap { grid-template-columns: 1fr; }
  .poster { max-width: 200px; }
  .genre-bar, .section-head, .episodes, .seo-section, .seo-text, .player { padding-left: 12px; padding-right: 12px; }
  .section-head { padding-top: 16px; }
}