:root {
  --bg-primary: #080a10;
  --bg-secondary: #0f121a;
  --bg-card: rgba(22, 27, 38, 0.7);
  --bg-card-hover: rgba(29, 36, 50, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.35);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-primary: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-live: #ef4444;
  --accent-live-glow: rgba(239, 68, 68, 0.35);
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-cinema: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 40px rgba(99, 102, 241, 0.12);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient dynamic glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
}

.glow-top {
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.05) 70%, transparent 100%);
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
}

.glow-bottom {
  width: 500px;
  height: 350px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, rgba(99, 102, 241, 0.04) 60%, transparent 100%);
  bottom: -100px;
  right: -50px;
}

.site-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.stream-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pulse-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 12px var(--accent-live);
  animation: pulse-ring 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.65;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge.live {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.live .dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #ef4444;
}

.status-badge.upcoming {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-badge.upcoming .dot {
  width: 7px;
  height: 7px;
  background: #f59e0b;
  border-radius: 50%;
}

.status-badge.offline {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.25);
}
.status-badge.offline .dot {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.user-tag {
  color: #a5b4fc;
  font-weight: 500;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-text:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Announcement Banner */
.announcement-banner {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease-out;
}

.announcement-icon {
  font-size: 1.2rem;
}

.announcement-banner p {
  color: #e0e7ff;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Player Wrapper */
.player-outer-wrapper {
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-cinema);
  border: 1px solid var(--border-color);
  margin-bottom: 36px;
  transition: border-color 0.3s ease;
  position: relative;
}

.player-outer-wrapper:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.player-aspect-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #020305;
}

/* Video & Embed elements */
.embed-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.embed-container iframe,
.embed-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* Overlays (Auth, Offline, Standby) */
.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #131722 0%, #080a10 100%);
  z-index: 10;
  padding: 24px;
  text-align: center;
}

.overlay-content {
  max-width: 450px;
}

.overlay-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.overlay-content h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.overlay-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.loading-bar {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.bar-pulse {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 4px;
  animation: sweep 1.8s infinite ease-in-out;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* Auth Gate Card */
.auth-gate-overlay {
  background: radial-gradient(circle at center, rgba(30, 36, 52, 0.95) 0%, rgba(8, 10, 16, 0.98) 100%);
  backdrop-filter: blur(12px);
}

.auth-card {
  max-width: 380px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: scaleUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.auth-icon-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  margin: 0 auto 16px;
}

.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group input {
  width: 100%;
  background: rgba(8, 10, 16, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  text-align: center;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7174f4 0%, #5a52eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.auth-footnote {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 0.76rem;
}

/* Cinema Player Dedicated Toolbar (Placed below video, never blocking player buttons) */
.player-toolbar {
  width: 100%;
  padding: 12px 18px;
  background: #0c0f18;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toolbar-right {
  display: flex;
  align-items: center;
}

.audio-tip-text {
  font-size: 0.8rem;
  color: #34d399;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
}

.live-pill {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.03);
}

/* Fullscreen state */
.player-outer-wrapper:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000;
}

.player-outer-wrapper:fullscreen .player-aspect-container {
  width: 100vw !important;
  height: 100vh !important;
  padding-top: 0 !important;
}

/* WebKit fullscreen (Safari/Chrome) */
.player-outer-wrapper:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}
.player-outer-wrapper:-webkit-full-screen .player-aspect-container {
  width: 100vw !important;
  height: 100vh !important;
  padding-top: 0 !important;
}

/* Guide Cards */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
}

.guide-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.guide-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #f3f4f6;
}

.guide-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

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

.admin-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.admin-link:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .site-wrapper {
    padding: 16px 12px 32px;
  }
  .stream-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  .header-brand h1 {
    font-size: 1.25rem;
  }
  .auth-card {
    padding: 24px 18px;
  }
  .control-label {
    display: none;
  }
}
