/* live.css — XLX232 Live tab (audio player + EQ + TX banner).
 *
 * Layout (desktop ≥ 768px):
 *   ┌─────────────────────────────────────────────────────┐
 *   │  Header: title  |  status pill                      │
 *   ├─────────────────────────────────────────────────────┤
 *   │  TX banner:   ● CALLSIGN  module D · TG 4004 · 00:23│
 *   ├─────────────────────────────────────────────────────┤
 *   │  Player:  [▶]  ████ EQ ████  [vol slider] [mute]    │
 *   ├─────────────────────────────────────────────────────�
 *   │  Hint                                                 │
 *   ├─────────────────────────────────────────────────────┤
 *   │  Recent transmissions:  [10:23:11] RA1ABC TG4004 · 18│
 *   └─────────────────────────────────────────────────────┘
 *
 * Spotify-style EQ: cyan→blue gradient bars + white peak-hold.
 * Mobile-friendly: collapses to vertical stack at ≤ 768px.
 */

/* ---- Page wrapper ---- */

.live-page {
  margin: 0 auto;
  max-width: 920px;
  padding: 1rem 0;
}

/* ---- Header ---- */

.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.live-header h1 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.live-broadcast-icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent, #fbbf24);
  animation: live-broadcast-pulse 2.4s ease-in-out infinite;
}
@keyframes live-broadcast-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.08); }
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-card, #1c2530);
  color: var(--text-dim, #a0b0c0);
  border: 1px solid var(--border, #2a3540);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.live-status-pill[data-state="up"] {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}
.live-status-pill[data-state="down"] {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}
.live-status-pill[data-state="connecting"] {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.4);
}
.live-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: live-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes live-dot-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ---- TX banner ---- */

.live-banner {
  background: linear-gradient(135deg,
              rgba(80, 220, 255, 0.12) 0%,
              rgba(40, 130, 220, 0.12) 100%);
  border: 1px solid rgba(80, 220, 255, 0.35);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.live-banner[data-active="1"] {
  background: linear-gradient(135deg,
              rgba(80, 220, 255, 0.25) 0%,
              rgba(40, 130, 220, 0.25) 100%);
  border-color: rgba(80, 220, 255, 0.6);
  box-shadow: 0 0 20px rgba(80, 220, 255, 0.25);
}
.live-banner-callsign {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text, #e8f0f8);
  line-height: 1.1;
}
.live-banner-meta {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-dim, #a0b0c0);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---- Player ---- */

.live-player {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-card, #1c2530);
  border: 1px solid var(--border, #2a3540);
  border-radius: 12px;
  margin-bottom: 0.9rem;
}

.live-btn-play {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent, #fbbf24);
  color: #1a1a1a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.live-btn-play:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.5);
}
.live-btn-play .icon-play  { display: block; }
.live-btn-play .icon-pause { display: none; }
.live-btn-play.is-playing .icon-play  { display: none; }
.live-btn-play.is-playing .icon-pause { display: block; }
.live-btn-play svg {
  width: 24px;
  height: 24px;
}

.live-eq-wrap {
  flex: 1 1 auto;
  position: relative;
  height: 160px;
  background: linear-gradient(180deg,
              rgba(0, 0, 0, 0.25) 0%,
              rgba(0, 0, 0, 0.4) 100%);
  border-radius: 8px;
  overflow: hidden;
}
.live-eq-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.live-eq-idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.4s;
}
.live-eq-idle span {
  display: inline-block;
  width: 3px;
  height: 14px;
  background: rgba(80, 220, 255, 0.55);
  border-radius: 2px;
  animation: live-eq-idle 1.4s ease-in-out infinite;
}
.live-eq-idle span:nth-child(2) { animation-delay: 0.2s; }
.live-eq-idle span:nth-child(3) { animation-delay: 0.4s; }
.live-eq-idle span:nth-child(4) { animation-delay: 0.6s; }
.live-eq-idle span:nth-child(5) { animation-delay: 0.8s; }
@keyframes live-eq-idle {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

.live-player-controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.live-btn-mute {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim, #a0b0c0);
  border: 1px solid var(--border, #2a3540);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.live-btn-mute:hover { color: var(--text, #e8f0f8); }
.live-btn-mute .icon-vol-off { display: none; }
.live-btn-mute.is-muted .icon-vol-on  { display: none; }
.live-btn-mute.is-muted .icon-vol-off { display: block; color: #ef4444; }
.live-btn-mute svg { width: 18px; height: 18px; }

.live-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: var(--border, #2a3540);
  border-radius: 2px;
  outline: none;
}
.live-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent, #fbbf24);
  cursor: pointer;
}
.live-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent, #fbbf24);
  border: none;
  cursor: pointer;
}

/* ---- Hint ---- */

.live-hint {
  margin: 0.5rem 0 1.5rem;
  padding: 0.8rem 1rem;
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--accent, #fbbf24);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-dim, #a0b0c0);
}

/* ---- Recent ---- */

.live-recent-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
  color: var(--text-dim, #a0b0c0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.live-recent {
  margin: 0;
  padding: 0;
  list-style: none;
}
.live-recent li {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border, #2a3540);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  color: var(--text, #e8f0f8);
}
.live-recent li:last-child {
  border-bottom: none;
}
.live-recent-empty {
  color: var(--text-dim, #a0b0c0) !important;
  font-style: italic;
  text-align: center;
  padding: 1.5rem !important;
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
  .live-header h1 { font-size: 1.25rem; }
  .live-player {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }
  .live-btn-play {
    width: 48px;
    height: 48px;
  }
  .live-eq-wrap {
    flex: 1 1 100%;
    height: 120px;
    order: 3;
  }
  .live-player-controls {
    flex: 0 0 auto;
    flex-direction: row;
  }
  .live-volume {
    width: 140px;
  }
  .live-banner-callsign {
    font-size: 1.4rem;
  }
}

/* ---- Light theme ---- */

html[data-theme="light"] .live-page {
  --bg-card: #ffffff;
  --border:  #d6dee8;
  --text:    #1a2530;
  --text-dim:#5a6b7a;
  --accent:  #2563eb;
}
html[data-theme="light"] .live-banner {
  background: linear-gradient(135deg,
              rgba(80, 220, 255, 0.08) 0%,
              rgba(40, 130, 220, 0.08) 100%);
  border-color: rgba(40, 130, 220, 0.4);
}
html[data-theme="light"] .live-btn-play {
  background: #2563eb;
  color: #fff;
}
html[data-theme="light"] .live-eq-wrap {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.07));
}
