/* TalkTime – Premium Demo Styles */
:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(18, 18, 28, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-cyan: #00e5cc;
  --accent-magenta: #e040fb;
  --accent-amber: #ffab00;
  --text-primary: #f0f0f5;
  --text-muted: #8888aa;
  --rec-red: #ff3b5c;
  --speaker-0: #00e5cc;
  --speaker-1: #e040fb;
  --speaker-2: #ffab00;
  --speaker-3: #00e676;
  --speaker-4: #536dfe;
}

* {
  box-sizing: border-box;
}

body.talktime {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Animated gradient background */
.talktime .bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0, 229, 204, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 90% 60%, rgba(224, 64, 251, 0.08), transparent 45%),
    radial-gradient(ellipse 60% 80% at 10% 80%, rgba(255, 171, 0, 0.06), transparent 45%);
  animation: bgPulse 12s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.talktime .app-shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.talktime .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.talktime .app-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.talktime .mode-switch {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  backdrop-filter: blur(12px);
}

.talktime .mode-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.talktime .mode-btn:hover {
  color: var(--text-primary);
}

.talktime .mode-btn.active {
  background: rgba(0, 229, 204, 0.2);
  color: var(--accent-cyan);
}

.talktime .speaker-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.talktime .speaker-select-wrap label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.talktime .speaker-select {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Center: rectangular waveform module */
.talktime .viz-module {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.talktime .viz-module.recording {
  box-shadow: 0 0 0 2px var(--rec-red), 0 0 24px rgba(255, 59, 92, 0.3);
  animation: recPulse 1.5s ease-in-out infinite;
}

@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--rec-red), 0 0 24px rgba(255, 59, 92, 0.3); }
  50% { box-shadow: 0 0 0 3px var(--rec-red), 0 0 32px rgba(255, 59, 92, 0.5); }
}

.talktime .viz-canvas-wrap {
  width: 100%;
  height: 200px;
  position: relative;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.talktime .viz-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.talktime .rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--rec-red);
  margin-bottom: 0.75rem;
}

.talktime .rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rec-red);
  animation: recBlink 1s step-end infinite;
}

@keyframes recBlink {
  50% { opacity: 0.4; }
}

.talktime .timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.5rem 0;
}

.talktime .ctrl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.talktime .recording-tip {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 229, 204, 0.08);
  border: 1px solid rgba(0, 229, 204, 0.2);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.talktime .btn-primary {
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  background: linear-gradient(135deg, var(--accent-cyan), #00b8a3);
  color: #0a0a0f;
}

.talktime .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 229, 204, 0.35);
}

.talktime .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.talktime .btn-danger {
  background: linear-gradient(135deg, var(--rec-red), #cc2f4a);
  color: #fff;
}

.talktime .btn-danger:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(255, 59, 92, 0.35);
}

/* Mode B: file upload */
.talktime .upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.talktime .upload-zone:hover,
.talktime .upload-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 204, 0.05);
}

.talktime .upload-zone input {
  display: none;
}

.talktime .upload-zone .hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Mode C: URL */
.talktime .url-input-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.talktime .url-input-wrap input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.talktime .url-input-wrap input::placeholder {
  color: var(--text-muted);
}

/* Status / results panel */
.talktime .status-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1rem;
  backdrop-filter: blur(12px);
}

.talktime .status-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.talktime .results-dashboard {
  margin-top: 1rem;
}

.talktime .results-dashboard h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.talktime .result-total {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.talktime .speaker-row {
  margin-bottom: 1rem;
}

.talktime .speaker-row .label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.talktime .speaker-row .name {
  font-weight: 600;
}

.talktime .speaker-row .time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.talktime .progress-bar-wrap {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.talktime .progress-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.talktime .actions-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.talktime .btn-secondary {
  padding: 0.5rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.talktime .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Processing overlay */
.talktime .processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
}

.talktime .shimmer {
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.talktime .hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .talktime .top-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .talktime .mode-switch {
    justify-content: center;
  }
  .talktime .viz-module {
    padding: 1.25rem;
  }
}
