/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Courier New', Courier, monospace;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

a, a:visited { color: #00d2ff; text-decoration: none; font-weight: bold; transition: color 0.15s; }
a:hover, a:active { color: #ffffff; text-decoration: underline; }

/* ============================================================
   HEADER
============================================================ */
header {
  width: 100%;
  background: #0f0f0f;
  border-bottom: 2px solid #1a6b1a;
  padding: 18px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

header h1 {
  font-size: 1.5em;
  color: #2ecc2e;
  letter-spacing: 3px;
  text-transform: uppercase;
}

header p {
  font-size: 0.72em;
  color: #555;
  letter-spacing: 2px;
  margin-top: 3px;
}

.header-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.82em;
}

.header-links a { color: #00d2ff; letter-spacing: 0.5px; }

/* ============================================================
   PLAYER BOX
============================================================ */
.player-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 16px 20px;
}

.player-box {
  background: #111;
  border: 1px solid #1a6b1a;
  border-radius: 10px;
  padding: 28px 40px 24px;
  text-align: center;
  width: 100%;
  max-width: 420px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #0f0f0f;
  border: 1px solid #222;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.75em;
  letter-spacing: 1.5px;
  color: #888;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #333;
  transition: background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.status-dot.live   { background: #2ecc2e; box-shadow: 0 0 8px #2ecc2e; }
.status-dot.muted  { background: #e0a800; box-shadow: 0 0 6px #e0a800; }

#statusLabel { color: #888; letter-spacing: 1.5px; }
#statusLabel.live  { color: #2ecc2e; }
#statusLabel.muted { color: #e0a800; }

.timer-pill { font-variant-numeric: tabular-nums; }
#timeCounter { color: #2ecc2e; font-weight: bold; }

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  background: #1a1a1a;
  border: 1px solid #2ecc2e;
  color: #2ecc2e;
  border-radius: 6px;
  padding: 11px 22px;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  letter-spacing: 1px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover:not(:disabled) { background: #2ecc2e; color: #000; }

#startBtn { border-color: #2ecc2e; color: #2ecc2e; }
#startBtn:disabled { border-color: #1e5c2c; color: #1e5c2c; cursor: not-allowed; }

#stopBtn  { border-color: #dc3545; color: #dc3545; }
#stopBtn:hover:not(:disabled) { background: #dc3545; color: #fff; }
#stopBtn:disabled { border-color: #4a1520; color: #4a1520; cursor: not-allowed; }

#muteBtn  { border-color: #e0a800; color: #e0a800; }
#muteBtn:hover:not(:disabled) { background: #e0a800; color: #000; }
#muteBtn:disabled { border-color: #4a3a00; color: #4a3a00; cursor: not-allowed; }

#errorMsg {
  color: #e05555;
  font-size: 0.78em;
  margin-top: 12px;
  min-height: 16px;
  letter-spacing: 0.5px;
}

.client-count {
  font-size: 0.72em;
  color: #555;
  margin-top: 14px;
  letter-spacing: 1px;
}

.client-count span { color: #2ecc2e; font-weight: bold; }

audio { display: none; }

/* ============================================================
   ARCHIVE SECTION
============================================================ */
.archive-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.archive-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-bottom: 1px solid #1a6b1a;
  padding-bottom: 10px;
  margin-bottom: 6px;
}

.archive-header h2 {
  font-size: 0.9em;
  color: #2ecc2e;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.archive-subtitle {
  font-size: 0.72em;
  color: #555;
  letter-spacing: 1px;
}

#transcripts {
  background: #000;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  padding: 0px 0px;
  height: 50vh;
  overflow-y: auto;
  margin-top: 8px;
  scroll-behavior: smooth;
}

#transcripts::-webkit-scrollbar { width: 6px; }
#transcripts::-webkit-scrollbar-track { background: #0a0a0a; }
#transcripts::-webkit-scrollbar-thumb { background: #1a6b1a; border-radius: 3px; }

/* ============================================================
   TRANSCRIPT ROWS
============================================================ */
.transcript-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 2px;
  line-height: 1.4;
  width: 100%;
  border-radius: 3px;
  transition: background 0.1s;
}

.transcript-row:hover { background: rgba(46,204,46,0.03); }

.timestamp-container {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  margin-right: 0;
  padding-right: 0;
  min-width: 0;
  white-space: nowrap;
}

.timestamp-link { color: #00d2ff; font-size: 0.85em; white-space: nowrap;  }

.transcript-row.has-been-played-by-user .timestamp-link { color: #bb86fc; }
.transcript-row.is-playing-archive .timestamp-link { color: #ff9f1c; font-weight: bold; }
.transcript-row.is-playing-archive { background: rgba(255,159,28,0.04); }

.play-indicator-icon {
  display: inline-block;
  font-size: 1.1rem;
  color: #00d2ff;
  transition: color 0.15s, transform 0.1s;
  vertical-align: middle;
  margin-left: 0;
}

.timestamp-container:hover .play-indicator-icon { color: #fff; transform: scale(1.2); }
.timestamp-container:hover .timestamp-link { color: #fff; text-decoration: underline; }
.transcript-row.is-playing-archive .play-indicator-icon { color: #ff9f1c; }

.copy-link-btn {
  margin: 0;
  padding: 1px 0;
  font-size: 11px;
  width: 50px;
  flex-shrink: 0;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: #fff;
  color: #000;
  appearance: none;
  transition: background 0.2s, color 0.2s;
}

.row-locked-recording {
  background: rgba(220,53,69,0.04);
  border-left: 3px solid #dc3545;
  padding-left: 5px;
  cursor: not-allowed;
}

.timestamp-container-locked { display: inline-flex; align-items: center; user-select: none; }
.timestamp-link-locked { color: #ff3b30; font-family: monospace; font-size: 0.85em; }
.recording-pulse-dot { font-size: 0.65rem; margin-left: 6px; animation: pulseVis 1s infinite alternate; }

@keyframes pulseVis { 0% { opacity: 0.2; } 100% { opacity: 1; } }

@media (max-width: 768px) {
  .transcript-row { gap: 6px; }
}

/* ============================================================
   VLC INSTRUCTIONS
============================================================ */
.vlc-wrap {
  max-width: 640px;
  margin: 30px auto 0;
  padding: 0 16px 40px;
}

.vlc-wrap h2 { font-size: 1.2em; color: #2ecc2e; margin-bottom: 6px; letter-spacing: 1px; }
.vlc-wrap p  { font-size: 0.85em; color: #888; margin-bottom: 18px; }

details {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

details[open] { border-color: #1a6b1a; }

summary {
  padding: 14px 16px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  color: #ccc;
}

summary::after { content: "▼"; font-size: 0.75rem; color: #555; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(180deg); color: #2ecc2e; }
summary::-webkit-details-marker { display: none; }

.dropdown-content { padding: 0 18px 18px; border-top: 1px solid #1a1a1a; }

ol { margin: 14px 0 0; padding-left: 18px; }
li { margin-bottom: 10px; line-height: 1.5; color: #bbb; font-size: 0.88em; }

.url-box-container {
  display: flex;
  align-items: center;
  margin: 8px 0;
  background: #0a0a0a;
  border-radius: 6px;
  padding: 7px 12px;
  border: 1px solid #333;
}

.url-text {
  font-family: monospace;
  font-size: 0.88em;
  color: #ff9f1c;
  word-break: break-all;
  flex-grow: 1;
}

.copy-btn {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: bold;
  margin-left: 10px;
  white-space: nowrap;
  transition: background 0.2s;
}

.copy-btn:hover { background: #0056b3; }
.copy-btn.copied { background: #28a745; }

.store-badge { display: block; margin: 8px 0; }

.button-hint {
  font-size: 0.8em;
  color: #555;
  font-style: italic;
  display: block;
  margin-top: 10px;
}

.no-recordings-msg {
  color: #555;
  padding: 12px;
  font-size: 0.82em;
}

