/* public/css/style.css
   StreamHub - dark mode, mobile-first, animasi ringan */

:root {
  --bg: #0b0c10;
  --bg-elevated: #14151c;
  --bg-card: #181a23;
  --border: #262836;
  --text: #e9e9ef;
  --text-dim: #9a9db0;
  --accent: #ff3860;
  --accent-hover: #ff5578;
  --accent-soft: rgba(255, 56, 96, 0.12);
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --max-width: 1280px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.main-nav {
  display: none;
  gap: 20px;
  margin-left: 12px;
}
.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text);
  border-color: var(--accent);
}

.header-search {
  flex: 1;
  max-width: 420px;
  margin-left: auto;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.header-search input:focus { border-color: var(--accent); }
.header-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.mobile-menu-btn {
  display: inline-flex;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
}

@media (min-width: 860px) {
  .main-nav { display: flex; }
  .mobile-menu-btn { display: none; }
}

/* ===== Hero ===== */
.hero {
  padding: 28px 0 8px;
}
.hero h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}
.hero p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.92rem;
}

/* ===== Category chips ===== */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chip:hover, .chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Section ===== */
.section {
  padding: 20px 0;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h2 {
  font-size: 1.1rem;
  margin: 0;
}
.section-title a {
  font-size: 0.82rem;
  color: var(--accent);
}

/* ===== Video grid ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 620px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .video-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1180px) {
  .video-grid { grid-template-columns: repeat(5, 1fr); }
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: fadeIn 0.35s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #10111a;
  overflow: hidden;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-info { padding: 10px; }
.video-info h3 {
  font-size: 0.86rem;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ===== Skeleton loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #20222e 37%, var(--bg-card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
.skeleton-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.skeleton-thumb { width: 100%; aspect-ratio: 16/9; }
.skeleton-line { height: 10px; margin: 10px 10px 0; border-radius: 4px; }
.skeleton-line.short { width: 60%; margin-bottom: 10px; }

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Loader / infinite scroll ===== */
.loader-row { display: flex; justify-content: center; padding: 24px 0; color: var(--text-dim); font-size: 0.85rem; }
.spinner {
  width: 22px; height: 22px;
  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: 48px 16px;
  color: var(--text-dim);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ===== Watch page ===== */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 16px 0 40px;
}
@media (min-width: 980px) {
  .watch-layout { grid-template-columns: 2.1fr 1fr; align-items: start; }
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.watch-title { font-size: 1.2rem; margin: 16px 0 6px; }
.watch-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 12px;
}
.watch-meta-row .cat-tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.watch-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.watch-desc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
}

.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-card {
  display: flex;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.related-card:hover { border-color: var(--accent); }
.related-thumb { width: 140px; flex-shrink: 0; aspect-ratio: 16/9; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info { padding: 8px 10px 8px 0; min-width: 0; }
.related-info h4 {
  font-size: 0.82rem;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-info span { font-size: 0.72rem; color: var(--text-dim); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
}

/* ===== 404 ===== */
.not-found {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.not-found h1 { font-size: 4rem; margin: 0; color: var(--accent); }
.not-found p { color: var(--text-dim); margin: 8px 0 20px; }

/* ===== Sponsor card ===== */
.sponsor-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 56, 96, 0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ===== Site menu dropdown (titik-3) ===== */
.site-menu-dropdown {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 180px;
}
.site-menu-dropdown.show { display: flex; }
.site-menu-dropdown a {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
}
.site-menu-dropdown a:hover { background: var(--bg-card); }

/* ===== Ad slot ===== */
.ad-slot {
  margin: 16px 0;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}
.ad-slot:empty { margin: 0; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0; flex-wrap: wrap; }
.pagination button {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.pagination button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
