/* ============================================
   StreamVault — Stylesheet
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --bg-input: #1a1a1a;
  --border-color: rgba(255,255,255,0.06);
  --border-color-hover: rgba(255,255,255,0.12);
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1a1;
  --text-muted: #666666;
  --accent-red: #ef4444;
  --accent-red-dark: #dc2626;
  --accent-red-glow: rgba(239,68,68,0.25);
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-amber-glow: rgba(245,158,11,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---------- Background Effects ---------- */
.bg-effects {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-effects .orb {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.06;
}
.bg-effects .orb-1 { width: 500px; height: 500px; background: var(--accent-red); top: -150px; right: -100px; }
.bg-effects .orb-2 { width: 400px; height: 400px; background: var(--accent-amber); bottom: -100px; left: -80px; }
.bg-effects .orb-3 { width: 600px; height: 600px; background: #7c3aed; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0.03; }

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  max-width: 1100px; width: 100%; margin: 0 auto;
}
.logo-group { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px var(--accent-red-glow);
}
.logo-icon svg { width: 22px; height: 22px; color: #fff; }
.logo-text h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.logo-text p { font-size: 12px; color: var(--text-muted); }

.admin-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-color);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  transition: var(--transition);
}
.admin-trigger:hover {
  background: rgba(255,255,255,0.08); border-color: var(--border-color-hover);
  color: var(--text-secondary);
}
.admin-trigger svg { width: 16px; height: 16px; }
.admin-trigger:hover svg { color: var(--accent-amber); }

/* ---------- Main Content ---------- */
.main-content {
  position: relative; z-index: 10; flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0 24px 40px;
}
.player-wrapper {
  width: 100%; max-width: 1100px;
}

/* ---------- Video Player Container ---------- */
.player-container {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; user-select: none;
}
/* ---------- Video Player Container ---------- */
.player-container {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; user-select: none;
}

/* Naya Display Video Class */
.player-container .display-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; z-index: 1;
}

/* Quality menu ki CSS chahe delete kar do, par padi bhi rahegi toh koi dikkat nahi */

/* Player glow */
.player-glow {
  position: absolute; inset: -4px; border-radius: 18px; z-index: -1;
  background: linear-gradient(135deg, var(--accent-red-glow), transparent, var(--accent-amber-glow));
  filter: blur(12px); opacity: 0.5; pointer-events: none;
}

/* ---------- Player Overlays ---------- */
.player-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 20; pointer-events: none;
}
.player-overlay.interactive { pointer-events: auto; }

/* Loading */
.loading-overlay { background: rgba(0,0,0,0.85); }
.loading-spinner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.spinner-ring {
  width: 48px; height: 48px; border: 3px solid rgba(239,68,68,0.15);
  border-top-color: var(--accent-red); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-overlay .label { font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 500; }

/* Buffering */
.buffering-overlay { background: rgba(0,0,0,0.4); }
.buffering-overlay .spinner-ring { width: 40px; height: 40px; }

/* Error */
.error-overlay { background: rgba(0,0,0,0.92); pointer-events: auto; }
.error-content { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px; }
.error-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(239,68,68,0.15); display: flex; align-items: center; justify-content: center;
}
.error-icon svg { width: 28px; height: 28px; color: var(--accent-red); }
.error-content h3 { font-size: 18px; font-weight: 600; }
.error-content p { font-size: 14px; color: rgba(255,255,255,0.5); max-width: 360px; }
.retry-btn {
  margin-top: 8px; padding: 10px 24px; border-radius: var(--radius-sm);
  background: var(--accent-red-dark); color: #fff; font-size: 14px; font-weight: 600;
  transition: var(--transition);
}
.retry-btn:hover { background: #b91c1c; }

/* Center play button */
.center-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 15; pointer-events: none;
}
.center-play-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.center-play-btn svg { width: 32px; height: 32px; color: #fff; margin-left: 3px; }

/* ---------- Top Bar (LIVE + Title) ---------- */
.player-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 25;
  padding: 16px; transition: opacity var(--transition);
}
.player-topbar.hidden { opacity: 0; pointer-events: none; }
.topbar-inner { display: flex; align-items: center; gap: 12px; }

.live-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; background: var(--accent-red); border-radius: 6px;
}
.live-dot {
  position: relative; width: 8px; height: 8px;
}
.live-dot::before {
  content: ''; position: absolute; inset: 0;
  background: #fff; border-radius: 50%; opacity: 0.7;
  animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite;
}
.live-dot::after {
  content: ''; position: absolute; inset: 0;
  background: #fff; border-radius: 50%;
}
.live-badge span { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: #fff; }

.player-title {
  font-size: 14px; font-weight: 600; color: #fff;
  max-width: 65%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

/* ---------- Controls Bar ---------- */
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 25;
  transition: opacity var(--transition), transform var(--transition);
}
.player-controls.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }

.controls-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  pointer-events: none;
}

.controls-inner {
  position: relative; padding: 40px 16px 14px;
}

/* Seekbar */
.seekbar-container {
  position: relative; height: 4px; margin-bottom: 12px;
  background: rgba(255,255,255,0.15); border-radius: 4px;
  overflow: hidden; cursor: default;
}
.seekbar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent-red-dark), var(--accent-red));
  border-radius: 4px; transition: width 0.5s linear;
}
.seekbar-thumb {
  position: absolute; top: 50%; width: 12px; height: 12px;
  background: #fff; border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: left 0.5s linear;
}
.seekbar-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shimmer 2.5s ease-in-out infinite;
}

/* Controls row */
.controls-row {
  display: flex; align-items: center; gap: 4px;
}
.ctrl-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: var(--transition);
}
.ctrl-btn:hover { background: rgba(255,255,255,0.1); }
.ctrl-btn svg { width: 20px; height: 20px; }

/* Volume group */
.volume-group { display: flex; align-items: center; gap: 0; }
.volume-slider-wrap {
  width: 0; overflow: hidden; display: flex; align-items: center;
  transition: width 0.3s ease;
}
.volume-group:hover .volume-slider-wrap { width: 80px; }
.volume-slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.25); outline: none; cursor: pointer;
  margin: 0 6px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 4px rgba(0,0,0,0.3); cursor: pointer;
}

.time-display {
  font-size: 12px; color: rgba(255,255,255,0.5);
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  margin-left: 4px; min-width: 50px;
}

.controls-spacer { flex: 1; }

/* Quality button */
.quality-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85);
  transition: var(--transition);
}
.quality-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.quality-btn svg { width: 16px; height: 16px; }
.quality-btn .gear-icon { opacity: 0.5; width: 14px; height: 14px; }

/* Quality menu */
.quality-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0;
  width: 160px; background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  z-index: 50; animation: fadeInUp 0.2s ease;
}
.quality-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px; font-size: 13px;
  color: rgba(255,255,255,0.7); transition: var(--transition);
}
.quality-menu-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.quality-menu-item.active { color: var(--accent-red); background: rgba(239,68,68,0.06); }
.quality-menu-item svg { width: 14px; height: 14px; margin-right: 8px; }
.quality-menu-item .active-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-red); }

/* ---------- Stream Info Section ---------- */
.stream-info {
  margin-top: 24px; display: grid; grid-template-columns: 2fr 1fr; gap: 16px;
}
.info-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 20px; transition: var(--transition);
}
.info-card:hover { border-color: var(--border-color-hover); }

.stream-details { display: flex; gap: 16px; align-items: flex-start; }
.stream-icon {
  width: 52px; height: 52px; border-radius: var(--radius); flex-shrink: 0;
  background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04));
  border: 1px solid rgba(239,68,68,0.1);
  display: flex; align-items: center; justify-content: center;
}
.stream-icon svg { width: 24px; height: 24px; color: var(--accent-red); }
.stream-meta { flex: 1; min-width: 0; }
.stream-meta h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-meta p { font-size: 13px; color: var(--text-muted); }
.stream-badges { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.stream-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
}
.stream-badge.live { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--accent-red); }
.stream-badge.stat { color: var(--text-muted); }
.stream-badge svg { width: 14px; height: 14px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-color-hover); }
.stat-card svg { width: 20px; height: 20px; margin-bottom: 8px; }
.stat-card .value { font-size: 18px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 10;
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-inner p { font-size: 12px; color: var(--text-muted); }
.footer-link {
  font-size: 12px; color: var(--text-muted);
  transition: var(--transition); cursor: pointer;
}
.footer-link:hover { color: var(--text-secondary); }

/* ---------- Admin Panel ---------- */
.admin-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s ease;
}
.admin-backdrop.open { display: flex; }

.admin-panel {
  position: relative; width: 100%; max-width: 440px;
  background: #181818; border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: scaleIn 0.3s ease;
}

.admin-header {
  position: relative; padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, #181818, #1c1c1c);
}
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; }
.admin-header-info { display: flex; align-items: center; gap: 12px; }
.admin-header-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-amber), #d97706);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--accent-amber-glow);
}
.admin-header-icon svg { width: 20px; height: 20px; color: #fff; }
.admin-header-text h2 { font-size: 16px; font-weight: 700; }
.admin-header-text p { font-size: 11px; color: var(--text-muted); }
.admin-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition);
}
.admin-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-close svg { width: 18px; height: 18px; }

.admin-body { padding: 24px; }

/* Login form */
.login-visual { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0; }
.login-icon {
  width: 60px; height: 60px; border-radius: var(--radius-lg);
  background: #222; border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
}
.login-icon svg { width: 28px; height: 28px; color: var(--accent-amber); }
.login-visual h3 { font-size: 16px; font-weight: 600; }
.login-visual p { font-size: 13px; color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.input-wrapper {
  position: relative; display: flex; align-items: center;
}
.input-wrapper svg.input-icon {
  position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-muted);
  pointer-events: none;
}
.input-wrapper input, .input-wrapper textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border-color);
  color: #fff; font-size: 14px; outline: none; transition: var(--transition);
}
.input-wrapper input:focus, .input-wrapper textarea:focus {
  border-color: rgba(245,158,11,0.4);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.08);
}
.input-wrapper input.with-icon { padding-left: 36px; }
.input-wrapper .toggle-pw {
  position: absolute; right: 10px; color: var(--text-muted);
  transition: var(--transition); padding: 4px;
}
.input-wrapper .toggle-pw:hover { color: var(--text-secondary); }
.input-wrapper .toggle-pw svg { width: 16px; height: 16px; }
.input-wrapper textarea { resize: none; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; padding: 10px 12px; }

.form-message {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 13px;
}
.form-message.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--accent-emerald); }
.form-message.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--accent-red); }
.form-message svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  width: 100%; padding: 12px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-amber), #d97706);
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-amber-glow);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary svg { width: 16px; height: 16px; }

.btn-secondary {
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted); transition: var(--transition);
  margin-top: 8px;
}
.btn-secondary:hover { color: var(--text-secondary); }

.auth-success {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 20px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);
  font-size: 13px; color: var(--accent-emerald);
}
.auth-success svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-header { padding: 14px 16px; }
  .logo-icon { width: 38px; height: 38px; }
  .logo-icon svg { width: 18px; height: 18px; }
  .logo-text h1 { font-size: 17px; }
  .admin-trigger span { display: none; }
  .main-content { padding: 0 16px 24px; }
  .stream-info { grid-template-columns: 1fr; }
  .player-topbar { padding: 12px; }
  .player-title { font-size: 13px; max-width: 55%; }
  .controls-inner { padding: 32px 12px 10px; }
  .time-display { display: none; }
  .quality-btn .quality-label { display: none; }
  .center-play-btn { width: 60px; height: 60px; }
  .center-play-btn svg { width: 26px; height: 26px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stream-details { gap: 12px; }
  .stream-icon { width: 44px; height: 44px; }
}

/* ---------- Swap UI: Alternate Stream Card ---------- */
.alt-stream-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: var(--transition);
}
.alt-stream-card:hover {
  border-color: var(--accent-amber);
  background: rgba(245,158,11,0.05);
  transform: translateY(-2px);
}
.alt-stream-left {
  display: flex; align-items: center; gap: 12px;
}
.alt-stream-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
}
.alt-stream-icon svg { width: 16px; height: 16px; color: var(--text-secondary); }
.alt-stream-card:hover .alt-stream-icon svg { color: var(--accent-amber); }

.alt-stream-info h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.alt-stream-info p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.swap-btn {
  font-size: 11px; font-weight: 700; color: var(--accent-amber);
  background: rgba(245,158,11,0.1); padding: 4px 10px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}