/* ===================================================================
   Shree Ambaji Mata Mandir - 24x7 Live Stream Portal
   Ultra-Clean, High-Performance, Mobile-Optimized Design
   =================================================================== */

:root {
  --bg-main: #07060a;
  --bg-surface: #100e17;
  --bg-surface-elevated: #171421;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(245, 158, 11, 0.25);
  
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --live-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

html, body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Header */
.site-header {
  padding: 0.9rem 1.25rem;
  background: rgba(10, 8, 14, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-emblem {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.brand-info h1 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1.2;
}

.brand-info p {
  font-size: 0.76rem;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Viewer Counters & Live Badges */
.stats-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.badge-live {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.pulsing-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--live-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--live-red);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.badge-viewers {
  color: #e2e8f0;
}

.badge-viewers strong {
  color: var(--gold-light);
  font-family: monospace;
  font-size: 0.85rem;
}

.badge-total {
  color: var(--text-muted);
}

.badge-total span {
  color: var(--text-main);
  font-family: monospace;
}

.badge-bell {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--gold-light);
}

.badge-bell strong {
  color: #fff;
  font-family: monospace;
  font-size: 0.85rem;
}

/* Main Layout */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Player Frame */
.player-card {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-accent);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(245, 158, 11, 0.1);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
}

#darshanVideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* Loading / Offline Overlay */
.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 6, 10, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 20;
  transition: opacity 0.3s ease;
}

.player-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.overlay-msg {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}

.btn-retry {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-retry:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* Minimal Player Controls Bar */
.player-controls {
  background: var(--bg-surface);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  gap: 0.5rem;
  width: 100%;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.42rem 0.68rem;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap !important;
  flex-shrink: 0;
  user-select: none;
}

.ctrl-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.stream-hd-tag {
  font-size: 0.72rem;
  color: var(--gold-light);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 5px;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.cloud-stream-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.btn-bell {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: var(--gold-light) !important;
  font-weight: 600;
}

.btn-bell:hover {
  background: rgba(245, 158, 11, 0.3) !important;
  transform: scale(1.03);
}

.btn-bell:active {
  transform: scale(0.97);
}

/* Toast */
.toast-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #171421;
  border: 1px solid var(--border-accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 100;
  transform: translateY(60px);
  opacity: 0;
  transition: all 0.25s ease;
}

.toast-bar.show {
  transform: translateY(0);
  opacity: 1;
}

/* Subtle Footer Credit */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 0.85rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-credit a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--gold-light);
}

.sep {
  opacity: 0.4;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .site-header {
    padding: 0.6rem 0.8rem;
  }
  
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .brand-wrapper {
    justify-content: flex-start;
  }
  
  .stats-group {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
  }

  .stats-group::-webkit-scrollbar {
    display: none;
  }
  
  .badge-pill {
    padding: 0.26rem 0.5rem;
    font-size: 0.72rem;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .main-content {
    padding: 0.5rem 0.4rem;
  }
  
  .player-card {
    border-radius: 12px;
  }
  
  .player-controls {
    padding: 0.45rem 0.5rem;
    justify-content: space-between;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .player-controls::-webkit-scrollbar {
    display: none;
  }

  .controls-left, .controls-right {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .ctrl-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.74rem;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .stream-hd-tag {
    font-size: 0.66rem;
    padding: 0.2rem 0.38rem;
    white-space: nowrap !important;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .ctrl-btn {
    padding: 0.32rem 0.42rem;
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .btn-lbl-photo {
    display: none;
  }
  
  .btn-lbl-full {
    display: none;
  }
}

/* Automatic Mobile Landscape Fullscreen */
.player-card.mobile-landscape-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 999999 !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  background: #000 !important;
}

.player-card.mobile-landscape-fullscreen .video-wrapper {
  padding-top: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
}

.player-card.mobile-landscape-fullscreen #darshanVideo,
.player-card.mobile-landscape-fullscreen .cloud-stream-iframe {
  height: 100vh !important;
  width: 100vw !important;
  object-fit: contain !important;
}

.player-card.mobile-landscape-fullscreen .player-controls {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent) !important;
  border-top: none !important;
  z-index: 50 !important;
  opacity: 0.85;
}


