/* --------------------------------------------------------------------------
   CHAI BREAK ☕ - Master Responsive Stylesheet
   Fluid layout for Mobile, Tablet, Laptop & Desktop screens
   -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Devanagari:wght@400;600;700&family=Outfit:wght@300;400;500;600;700&family=Yatra+One&display=swap');

:root {
  /* Color Palette - Warm Earthy Desi Tones */
  --bg-dark: #0f0a07;
  --chai-amber: #d97736;
  --chai-gold: #f3a847;
  --chai-cream: #fbf3eb;
  --chai-brown: #3d2417;
  --live-green: #22c55e;
  
  /* Glassmorphism Tokens */
  --glass-bg: rgba(18, 11, 7, 0.65);
  --glass-border: rgba(255, 235, 215, 0.16);
  --glass-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  --glass-blur: blur(20px);
  
  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hindi: 'Noto Serif Devanagari', serif;
  --font-display: 'Yatra One', 'Noto Serif Devanagari', cursive;

  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--chai-cream);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Background & Cinematic Wallpaper Canvas
   -------------------------------------------------------------------------- */
#viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wallpaper-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 15s ease-out;
  transform: scale(1.03);
  z-index: 1;
}

.wallpaper-layer.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 10, 7, 0.05) 0%, rgba(15, 10, 7, 0.35) 75%, rgba(10, 6, 4, 0.7) 100%);
  z-index: 2;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   UI Layout Containers
   -------------------------------------------------------------------------- */
.ui-overlay {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem 1.8rem;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.ui-overlay > * {
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Top Header & Desktop/Mobile Responsive Brand Section
   -------------------------------------------------------------------------- */
.top-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0.4rem;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Sleek, Small & Responsive Live Listener Badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  background: rgba(18, 11, 7, 0.45);
  border: 1px solid rgba(255, 235, 215, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  font-size: clamp(0.72rem, 1.1vw, 0.85rem);
  font-weight: 500;
  color: var(--chai-cream);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--live-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--live-green);
  animation: pulse-glow 2s infinite;
}

.pulse-dot.offline {
  background-color: #9ca3af;
  box-shadow: 0 0 6px #9ca3af;
  animation: none;
}

.presence-offline-lbl {
  font-size: clamp(0.65rem, 0.95vw, 0.76rem);
  opacity: 0.85;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Subtle Upper-Right Time Display Pill Widget */
.time-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(18, 11, 7, 0.45);
  border: 1px solid rgba(255, 235, 215, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.28rem 0.75rem;
  border-radius: 99px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.time-clock {
  font-size: clamp(0.72rem, 1.1vw, 0.88rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
}

.time-separator {
  color: rgba(243, 168, 71, 0.6);
  font-size: 0.7rem;
}

.time-greeting {
  font-family: var(--font-hindi);
  font-size: clamp(0.65rem, 0.95vw, 0.76rem);
  color: var(--chai-gold);
  opacity: 0.88;
}

/* Desktop Hero Content Layout */
.top-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 850px;
  margin-top: 0.1rem;
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ffffff 0%, #fff3e6 40%, var(--chai-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 24px rgba(243, 168, 71, 0.35), 0 8px 32px rgba(0,0,0,0.85);
  margin-bottom: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.1;
}

.chai-icon-btn {
  background: none;
  border: none;
  font-size: clamp(1.6rem, 3.8vw, 3.2rem);
  cursor: pointer;
  filter: drop-shadow(0 4px 14px rgba(217, 119, 54, 0.5));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.chai-icon-btn:hover {
  transform: scale(1.18) rotate(6deg);
}

.brand-tagline {
  font-family: var(--font-hindi);
  font-size: clamp(0.9rem, 1.4vw, 1.25rem);
  font-weight: 500;
  color: rgba(251, 243, 235, 0.95);
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  margin-bottom: 0.3rem;
}

/* Rotating Quote Container */
.quote-container {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90%;
}

.hindi-quote {
  font-family: var(--font-hindi);
  font-size: clamp(0.78rem, 1.1vw, 1rem);
  font-style: italic;
  color: var(--chai-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  padding: 0.28rem 1rem;
  background: rgba(15, 10, 7, 0.35);
  border-radius: 99px;
  border: 1px solid rgba(243, 168, 71, 0.2);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hindi-quote.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Center Spacer (100% Unobstructed Wallpaper Canvas View)
   -------------------------------------------------------------------------- */
.center-spacer {
  flex: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Bottom Dock: Player & Scene Switcher
   -------------------------------------------------------------------------- */
.bottom-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 560px;
  align-self: center;
  position: relative;
  z-index: 50;
}

/* Expandable Player Container Wrapper */
.expandable-player-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 48px;
}

/* Collapsed Floating Disc Button */
.player-collapsed-disc {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(22, 14, 10, 0.85);
  border: 1.5px solid var(--chai-gold);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 16px rgba(243, 168, 71, 0.4);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 40;
  opacity: 1;
  transform: scale(1);
  transition: var(--transition-smooth);
  touch-action: manipulation;
}

.player-collapsed-disc:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 24px rgba(243, 168, 71, 0.6);
}

.disc-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.85;
  animation: disc-rotate 18s linear infinite paused;
}

.expandable-player-wrapper.playing .disc-art {
  animation-play-state: running;
}

@keyframes disc-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.disc-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 7, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chai-gold);
  transition: var(--transition-fast);
}

.player-collapsed-disc:hover .disc-play-overlay {
  background: rgba(15, 10, 7, 0.15);
  color: #ffffff;
}

.sound-wave-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(243, 168, 71, 0.3);
  animation: pulse-ring 2.5s infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

/* Expanded Full Glass Player Panel (Floats Absolutely UPWARDS) */
.compact-player-panel {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 0.45rem 0.85rem;
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  z-index: 30;
}

/* Hover / Touch Expansion */
.expandable-player-wrapper:hover .compact-player-panel,
.expandable-player-wrapper.expanded .compact-player-panel {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.expandable-player-wrapper:hover .player-collapsed-disc,
.expandable-player-wrapper.expanded .player-collapsed-disc {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

/* Top Row inside Player */
.player-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.6rem;
}

/* Embedded Song Details */
.compact-song-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 180px;
  min-width: 120px;
  overflow: hidden;
}

.compact-album-art {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  background-color: #23160e;
  flex-shrink: 0;
}

.compact-meta-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.song-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.artist-name {
  font-size: 0.68rem;
  color: rgba(251, 243, 235, 0.65);
  margin-top: 0.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Center Playback Controls */
.center-ctrls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ctrl-btn {
  background: none;
  border: none;
  color: rgba(251, 243, 235, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: var(--transition-fast);
  touch-action: manipulation;
}

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

.ctrl-btn.play-btn {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--chai-amber) 0%, var(--chai-gold) 100%);
  color: #0f0a07;
  box-shadow: 0 4px 12px rgba(217, 119, 54, 0.4);
}

.ctrl-btn.play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(243, 168, 71, 0.6);
}

/* Right Side Controls */
.right-ctrls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.volume-slider {
  width: 55px;
}

/* Integrated Micro Progress Bar */
.progress-container {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.time-stamp {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(251, 243, 235, 0.55);
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chai-gold);
  box-shadow: 0 0 6px var(--chai-gold);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.range-slider:hover::-webkit-slider-thumb {
  transform: scale(1.3);
}

/* --------------------------------------------------------------------------
   Scene Selector Pill Bar
   -------------------------------------------------------------------------- */
.scene-selector-bar {
  position: relative;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.32rem 0.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 99px;
  box-shadow: var(--glass-shadow);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}

.scene-selector-bar::-webkit-scrollbar {
  display: none;
}

.scene-btn {
  position: relative;
  z-index: 90;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  font-size: 0.76rem;
  font-family: var(--font-hindi);
  color: rgba(251, 243, 235, 0.85);
  cursor: pointer !important;
  pointer-events: auto !important;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  touch-action: manipulation;
}

.scene-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.scene-btn.active {
  background: rgba(217, 119, 54, 0.35);
  border-color: var(--chai-gold);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* --------------------------------------------------------------------------
   Interactive Toast Notification
   -------------------------------------------------------------------------- */
.toast-msg {
  position: absolute;
  top: 8rem;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(30, 18, 12, 0.88);
  border: 1px solid var(--chai-gold);
  color: var(--chai-cream);
  font-family: var(--font-hindi);
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  font-size: 0.84rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hidden YouTube Player Iframe Container */
#youtube-player-container {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

/* --------------------------------------------------------------------------
   Media Queries & Device Specific Aspect Ratio Responsive Rules
   -------------------------------------------------------------------------- */

/* Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  .ui-overlay {
    padding: clamp(0.8rem, 2dvh, 1.4rem) clamp(0.6rem, 3vw, 1rem);
  }

  .top-header {
    gap: clamp(0.35rem, 1.8dvh, 1rem);
  }

  .live-badge {
    padding: 0.22rem 0.55rem;
    gap: 0.35rem;
    font-size: 0.7rem;
  }

  .top-hero-content {
    margin-top: clamp(1.2rem, 4.8dvh, 3.4rem);
    gap: 0.25rem;
  }

  .brand-title {
    font-size: clamp(1.65rem, 6vw, 2.2rem);
  }

  .chai-icon-btn {
    font-size: clamp(1.55rem, 5.2vw, 2rem);
  }

  .brand-tagline {
    font-size: clamp(0.82rem, 3.2vw, 0.95rem);
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
  }

  .quote-container {
    margin-top: 0.15rem;
    min-height: 26px;
  }

  .hindi-quote {
    font-size: clamp(0.74rem, 2.9vw, 0.84rem);
    padding: 0.25rem 0.85rem;
  }

  .time-widget {
    padding: 0.22rem 0.55rem;
    gap: 0.35rem;
  }

  .time-clock {
    font-size: 0.7rem;
  }

  .time-greeting {
    font-size: 0.65rem;
  }

  .bottom-dock {
    max-width: 100%;
    gap: 0.45rem;
  }

  .compact-player-panel {
    width: calc(100vw - 1.2rem);
    max-width: 420px;
    padding: 0.4rem 0.65rem;
  }

  .compact-song-details {
    max-width: 130px;
    min-width: 100px;
  }

  .compact-album-art {
    width: 28px;
    height: 28px;
  }

  .volume-wrapper {
    display: flex;
  }

  .scene-selector-bar {
    justify-content: flex-start;
    padding: 0.28rem 0.4rem;
    width: 100%;
  }

  .scene-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
  }
}

/* Tall Mobile Devices (Aspect Ratio >= 19:9, e.g. iPhone Pro Max & Galaxy S Ultra) */
@media (max-width: 640px) and (min-height: 780px) {
  .top-hero-content {
    margin-top: clamp(2rem, 6dvh, 4rem);
  }
}

/* Tablets (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .ui-overlay {
    padding: 1.2rem 1.4rem;
  }
  .top-hero-content {
    margin-top: clamp(0.6rem, 2.5dvh, 1.8rem);
  }
  .bottom-dock {
    max-width: 520px;
  }
  .brand-title {
    font-size: clamp(2.4rem, 4vw, 3rem);
  }
}

/* Large Laptop & 4K Desktop Screens (>= 1440px) */
@media (min-width: 1440px) {
  .ui-overlay {
    padding: 1.8rem 2.5rem;
  }
  .top-hero-content {
    max-width: 950px;
    margin-top: 0.1rem;
  }
  .brand-title {
    font-size: clamp(3rem, 4.2vw, 4.2rem);
  }
  .brand-tagline {
    font-size: 1.3rem;
  }
  .bottom-dock {
    max-width: 620px;
  }
  .compact-player-panel {
    padding: 0.55rem 1.1rem;
  }
}
