/* ─────────────────────────────────────────────
   RADIO LOGGER — Editorial Radio Control UI
   ───────────────────────────────────────────── */

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

:root {
  --bg:        #0d0d0d;
  --surface:   #141414;
  --surface2:  #1c1c1c;
  --border:    #2a2a2a;
  --accent:    #e8ff47;
  --red:       #ff3b3b;
  --dim:       #555;
  --muted:     #888;
  --text:      #f0f0f0;
  --text-dim:  #aaa;
  --mono:      'Space Mono', monospace;
  --sans:      'Space Grotesk', sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── MASTHEAD ─────────────────────────────────── */

.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  padding: 28px 36px 20px;
  border-bottom: 1px solid var(--border);
  gap: 40px;
}

.masthead-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}

.masthead-title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.masthead-center {
  padding-bottom: 4px;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}

.status-dot.active { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-dot.recording { background: var(--red); animation: blink 1s ease-in-out infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--red); }
  50% { opacity: 0.2; box-shadow: none; }
}

.masthead-right {
  display: flex;
  gap: 32px;
  padding-bottom: 4px;
}

.meta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.meta-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.meta-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

/* ── RECORDING BANNER ────────────────────────── */

.recording-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 36px;
  background: rgba(255, 59, 59, 0.08);
  border-bottom: 1px solid rgba(255, 59, 59, 0.2);
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.15em;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1s ease-in-out infinite;
}

.rec-details {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ── LAYOUT ──────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  min-height: calc(100vh - 100px);
}

.col-stations { border-right: 1px solid var(--border); }
.col-controls { border-left: 1px solid var(--border); }

.col-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.col-header h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--dim);
  flex: 1;
}

.btn-add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

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

.filter-station {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-decoration: underline;
}

/* ── STATION FORM ────────────────────────────── */

.station-form {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.form-row {
  margin-bottom: 10px;
}

.form-row label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--dim);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.form-row input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s;
}

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

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-save {
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity 0.15s;
}

.btn-save:hover { opacity: 0.85; }

.btn-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.15s;
}

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

/* ── STATION LIST ────────────────────────────── */

.station-list {
  padding: 8px 0;
}

.station-item {
  padding: 14px 24px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  position: relative;
  transition: background 0.1s;
}

.station-item:hover { background: var(--surface); }

.station-item.active {
  background: var(--surface);
  border-left: 2px solid var(--accent);
  padding-left: 22px;
}

.station-item.recording-now::before {
  content: '';
  position: absolute;
  top: 18px;
  right: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1s ease-in-out infinite;
}

.station-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.station-url {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.station-duration {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  margin-top: 4px;
}

.station-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}

.station-item:hover .station-actions { opacity: 1; }

.act-btn {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.1s, color 0.1s;
}

.act-btn:hover { border-color: var(--text-dim); color: var(--text); }
.act-btn.danger:hover { border-color: var(--red); color: var(--red); }
.act-btn.record { border-color: rgba(255,59,59,0.3); color: var(--red); }
.act-btn.record:hover { border-color: var(--red); }

/* ── RECORDINGS LIST ─────────────────────────── */

.col-recordings { padding: 0; }

.recordings-list {
  padding: 0;
}

.rec-group {
  border-bottom: 1px solid var(--border);
}

.rec-group-header {
  padding: 10px 28px 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.rec-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: pointer;
}

.rec-item:hover { background: var(--surface); }

.rec-item.playing { background: var(--surface); border-left: 2px solid var(--accent); padding-left: 26px; }
.rec-item.status-recording { opacity: 0.7; }

.rec-main { min-width: 0; }

.rec-station {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 3px;
  text-transform: uppercase;
}

.rec-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-info {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  gap: 12px;
}

.rec-status-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 2px;
}

.rec-status-badge.recording {
  background: rgba(255,59,59,0.1);
  color: var(--red);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.rec-status-badge.completed { background: rgba(232,255,71,0.08); color: var(--accent); }
.rec-status-badge.failed { background: rgba(255,59,59,0.08); color: #ff6b6b; }

.rec-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.rec-item:hover .rec-item-actions { opacity: 1; }

/* ── CONTROLS PANEL ──────────────────────────── */

.col-controls { padding: 0; }

/* ── PLAYER ──────────────────────────────────── */

.player-block {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.player-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  margin-bottom: 14px;
}

.player-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
  min-height: 42px;
}

.player-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 18px;
  min-height: 15px;
}

/* Visualization */
.player-viz {
  height: 48px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.viz-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 100%;
  width: 100%;
}

.viz-bar {
  flex: 1;
  background: var(--border);
  border-radius: 1px;
  transition: height 0.08s ease;
  min-height: 2px;
}

.viz-bar.active {
  background: var(--accent);
  opacity: 0.7;
}

/* Seek */
.player-seek-wrap {
  margin-bottom: 6px;
}

.player-seek {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

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

.player-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
}

.player-times {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 20px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.1s, color 0.1s;
}

.ctrl-btn:hover { border-color: var(--text-dim); color: var(--text); }

.ctrl-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ctrl-play {
  width: 52px;
  height: 52px;
  border-color: var(--accent);
  color: var(--accent);
}

.ctrl-play:hover { background: rgba(232,255,71,0.07); }

.ctrl-play svg { width: 20px; height: 20px; }

/* ── SCHEDULE BLOCK ──────────────────────────── */

.schedule-block {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.schedule-header {
  margin-bottom: 18px;
}

.schedule-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  display: block;
  margin-bottom: 4px;
}

.schedule-station-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.schedule-timeline {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sched-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 3px;
  border: 1px solid var(--border);
}

.sched-time {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  flex: 1;
}

.sched-toggle {
  width: 28px;
  height: 16px;
  border-radius: 8px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  border: none;
  transition: background 0.15s;
  flex-shrink: 0;
}

.sched-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.15s, background 0.15s;
}

.sched-toggle.on { background: rgba(232,255,71,0.15); }
.sched-toggle.on::after { left: 14px; background: var(--accent); }

.sched-delete {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.1s;
  flex-shrink: 0;
}

.sched-delete:hover { color: var(--red); }

.schedule-add {
  display: flex;
  gap: 8px;
}

.time-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s;
}

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

/* Style the time input clock icon */
.time-input::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.3);
  cursor: pointer;
}

.btn-add-time {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

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

/* ── NEXT BLOCK ──────────────────────────────── */

.next-block {
  padding: 20px 24px;
}

.next-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  margin-bottom: 10px;
}

.next-info {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.next-info strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

/* ── EMPTY STATE ─────────────────────────────── */

.empty-state {
  padding: 40px 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── SCROLLBARS ──────────────────────────────── */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ── UTILITIES ───────────────────────────────── */

.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-muted { color: var(--muted); }

/* ── TOAST ───────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 18px;
  border-radius: 4px;
  z-index: 1000;
  animation: toast-in 0.2s ease;
  max-width: 320px;
}

.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error { border-color: var(--red); color: var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ──────────────────────────────── */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .col-stations, .col-controls { border: none; border-bottom: 1px solid var(--border); }
}
