/* ==========================================================================
   Rajasthani Multi-Dialect S2ST Studio - Bright Industry-Grade UI (Zero Gradients)
   ========================================================================== */

:root {
  --bg-color: #f8fafc;
  --panel-bg: #ffffff;
  --panel-border: #e2e8f0;
  --panel-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary-accent: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-accent: #0284c7;
  --success-color: #059669;
  --danger-color: #dc2626;
  --card-radius: 12px;
  --transition-fast: 0.15s ease;
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  padding: 24px;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  border-radius: var(--card-radius);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  font-size: 28px;
  background: #e0e7ff;
  color: var(--primary-accent);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
}

#app-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-accent);
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  font-size: 13px;
  color: var(--success-color);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success-color);
  border-radius: 50%;
}

/* Base Card */
.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  border-radius: var(--card-radius);
  padding: 24px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--text-main);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
}

/* Controls Grid */
.control-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-end;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.custom-select, .custom-select-small {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: var(--transition-fast);
  cursor: pointer;
}

.custom-select:hover, .custom-select:focus,
.custom-select-small:hover, .custom-select-small:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.custom-select-small {
  padding: 10px 12px;
  font-size: 13px;
  width: 100%;
}

.icon-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--primary-accent);
  border-color: var(--primary-accent);
  background: #f5f3ff;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Input Modes Tab */
.input-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.mode-btn {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mode-btn.active {
  background: #ffffff;
  color: var(--primary-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.visualizer-container {
  position: relative;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  height: 120px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.timer-overlay {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: var(--danger-color);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}

/* Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-record {
  background: #fef2f2;
  color: var(--danger-color);
  border: 1px solid #fca5a5;
  flex: 1;
}

.btn-record:hover {
  background: #fee2e2;
  border-color: var(--danger-color);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  flex: 1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-primary {
  background: var(--primary-accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 8px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.full-width {
  width: 100%;
}

.preset-phrase-box {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-phrase-box label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Stepper */
.pipeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: var(--transition-fast);
}

.step-item.active {
  opacity: 1;
}

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-item.active .step-badge {
  background: var(--primary-accent);
  color: #ffffff;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.step-item.active .step-label {
  color: var(--text-main);
  font-weight: 700;
}

.step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 12px;
}

.step-line.active {
  background: var(--primary-accent);
}

/* Transcript Boxes */
.transcript-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.transcript-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}

.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.box-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-src {
  background: #e0e7ff;
  color: var(--primary-accent);
}

.tag-tgt {
  background: #e0f2fe;
  color: var(--secondary-accent);
}

.box-header .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.text-content {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  min-height: 24px;
}

/* Custom Audio Player */
.audio-player-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.player-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.player-badge {
  font-size: 10px;
  background: #d1fae5;
  color: var(--success-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

#output-canvas {
  height: 80px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-play {
  background: var(--primary-accent);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-play:hover {
  background: var(--primary-hover);
}

.btn-play:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.scrubber-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#audio-scrubber {
  accent-color: var(--primary-accent);
  cursor: pointer;
}

.time-display {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.icon-btn-download {
  color: var(--text-main);
  text-decoration: none;
  font-size: 16px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.icon-btn-download:hover {
  background: #f1f5f9;
  border-color: var(--primary-accent);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-card.highlight {
  border-color: var(--primary-accent);
  background: #f5f3ff;
}

.metric-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
