/* --- 1. Base Setup & Background --- */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; 
  background-color: #000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stage {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 3s ease-in-out;
}

.scene-art.is-visible {
  opacity: 1;
}

/* --- 2. Top Header Styles --- */
.top-header {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  padding: 0 40px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none; 
}

.top-header > * {
  pointer-events: auto; 
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.time-badge, .status-badge, .icon-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.8s ease;
}

.time-badge {
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  min-width: 145px;
  text-align: center;
}

.status-badge {
  padding: 10px 24px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.online-dot {
  width: 8px;
  height: 8px;
  background-color: #00d26a;
  border-radius: 50%;
  box-shadow: 0 0 8px #00d26a;
}

.online-text, .countdown-text {
  font-size: 14px;
  font-weight: 500;
}

.divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
}

.header-right {
  display: flex;
  gap: 12px;
}

.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, border-color 0.8s ease, background-color 0.8s ease;
}

.icon-badge:hover {
  background: rgba(255, 255, 255, 0.2);
}

.icon-badge:active {
  transform: scale(0.95);
}

/* --- 3. Floating Music Player Styles --- */
.player-wrapper {
  position: absolute;
  bottom: 20px; 
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 90%;
  max-width: 650px;
  min-height: 140px; 
}

/* 🌟 THE GLITCH FIX: Permanent invisible hit zone 🌟 */
.hover-hitbox {
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 180px; 
  z-index: 1;
}

/* THE CUSTOM AGOMONI IMAGE */
.player-trigger-icon {
  position: absolute;
  bottom: -100px;
  width: 600px; 
  height: auto;
  z-index: 2;
  
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 1;
  transform: translateY(0) scale(1);
  mix-blend-mode: screen; 
  pointer-events: none; 
  
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* THE CONTAINER HOLDING THE PLAYER AND BADGES */
.player-ui-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  transform-origin: bottom center;
  position: relative;
  z-index: 3;
}

/* 🌟 THE HOVER MAGIC 🌟 */
.player-wrapper:hover .player-trigger-icon {
  opacity: 0;
  transform: translateY(-10px) scale(0.8);
}

.player-wrapper:hover .player-ui-container {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.badge-row {
  display: flex;
  gap: 10px;
}

.ui-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.8s ease; 
}

.ui-badge:hover {
  background: rgba(255, 255, 255, 0.2);
}

.music-bar {
  background: rgba(30, 30, 30, 0.3); 
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  align-items: center;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  gap: 16px;
  box-sizing: border-box;
  transition: all 0.8s ease; 
}

.cover-art {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.track-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-title {
  color: #fff;
  font-size: 16px;
  margin: 0 0 2px 0;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.track-artist {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  margin: 0 0 10px 0;
}

.progress-bar {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
}

.time-display {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  margin-top: 6px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-btn:hover {
  opacity: 1;
}

.play-btn {
  background-color: #fff;
  color: #000;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  padding: 0;
  box-shadow: 0 4px 15px rgba(255,255,255,0.2);
}

.play-btn:active {
  transform: scale(0.95);
}

/* --- 4. Glassmorphic Volume Control --- */
.volume-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1); 
  border-radius: 50px;
  padding: 4px;
  margin-left: 12px;
  width: 36px; 
  height: 36px;
  overflow: hidden; 
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

.volume-container:hover {
  width: 120px; 
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.volume-btn {
  min-width: 26px; 
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.volume-slider {
  width: 70px;
  margin-left: 8px;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.4);
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.volume-container:hover .volume-slider {
  opacity: 1;
  transition-delay: 0.1s; 
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* --- 5. Playlist Modal Styles --- */
.playlist-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.playlist-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  width: 90%;
  max-width: 550px;
  height: 80vh;
  max-height: 700px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.playlist-modal.is-open .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
}

.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  letter-spacing: 2px;
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.close-btn:hover {
  color: #fff;
}

.modal-tabs {
  display: flex;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 12px 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: #fff;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

.tab-desc {
  padding: 16px 24px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.track-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0 12px 24px;
}

.track-list::-webkit-scrollbar {
  width: 6px;
}
.track-list::-webkit-scrollbar-track {
  background: transparent;
}
.track-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.track-index {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 500;
  width: 24px;
  text-align: center;
}

.track-item-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.track-item-info {
  flex-grow: 1;
}

.track-item-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.track-item-artist {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin: 0;
}

.track-item-duration {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  padding-right: 12px;
}

.track-item.is-playing .track-item-title,
.track-item.is-playing .track-index {
  color: #f7b432;
}

/* --- 6. MAHALAYA DAWN THEME --- */

body.mahalaya-theme .time-badge {
  background-color: rgba(15, 23, 36, 0.95);
  border: 1px solid rgba(255, 60, 60, 0.2);
}

body.mahalaya-theme .status-badge {
  background-color: rgba(10, 15, 25, 0.85);
}

body.mahalaya-theme .ui-badge {
  background-color: rgba(163, 27, 27, 0.85);
}

body.mahalaya-theme .ui-badge:hover {
  background-color: rgba(193, 37, 37, 0.95);
}

body.mahalaya-theme .music-bar {
  background-color: rgba(15, 23, 36, 0.95);
}

body.mahalaya-theme .track-item.is-playing .track-item-title,
body.mahalaya-theme .track-item.is-playing .track-index {
  color: #ff4d4d;
}