/* ATC Voice AI - Custom Design System */
:root {
  --bg-dark: #070913;
  --bg-card: rgba(18, 24, 43, 0.7);
  --bg-card-hover: rgba(26, 35, 62, 0.85);
  --border-color: rgba(0, 242, 254, 0.18);
  --border-color-glow: rgba(0, 242, 254, 0.45);
  
  --primary-cyan: #00f2fe;
  --primary-blue: #4facfe;
  --accent-purple: #7000ff;
  --accent-pink: #f857a6;
  --text-main: #f0f4fc;
  --text-muted: #8b9bb4;
  --text-dim: #546682;

  --spk-a-color: #00f2fe;
  --spk-b-color: #ff80bf;
  --spk-c-color: #00ff87;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Radar Sweep Visual Effect */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.radar-sweep {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(0, 242, 254, 0.08) 0deg, transparent 60deg, transparent 360deg);
  animation: radarRotate 18s linear infinite;
}

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

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 242, 254, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.4;
}

/* Container & Navbar */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(112, 0, 255, 0.2));
  border: 1px solid var(--primary-cyan);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffffff, var(--primary-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #00ff87;
  box-shadow: 0 0 10px #00ff87;
}

.status-indicator.live {
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  flex: 1;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Card Panel Base */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  font-family: var(--font-mono);
}

/* Dropzone Upload */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 16px;
  text-align: center;
  background: rgba(7, 9, 19, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.05);
  box-shadow: var(--shadow-glow);
}

.upload-icon {
  color: var(--primary-cyan);
  margin-bottom: 12px;
  transition: transform 0.3s ease;
}

.upload-dropzone:hover .upload-icon {
  transform: translateY(-4px);
}

.primary-text {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);

}

.secondary-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary-cyan);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* File Preview Card */
.file-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-sm);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.file-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #000;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 242, 254, 0.5);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
}

.btn-icon:hover {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.1);
}

/* Sample Audio Choice */
.sample-audio-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sample-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sample-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-chip {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--primary-cyan);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sample-chip:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: var(--primary-cyan);
}

/* Audio Player */
.audio-player-card {
  width: 100%;
}

.audio-player-card audio {
  width: 100%;
  border-radius: 8px;
  outline: none;
}

/* Progress Stepper */
.progress-card {
  padding: 18px;
  background: rgba(0, 242, 254, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-cyan);
}

.progress-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 242, 254, 0.2);
  border-top-color: var(--primary-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: all 0.3s ease;
}

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

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.step-item.active .step-circle {
  border-color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.2);
  color: var(--primary-cyan);
  box-shadow: 0 0 10px var(--primary-cyan);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--text-dim);
  margin: 0 8px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.step-line.active {
  background: var(--primary-cyan);
  opacity: 1;
}

.step-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Empty Placeholder */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 16px;
}

.radar-graphic {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 254, 0.15);
}

.radar-circle.c1 { width: 30px; height: 30px; }
.radar-circle.c2 { width: 65px; height: 65px; }
.radar-circle.c3 { width: 100px; height: 100px; }

.radar-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--primary-cyan);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* Results Content & Tabs */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-buttons {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--primary-cyan);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(0, 242, 254, 0.2);
}

/* Tab Panels */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Diarization Timeline Segments */
.diarization-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.segment-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.segment-item:hover {
  border-color: var(--border-color-glow);
  transform: translateX(4px);
  background: rgba(18, 24, 43, 0.9);
}

.speaker-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  height: fit-content;
  text-transform: uppercase;
}

.speaker-badge.spk-a {
  background: rgba(0, 242, 254, 0.15);
  color: var(--spk-a-color);
  border: 1px solid rgba(0, 242, 254, 0.4);
}

.speaker-badge.spk-b {
  background: rgba(255, 128, 191, 0.15);
  color: var(--spk-b-color);
  border: 1px solid rgba(255, 128, 191, 0.4);
}

.segment-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.segment-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.segment-text {
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Extracted Info Cards Grid */
.extracted-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  padding: 16px;
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-heading);
}

.info-card-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-cyan);
  font-family: var(--font-mono);
  word-break: break-all;
}

.full-text-box {
  padding: 18px;
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.full-text-box h4 {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.full-text-box p {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* Code Viewer Tab */
.code-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
}

.code-filename {
  font-size: 0.8rem;
  color: var(--primary-cyan);
  font-family: var(--font-mono);
}

.btn-copy {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-copy:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.code-block {
  background: rgba(5, 7, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 16px;
  max-height: 440px;
  overflow: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #a6accd;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}
