body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 2rem;
    background-color: #f4f4f9;
    color: #333;
    min-height: 100vh;
}

.container {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 20px;
    color: #333;
}

#status {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #555;
    min-height: 25px;
}

.status-live {
    color: #38bdf8;
    animation: statusPulse 1.2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.log-area {
    background-color: #222;
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    padding: 1rem;
    border-radius: 5px;
    height: 150px;
    overflow-y: scroll;
    border: 1px solid #444;
    margin-top: 1rem;
    text-align: left;
}

.device-selector {
    margin-bottom: 20px;
    text-align: left;
}

.device-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.device-selector select {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
}

.device-selector select:focus {
    outline: none;
    border-color: #28a745;
}

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

.controls button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#startBtn {
    background-color: #28a745;
    color: white;
}

#startBtn:disabled {
    background-color: #60b985;
    color: #ffffff;
    cursor: not-allowed;
}

#pauseBtn {
    background-color: #ff9800;
    color: white;
}

#pauseBtn:disabled {
    background-color: #ffb84d;
    color: #ffffff;
    cursor: not-allowed;
}

#pauseBtn.paused {
    background-color: #4caf50;
}

#pauseBtn.paused:hover {
    background-color: #66bb6a;
}

#stopBtn {
    background-color: #dc3545;
    color: white;
}

#stopBtn:disabled {
    background-color: #e58b98;
    color: #ffffff;
    cursor: not-allowed;
}

#clearBtn {
    background-color: #ffc107;
    color: #333;
}

#clearBtn:hover {
    background-color: #e0a800;
}


/* ---- Overrides dark theme (IC) ---- */
:root {
  color-scheme: light dark;
}

body {
  background-color: #11151c;
}

.container {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
}

h1 {
  color: #e2e8f0;
  margin: 0 0 8px 0;
}

#status {
  color: #9fb3c8;
}

.device-selector label,
.language-selector label { 
  color: #cbd5e1; 
}

.device-selector select,
.language-selector select {
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 10px;
}

.device-selector select:focus,
.language-selector select:focus {
  border-color: #2ec4b6;
  box-shadow: 0 0 0 3px rgba(46,196,182,0.18);
}

.language-selector {
  margin-bottom: 20px;
  text-align: left;
}

.language-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.language-selector select {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  cursor: pointer;
}

.mode-selector {
  margin: 20px 0;
  text-align: left;
}

.mode-selector > label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.mode-options {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 2px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-option:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.35);
}

.mode-option input[type="radio"] {
  margin-top: 2px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #2ec4b6;
}

.mode-option input[type="radio"]:checked + .mode-label {
  color: #56e6d6;
}

.mode-option:has(input:checked) {
  background: rgba(46, 196, 182, 0.12);
  border-color: rgba(86, 230, 214, 0.45);
}

.mode-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #e2e8f0;
}

.mode-label strong {
  font-size: 1em;
  font-weight: 600;
}

.mode-label small {
  font-size: 0.85em;
  color: #94a3b8;
  font-weight: 400;
}

.controls button {
  border: 1px solid transparent;
  border-radius: 10px;
}

#startBtn {
  background: rgba(46,196,182,0.16);
  color: #56e6d6;
  border-color: rgba(86,230,214,0.35);
}

#startBtn:hover { 
  background: rgba(46,196,182,0.24); 
}

#startBtn:disabled {
  opacity: 1;
  background: rgba(46,196,182,0.18);
  color: #56e6d6;
  border-color: rgba(86,230,214,0.25);
  cursor: not-allowed;
}

#pauseBtn {
  background: rgba(251, 146, 60, 0.18);
  color: #fdba74;
  border-color: rgba(253, 186, 116, 0.35);
}

#pauseBtn:hover { 
  background: rgba(251, 146, 60, 0.26); 
}

#pauseBtn:disabled {
  opacity: 1;
  background: rgba(251, 146, 60, 0.2);
  color: #fed7aa;
  border-color: rgba(253, 186, 116, 0.25);
  cursor: not-allowed;
}

#pauseBtn.paused {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.35);
}

#pauseBtn.paused:hover {
  background: rgba(34, 197, 94, 0.26);
}

#stopBtn {
  background: rgba(244, 63, 94, 0.18);
  color: #ff8899;
  border-color: rgba(255, 136, 153, 0.35);
}

#stopBtn:hover { 
  background: rgba(244, 63, 94, 0.26); 
}

#stopBtn:disabled {
  opacity: 1;
  background: rgba(244, 63, 94, 0.2);
  color: #ff919f;
  border-color: rgba(255, 136, 153, 0.25);
  cursor: not-allowed;
}

#clearBtn {
  background: rgba(234, 179, 8, 0.16);
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.35);
}

#clearBtn:hover { 
  background: rgba(234, 179, 8, 0.24); 
}

/* VU meter */
#vumeter-container label { 
  color: #cbd5e1; 
}

#vumeter { 
  appearance: none; 
  width: 100%; 
  height: 16px; 
}

#vumeter::-webkit-progress-bar { 
  background-color: rgba(15, 23, 42, 0.5); 
  border-radius: 999px; 
}

#vumeter::-webkit-progress-value { 
  background: linear-gradient(90deg, #2ec4b6, #56e6d6); 
  border-radius: 999px; 
}

#vumeter::-moz-progress-bar { 
  background: linear-gradient(90deg, #2ec4b6, #56e6d6); 
  border-radius: 999px; 
}

/* Logo */
.brand-logo {
  height: 90px;
  width: auto;
  vertical-align: middle;
  margin-right: 10px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .brand-logo { 
    height: 70px; 
  }
  
  .controls {
    flex-direction: column;
  }
  
  .controls button {
    width: 100%;
  }
}

.transcription-link {
  margin-top: 1.5rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.transcription-label {
  color: #e2e8f0;
  font-weight: 500;
  margin-right: 0.35rem;
}

.transcription-link a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
}

.transcription-link a:hover,
.transcription-link a:focus {
  color: #7dd3fc;
  text-decoration: underline;
}
