/* ============================================================
   Zubeen Garg Assamese Music Streaming Web App - Bus Driver Edition
   Senior Developer Red Sunset & Road Driving Recreation
   ============================================================ */

:root {
  /* Dark Crimson Red Theme Palette */
  --bg-primary: #120303;
  --bg-secondary: #220606;
  --bg-glass: rgba(30, 8, 8, 0.82);
  --bg-glass-hover: rgba(50, 12, 12, 0.92);
  --border-glass: rgba(225, 29, 72, 0.35);
  --border-gold: rgba(251, 191, 36, 0.4);
  --text-main: #ffffff;
  --text-sub: #fda4af;
  --text-muted: #9f1239;
  --accent-crimson: #e11d48;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-gold: #fbbf24;
  --accent-glow: rgba(225, 29, 72, 0.45);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-pill: 40px;
  --radius-lg: 24px;
  --radius-md: 14px;
  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #2d0707;
  --bg-secondary: #450a0a;
  --bg-glass: rgba(45, 7, 7, 0.88);
  --bg-glass-hover: rgba(69, 10, 10, 0.95);
  --border-glass: rgba(244, 63, 94, 0.4);
  --text-main: #ffffff;
  --text-sub: #fecdd3;
  --text-muted: #be123c;
  --accent-crimson: #f43f5e;
  --accent-rose: #fb7185;
  --accent-amber: #fbbf24;
  --accent-gold: #fde047;
  --accent-glow: rgba(244, 63, 94, 0.4);
  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Background Bus Canvas & Road Container */
.canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

#bgCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  justify-content: space-between;
}

/* Top Navbar */
.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.5rem;
  z-index: 10;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--accent-crimson);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand-info span {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  display: block;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-right-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-clock {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-main);
  font-family: monospace;
}

.status-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.btn-driver-pill {
  background: rgba(225, 29, 72, 0.3);
  border: 1px solid var(--accent-crimson);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  backdrop-filter: blur(8px);
}

.btn-driver-pill:hover {
  background: var(--accent-crimson);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-2px);
}

/* Center Screen Hero Title */
.hero-center-container {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-meta-top {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}

.hero-title {
  font-size: 4.8rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 40px rgba(225, 29, 72, 0.5);
  line-height: 1;
}

.hero-subtitle {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  margin-top: 4px;
}

.btn-horn-ok {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  backdrop-filter: blur(10px);
}

.btn-horn-ok:hover {
  background: var(--accent-crimson);
  border-color: var(--accent-rose);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.05);
}

/* Center Bus Driving Stage */
.bus-driving-stage {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 950px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.bus-sprite-frame {
  position: relative;
  width: 780px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: busRumble 0.4s infinite alternate ease-in-out;
}

@keyframes busRumble {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-3px); }
}

.bus-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.8));
}

/* Headlights Beam Cone Effect */
.bus-headlights-beam {
  position: absolute;
  right: -120px;
  top: 42%;
  width: 260px;
  height: 140px;
  background: polygon(0 40%, 100% 0, 100% 100%, 0 60%);
  background: linear-gradient(90deg, rgba(254, 240, 138, 0.6) 0%, rgba(254, 240, 138, 0) 100%);
  clip-path: polygon(0% 30%, 100% 0%, 100% 100%, 0% 70%);
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.85;
}

/* Crimson Red Taillight Glow */
.bus-taillight-glow {
  position: absolute;
  left: -20px;
  top: 50%;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.9) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(12px);
  pointer-events: none;
}

/* Bottom Centered Floating Player Widget */
.floating-player-wrapper {
  position: fixed;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  padding: 0 1rem;
}

.player-pill-card {
  width: 100%;
  background: rgba(18, 4, 4, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(225, 29, 72, 0.25);
  backdrop-filter: blur(20px);
}

.vinyl-thumb-container {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.vinyl-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.vinyl-img.playing {
  animation: spinVinyl 8s linear infinite;
}

@keyframes spinVinyl {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.player-info-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.song-title-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.timeline-pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
}

.time-stamp {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  min-width: 34px;
  font-family: monospace;
}

.progress-track {
  flex: 1;
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-crimson), #f59e0b);
  border-radius: 10px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-slider {
  position: absolute;
  top: -6px;
  left: 0;
  width: 100%;
  height: 16px;
  opacity: 0;
  cursor: pointer;
}

/* Player Action Buttons */
.player-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-ctrl-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ctrl-icon:hover {
  color: var(--accent-rose);
  transform: scale(1.15);
}

.btn-play-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.3);
  transition: var(--transition-fast);
}

.btn-play-circle:hover {
  transform: scale(1.1);
  background: #f8fafc;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.5);
}

/* Keyboard Helpers Bar Underneath */
.keyboard-shortcuts-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.key-chip {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.key-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ffffff;
  font-family: monospace;
  font-size: 0.65rem;
}

/* Queue Drawer (Slide-in Sidebar) */
.queue-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: rgba(18, 4, 4, 0.94);
  border-left: 1px solid var(--border-glass);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.queue-drawer.active {
  right: 0;
}

.queue-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-drawer {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
}

.queue-track-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.queue-item:hover {
  background: rgba(225, 29, 72, 0.15);
  border-color: var(--border-glass);
}

.queue-item.active {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.25), rgba(245, 158, 11, 0.15));
  border-color: var(--accent-crimson);
}

.queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.queue-meta h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.queue-meta p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Modals Overlay */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.custom-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #1e0505;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 540px;
  max-width: 90vw;
  max-height: 85vh;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: var(--card-shadow);
  position: relative;
  text-align: center;
}

.btn-close-modal {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Ticket Styling */
.ticket-card {
  border: 2px dashed var(--accent-crimson);
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(225, 29, 72, 0.08);
  margin-top: 1rem;
}

.ticket-header {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 1px;
}

/* YouTube Hidden Frame */
#ytPlayerFrame {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  left: -9999px;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }

  .bus-driving-stage {
    height: 280px;
  }

  .bus-sprite-frame {
    width: 100%;
  }

  .floating-player-wrapper {
    max-width: 94vw;
  }

  .player-pill-card {
    padding: 0.6rem 1rem;
  }
}
