/* ============================================
   WAVES Music Player — Minimal Dark Theme
   ============================================ */

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

:root {
  --bg-deep: #1a1a2e;
  --bg-panel: #16213e;
  --accent-dark: #2d6a4f;
  --accent-mid: #40916c;
  --accent-light: #52b788;
  --accent-glow: rgba(82, 183, 136, 0.3);
  --text-primary: #e0e0e0;
  --text-secondary: #8899aa;
  --text-dim: rgba(255,255,255,0.25);
  --player-radius: 16px;
  --cover-radius: 14px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 3px; }

/* ============================================
   HEADER
   ============================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
}

.header-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-light);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav-item {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: default;
}

.header-nav-item.active {
  color: var(--accent-light);
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
}

.footer-admin-link {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-admin-link:hover {
  color: var(--accent-light);
}

/* ============================================
   LAYOUT
   ============================================ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  padding-bottom: 36px;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
  min-width: 0;
  position: relative;
}

/* ============================================
   DOMAIN TAG
   ============================================ */
.domain-tag {
  position: fixed;
  bottom: 12px;
  right: 16px;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  font-weight: 300;
  pointer-events: none;
  z-index: 100;
}
.domain-tag a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}
.domain-tag a:hover {
  color: var(--accent-light);
}

/* ============================================
   LED EQUALIZER
   ============================================ */
.eq-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  flex-shrink: 0;
  margin-bottom: 28px;
  border-radius: var(--cover-radius, 14px);
  background: #0d1117;
  overflow: hidden;
}

.eq-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================
   TRACK INFO
   ============================================ */
.track-info {
  text-align: center;
  margin-bottom: 24px;
  max-width: 420px;
  width: 100%;
}

.track-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.track-artist {
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-area {
  width: 100%;
  max-width: 440px;
  margin-bottom: 20px;
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-light));
  position: relative;
  transition: width 0.1s linear;
  pointer-events: none;
}

.progress-bar-thumb {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 12px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.progress-bar-container:hover .progress-bar-thumb,
.progress-bar-container.dragging .progress-bar-thumb {
  opacity: 1;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   CONTROLS
   ============================================ */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 28px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
  outline: none;
}

.ctrl-btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
  border-radius: 50%;
}

.ctrl-btn:hover {
  color: var(--accent-light);
}

.ctrl-btn svg {
  display: block;
  fill: currentColor;
}

.btn-prev svg,
.btn-next svg {
  width: 48px;
  height: 48px;
}

.btn-play svg {
  width: 64px;
  height: 64px;
}

/* Play button glow */
.btn-play {
  border-radius: 50%;
}

.btn-play.pulsing svg {
  animation: pulse-glow 1.8s ease-in-out infinite;
}

.btn-play:hover svg {
  filter: drop-shadow(0 0 16px var(--accent-glow));
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(82, 183, 136, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(82, 183, 136, 0.5));
  }
}

/* ============================================
   VOLUME
   ============================================ */
.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 200px;
}

.volume-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: color var(--transition);
  outline: none;
}

.volume-btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.volume-btn:hover {
  color: var(--accent-light);
}

.volume-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.volume-slider-container {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.volume-slider-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-light));
  width: 70%;
  pointer-events: none;
}

.volume-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.volume-slider-container:hover .volume-slider-thumb,
.volume-slider-container.dragging .volume-slider-thumb {
  opacity: 1;
}

.volume-slider-thumb::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

/* ============================================
   PLAYLIST
   ============================================ */
.playlist-panel {
  width: 340px;
  min-width: 340px;
  background: var(--bg-panel);
  border-left: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playlist-header {
  padding: 24px 20px 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.playlist-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  height: 56px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
  min-width: 0;
}

.playlist-item:hover {
  background: rgba(255,255,255,0.04);
}

.playlist-item.active {
  background: rgba(45, 106, 79, 0.2);
}

.playlist-item.active .pl-title {
  color: var(--accent-light);
}

.playlist-item.active .pl-indicator {
  display: flex;
}

.pl-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-light);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-glow);
}

.pl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.pl-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.pl-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-duration {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding-left: 8px;
}

/* ============================================
   FADE TRANSITION
   ============================================ */
.fade-enter {
  opacity: 0;
}
.fade-enter-active {
  opacity: 1;
  transition: opacity 0.4s ease;
}
.fade-exit {
  opacity: 1;
}
.fade-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
  color: var(--text-dim);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.06);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   RESPONSIVE: 768px
   ============================================ */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .main-area {
    padding: 24px 20px 12px;
    flex: 0 1 auto;
    justify-content: flex-start;
  }

  .eq-wrapper {
    height: 100px;
  }

  .track-title {
    font-size: 19px;
  }

  .track-artist {
    font-size: 14px;
  }

  .progress-area {
    max-width: 100%;
  }

  .controls {
    gap: 20px;
    margin-bottom: 20px;
  }

  .btn-prev svg,
  .btn-next svg {
    width: 44px;
    height: 44px;
  }

  .btn-play svg {
    width: 56px;
    height: 56px;
  }

  .volume-row {
    max-width: 240px;
    margin-bottom: 8px;
  }

  .playlist-panel {
    width: 100%;
    min-width: 0;
    flex: 1;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.04);
  }

  .playlist-header {
    padding: 14px 20px 10px;
    font-size: 12px;
  }

  .domain-tag {
    bottom: 8px;
    right: 12px;
    font-size: 10px;
  }
}

/* ============================================
   RESPONSIVE: 480px
   ============================================ */
@media (max-width: 480px) {
  .main-area {
    padding: 16px 16px 8px;
  }

  .eq-wrapper {
    height: 80px;
  }

  .track-title {
    font-size: 17px;
  }

  .track-artist {
    font-size: 13px;
  }

  .controls {
    gap: 16px;
    margin-bottom: 16px;
  }

  .btn-prev svg,
  .btn-next svg {
    width: 40px;
    height: 40px;
  }

  .btn-play svg {
    width: 52px;
    height: 52px;
  }

  .volume-row {
    max-width: 100%;
    padding: 0 20px;
  }

  .playlist-item {
    height: 50px;
    padding: 0 10px;
  }

  .pl-title {
    font-size: 13px;
  }

  .pl-artist {
    font-size: 11px;
  }

  .playlist-header {
    padding: 12px 16px 8px;
  }
}

/* ============================================
   RESPONSIVE: 360px
   ============================================ */
@media (max-width: 360px) {
  .eq-wrapper {
    height: 70px;
  }

  .track-title {
    font-size: 15px;
  }

  .track-artist {
    font-size: 12px;
  }

  .controls {
    gap: 10px;
  }

  .btn-prev svg,
  .btn-next svg {
    width: 36px;
    height: 36px;
  }

  .btn-play svg {
    width: 46px;
    height: 46px;
  }

  .progress-bar-container {
    height: 8px;
  }

  .playlist-item {
    height: 46px;
    gap: 10px;
  }

  .pl-title {
    font-size: 12px;
  }

  .pl-artist {
    font-size: 10px;
  }

  .playlist-header {
    padding: 10px 14px 6px;
    font-size: 11px;
  }
}
