/* Claudio FM — Flat minimal, pure black, monospace */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Eliminate 300ms tap delay on mobile */
a, button, [role="button"], .play-btn, .next-btn, .like-btn, .nav-item, .initial-prompt button, .mic-btn {
  touch-action: manipulation;
}

:root {
  --bg: #0a0a0a;
  --fg: #ffffff;
  --fg-dim: #666666;
  --fg-muted: #999999;
  --accent: #a78bfa;
  --accent-dim: rgba(34, 197, 94, 0.15);
  --border: #1a1a1a;
  --surface: #111111;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App shell */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Header */
.header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.on-air {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 1px;
}

.on-air-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.on-air.offline .on-air-dot {
  background: var(--fg-dim);
  animation: none;
}

.on-air.offline {
  color: var(--fg-dim);
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.clock {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 300;
}

/* Navigation tabs */
.nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: color 0.2s;
}

.nav-tab:hover {
  color: var(--fg-muted);
}

.nav-tab.active {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
}

/* Page container */
.page {
  flex: 1;
  overflow-y: auto;
  display: none;
}

.page.active {
  display: flex;
  flex-direction: column;
}

/* Player page */
.player-page {
  padding: 0;
}

/* Status bar */
.status-bar {
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border);
}

/* Now playing */
.now-playing {
  padding: 32px 20px 24px;
  text-align: center;
}

.now-playing-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.song-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  word-break: break-word;
  min-height: 28px;
}

.artist-name {
  font-size: 14px;
  color: var(--fg-muted);
  font-weight: 300;
  min-height: 20px;
}

/* Progress bar — custom UI driven by HTMLMediaElement timeupdate/durationchange */
.progress-container {
  padding: 0 20px;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: height 0.2s ease;
}

.progress-bar:hover {
  height: 5px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: none; /* no CSS transition — updated by JS on timeupdate */
}

.progress-time {
  display: flex;
  justify-content: space-between;
  padding: 4px 20px;
  font-size: 10px;
  color: var(--fg-dim);
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
}

.controls-spacer {
  width: 44px; /* balance for like-btn on right */
}

.controls-center {
  display: flex;
  align-items: center;
  gap: 24px;
}

.controls-right {
  display: flex;
  align-items: center;
}

.control-btn {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.control-btn:hover {
  color: var(--fg);
}

.control-btn:active {
  transform: scale(0.9);
}

.control-btn.prev-btn,
.control-btn.next-btn {
  color: var(--fg);
  width: 44px;
  height: 44px;
}

.control-btn.prev-btn:hover,
.control-btn.next-btn:hover {
  color: var(--accent);
}

.control-btn.play-btn {
  font-size: 22px;
  width: 56px;
  height: 56px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  background: transparent;
}

.control-btn.play-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.control-btn.like-btn {
  font-size: 22px;
  color: var(--fg-dim);
  width: 44px;
  height: 44px;
}

.control-btn.like-btn:hover {
  color: var(--accent);
}

.control-btn.like-btn.liked {
  color: var(--accent);
}

/* DJ say area */
.dj-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  min-height: 60px;
}

.dj-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stop-radio-btn {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-transform: uppercase;
}

.stop-radio-btn:hover {
  background: var(--accent);
  color: #000;
}

.stop-radio-btn.visible {
  display: flex;
}

.dj-voice-main {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--fg-dim);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}
.dj-voice-main:hover, .dj-voice-main:focus {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

.dj-text {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 300;
  line-height: 1.8;
  font-style: italic;
}

.dj-text.empty {
  color: var(--fg-dim);
}

/* Queue */
.queue-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex: 1;
  overflow-y: auto;
}

.queue-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--fg-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.queue-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--fg-muted);
}

.queue-item .queue-index {
  color: var(--fg-dim);
  min-width: 16px;
  flex-shrink: 0;
}

.queue-item .queue-song {
  font-weight: 400;
  color: var(--fg);
}

.queue-item .queue-artist {
  color: var(--fg-dim);
  font-weight: 300;
}

.queue-empty {
  font-size: 12px;
  color: var(--fg-dim);
  font-style: italic;
}

/* Chat input */
.chat-area {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
}

.chat-input::placeholder {
  color: var(--fg-dim);
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-send {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 14px;
  cursor: pointer;
  letter-spacing: 1px;
}

.chat-send:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.voice-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 16px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.voice-btn:hover {
  border-color: var(--accent);
}

.voice-btn.recording {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Profile page */
.profile-page, .settings-page {
  padding: 20px;
  overflow-y: auto;
}

.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-content {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.8;
  white-space: pre-wrap;
}

.section-hint {
  font-size: 11px;
  color: var(--fg-dim);
  font-style: italic;
  margin-top: 8px;
}

.time-slot-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* Settings */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setting-label {
  font-size: 12px;
  color: var(--fg-muted);
}

.setting-value {
  font-size: 12px;
  color: var(--fg);
}

/* Clickable setting */
.clickable {
  cursor: pointer;
  border-bottom: 1px dashed var(--fg-dim);
  transition: color 0.2s;
}
.clickable:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Modal overlay — must sit above everything */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 28px 24px 20px;
  width: 320px;
  max-width: 85vw;
}

.modal-title {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.modal-box .city-input {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.modal-box .city-input:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 16px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.modal-btn:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
}

.modal-confirm {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-confirm:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Profile items */
.history-item, .liked-item {
  padding: 4px 0;
  font-size: 12px;
  color: var(--fg-muted);
}

.liked-item {
  color: var(--accent);
}

.volume-slider {
  -webkit-appearance: none;
  width: 120px;
  height: 2px;
  background: var(--border);
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  cursor: pointer;
}

/* Chat messages in player */
.chat-messages {
  max-height: 100px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.chat-msg {
  font-size: 11px;
  padding: 3px 0;
  color: var(--fg-dim);
}

.chat-msg.user {
  color: var(--fg-muted);
}

.chat-msg.user::before {
  content: '> ';
  color: var(--accent);
}

.chat-msg.assistant::before {
  content: 'DJ: ';
  color: var(--accent);
}

/* Loading spinner */
.loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: var(--fg-dim);
  font-size: 12px;
}

.loading.active {
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Mobile responsive */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
  }
}

/* Plan items */
.plan-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.plan-time {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

.plan-label {
  font-size: 12px;
  color: var(--fg);
  margin-bottom: 4px;
}

.plan-songs {
  font-size: 11px;
  color: var(--fg-dim);
}

/* Initial state */
.initial-prompt {
  text-align: center;
  padding: 40px 20px;
}

.start-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.initial-prompt .start-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 24px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.initial-prompt .start-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.initial-prompt p {
  color: var(--fg-dim);
  font-size: 12px;
  margin-bottom: 8px;
}

/* ========== Ambient Visualizer ========== */

.visualizer-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 2s ease;
  background: rgba(120, 100, 255, 0.15);
  box-shadow: 0 0 120px 60px rgba(120, 100, 255, 0.1),
              0 0 200px 100px rgba(180, 100, 255, 0.05);
}

.ambient-glow.active {
  opacity: 1;
  animation: glow-breathe 8s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.7; }
}

/* Ensure content sits above visualizer */
#app {
  position: relative;
  z-index: 1;
}

.build-version {
  position: fixed;
  bottom: 4px;
  right: 8px;
  font-size: 10px;
  color: var(--fg-dim);
  opacity: 0.3;
  font-family: var(--font-mono);
  pointer-events: none;
  z-index: 9999;
}

.sleep-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.2s;
  margin-right: 8px;
}

.sleep-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sleep-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
}
