/* RADStrat RT Trainer — Military Aesthetic */

/* === CSS Custom Properties === */
:root {
  --bg-primary:  #0a0a0a;
  --bg-panel:    #111111;
  --border-dim:  #2a2a2a;
  --text-primary: #c8c8c8;
  --text-dim:    #555555;
  --accent-red:  #8b0000;
  --accent-green: #1a4a1a;
}

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

/* === Root layout === */
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Courier New", Courier, "Lucida Console", monospace;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}

/* === Status bar / header === */
.status-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-primary);
}

.status-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #3a7a3a; /* phosphor-screen green */
}

.status-indicator {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* === Bottom bar === */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 1rem;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  gap: 0.75rem;
  z-index: 10;
  pointer-events: none;
}

.bottom-bar > * {
  pointer-events: auto;
}

/* === Transcript panel === */
.transcript-panel {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  max-height: 50dvh;
  overflow-y: auto;
  padding: 0.75rem;
  background: transparent;
  border: none;
  font-size: 13px;
  -webkit-overflow-scrolling: touch;
}

.transcript-placeholder {
  color: var(--text-dim);
  user-select: none;
}

.transcript-entry {
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  word-wrap: break-word;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.transcript-live {
  opacity: 0.6;
  font-style: italic;
}

.transcript-error {
  margin-bottom: 0.4rem;
  color: var(--text-dim);
  font-style: italic;
  word-wrap: break-word;
}

/* === Mic container === */
.mic-container {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 0 0.5rem;
}

/* === Mic button base === */
.mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #555555;
  background: radial-gradient(circle at 30% 30%, #4a4a4a, #2a2a2a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

.mic-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(58, 122, 58, 0.6);
}

/* === State: idle === */
.mic-btn.state-idle {
  background: radial-gradient(circle at 30% 30%, #4a4a4a, #2a2a2a);
  border-color: #555555;
}

/* === State: recording === */
.mic-btn.state-recording {
  background: var(--accent-red);
  border-color: #cc0000;
  animation: pulse-red 1.2s ease-in-out infinite;
}

@keyframes pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.7); }
  50%  { box-shadow: 0 0 0 14px rgba(204, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(204, 0, 0, 0); }
}

/* === State: processing === */
.mic-btn.state-processing {
  background: #1a1a1a;
  border-color: #444444;
}

.mic-btn.state-processing svg {
  opacity: 0.3;
}

.mic-btn.state-processing::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #c8c8c8;
  border-right-color: #c8c8c8;
  animation: spin 0.8s linear infinite;
}

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