/* ===================================================
   48SHOWTIME — LIVE CSS
   Dark cinematic theme, red accent
   =================================================== */

:root {
  --red:       #e8193c;
  --red-dark:  #b5112c;
  --red-glow:  rgba(232,25,60,0.18);
  --bg:        #0d0d0f;
  --surface:   #161618;
  --surface-2: #1e1e22;
  --surface-3: #27272c;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);
  --text-1:    #f4f4f5;
  --text-2:    #a1a1aa;
  --text-3:    #71717a;
  --green:     #22c55e;
  --yellow:    #eab308;
  --radius:    14px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Loading ─────────────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  z-index: 9999;
  transition: opacity 0.3s;
}
#loading-screen.hide { display: none; }

.spinner-wrap { position: relative; width: 48px; height: 48px; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.spinner-logo {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: var(--red);
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-screen p { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* ── Header ──────────────────────────────────────── */
.header {
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 20px;
  height: 56px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.logo {
  font-weight: 900; font-size: 20px; letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 2px;
}
.logo em { color: var(--red); font-style: normal; }
.logo span { color: var(--text-1); }

.header-right { display: flex; align-items: center; gap: 10px; }

.member-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  padding: 4px 12px 4px 4px;
  border-radius: 40px;
  font-size: 12px; font-weight: 700; color: var(--green);
}
.chip-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--red), #ff6b42);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 800;
  overflow: hidden;
}
.chip-avatar img { width: 100%; height: 100%; object-fit: cover; }

.btn-logout {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Gate (Login / Expired) ──────────────────────── */
#gate {
  display: none; justify-content: center; align-items: center;
  min-height: 100vh; padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,25,60,0.12) 0%, transparent 65%), var(--bg);
}
#gate.show { display: flex; }

.gate-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  padding: 40px 32px 32px;
  border-radius: 20px;
  max-width: 400px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
  position: relative; overflow: hidden;
}
.gate-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.gate-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.gate-icon.lock {
  background: var(--red-glow);
  border: 1px solid rgba(232,25,60,0.3);
}
.gate-icon.lock svg { width: 28px; height: 28px; stroke: var(--red); }
.gate-icon.exp {
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
}
.gate-icon.exp svg { width: 28px; height: 28px; stroke: var(--yellow); }

.gate-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.3px;
  margin-bottom: 8px; color: var(--text-1);
}
.gate-sub {
  font-size: 13px; color: var(--text-2); margin-bottom: 28px;
  line-height: 1.6;
}

.gate-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px; font-family: inherit;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.gate-input::placeholder { color: var(--text-3); }
.gate-input:focus { outline: none; border-color: var(--red); }

.gate-err {
  display: none;
  background: rgba(232,25,60,0.08);
  border: 1px solid rgba(232,25,60,0.3);
  color: #ff6b6b;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  margin-bottom: 12px; text-align: left;
}

.btn-gate {
  width: 100%; padding: 13px;
  background: var(--red);
  color: white; border: none;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all 0.2s;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
}
.btn-gate:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-gate:active { transform: translateY(0); }
.btn-gate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-gate.ghost {
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--border-2);
}
.btn-gate.ghost:hover { color: var(--text-1); border-color: var(--border-2); background: var(--surface-2); transform: none; }

.btn-gate.gold {
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: white;
}
.btn-gate.gold:hover { filter: brightness(1.1); }

.expired-badge {
  display: inline-block;
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
  color: var(--yellow);
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 11px; font-weight: 700;
  margin-bottom: 14px;
}

/* ── Live Main ───────────────────────────────────── */
#live-main { display: none; }

.live-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
}
.live-pill {
  background: rgba(232,25,60,0.12);
  border: 1px solid rgba(232,25,60,0.3);
  color: var(--red);
  padding: 4px 10px;
  border-radius: 40px;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.live-dot {
  width: 7px; height: 7px;
  background: var(--red); border-radius: 50%;
  animation: pulse 1.2s ease infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(232,25,60,0.6); }
  50%      { opacity: 0.8; box-shadow: 0 0 0 5px rgba(232,25,60,0); }
}
.live-show-title {
  font-size: 13px; font-weight: 700; color: var(--text-2);
}

/* ── Stream Tabs ─────────────────────────────────── */
.stream-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; gap: 8px;
  flex-wrap: wrap;
}
.stab {
  padding: 7px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  border-radius: 40px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.stab:hover { color: var(--text-1); border-color: var(--border-2); }
.stab.active {
  background: var(--red); border-color: var(--red); color: white;
  box-shadow: 0 0 12px rgba(232,25,60,0.3);
}

/* ── Video Area ──────────────────────────────────── */
.video-outer {
  background: var(--bg);
  padding: 16px 20px 0;
}
.video-wrap {
  position: relative;
  max-width: 960px; margin: 0 auto;
  background: #000;
  aspect-ratio: 16/9;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
#yt-player {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}
#direct-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ── Main Content Grid ───────────────────────────── */
.live-content {
  max-width: 960px; margin: 0 auto;
  padding: 16px 20px 40px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}
@media (max-width: 768px) {
  .live-content { grid-template-columns: 1fr; }
  .live-bar, .stream-tabs { padding: 10px 14px; }
  .video-outer { padding: 10px 12px 0; }

  /* Tombol Stream 1-3 di baris pertama, Replay 1-2 di baris kedua */
  .stab-replay {
    order: 1;
  }
  /* Beri separator visual sebelum baris replay */
  .stab-replay:first-of-type,
  #stab-4 {
    margin-left: 0;
  }
  /* Pisahkan baris replay dengan border tipis di atas */
  .stream-tabs::after {
    content: '';
    width: 100%;
    order: 1;
    border-top: 1px solid var(--border);
    margin: 2px 0 0;
  }
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  padding: 13px 16px;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.irow {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.irow:last-child { border-bottom: none; }
.irow-lbl {
  font-size: 10px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.irow-val { font-size: 13px; font-weight: 700; color: var(--text-1); }

#lineup-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 16px;
}
.lineup-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 40px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  transition: border-color 0.2s;
}
.lineup-chip:hover { border-color: var(--red); color: var(--text-1); }
.lineup-chip img, .chip-init {
  width: 22px; height: 22px;
  border-radius: 50%; object-fit: cover;
}
.chip-init {
  background: linear-gradient(135deg, var(--red), #ff6b42);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: white;
}

/* ── Member Card ─────────────────────────────────── */
.mcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky; top: 72px;
}
.mcard-top {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.mcard-avt {
  width: 46px; height: 46px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), #ff6b42);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 18px;
  overflow: hidden;
}
.mcard-avt img { width: 100%; height: 100%; object-fit: cover; }
.mcard-name { font-weight: 800; font-size: 14px; color: var(--text-1); }
.mcard-phone { font-size: 11px; color: var(--text-3); margin-top: 2px; font-family: monospace; }
.mcard-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.mcard-row:last-child { border-bottom: none; }
.mcard-row a { color: var(--red); text-decoration: none; font-weight: 600; }
.mcard-row a:hover { text-decoration: underline; }
.mcard-val { font-weight: 700; font-size: 12px; }
.mcard-val.g { color: var(--green); }
.mcard-val.y { color: var(--yellow); }
.mcard-val.r { color: var(--red); }

/* ── Notice ──────────────────────────────────────── */
.notice {
  background: rgba(234,179,8,0.06);
  border: 1px solid rgba(234,179,8,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px; color: #ca8a04; line-height: 1.5;
}

/* ── YouTube Chat Iframe ─────────────────────────── */
.chat-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 480px;
  display: flex; flex-direction: column;
}
.chat-head {
  padding: 12px 16px;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 8px;
}
.chat-live-dot {
  width: 6px; height: 6px; background: var(--red);
  border-radius: 50%; animation: pulse 1.2s infinite;
}
.chat-iframe {
  flex: 1; width: 100%; border: none;
  background: var(--surface);
  /* Filter agar tema chat YouTube menyesuaikan dark background */
  filter: invert(1) hue-rotate(180deg);
}
.chat-placeholder {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  color: var(--text-3); font-size: 12px;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }
