:root {
  --bg-primary: #0b0f19;
  --bg-surface: #151c2c;
  --bg-card: #1e293b;
  --border-color: #334155;

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-danger: #ef4444;
  --accent-danger-hover: #dc2626;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(21, 28, 44, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.logo-icon {
  font-size: 1.4rem;
  color: var(--accent-primary);
}

.brand h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

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

.connection-badge.connected .status-dot {
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

/* Views */
.main-content {
  flex: 1;
  position: relative;
}

.view-section {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Control Panel */
.control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.input-group i {
  color: var(--accent-primary);
}

.input-group input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
}

.recording-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-record {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-record:not(:disabled):active {
  transform: scale(0.98);
}

.btn-stop {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
}

.btn-secondary {
  background: var(--accent-primary);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-sub);
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Outfit', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 1px;
}

.pulse-ring {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-danger);
  animation: pulse 1.5s infinite;
}

.pulse-ring.hidden {
  display: none;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Timeline */
.timeline-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 420px;
}

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

.timeline-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-sub);
}

.badge {
  font-size: 0.75rem;
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.timeline-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
  padding: 20px;
}

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.4;
}

.timeline-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lang-tag {
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.live-tag {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseLive 1s infinite alternate;
}

@keyframes pulseLive {
  from { opacity: 0.8; }
  to { opacity: 1; text-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
}

.interim-item {
  border-left: 3px solid #f87171;
  background: rgba(30, 41, 59, 0.6);
}

.interim-text {
  color: #93c5fd;
  font-style: italic;
}

.original-text {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-main);
}

.translated-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #93c5fd;
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
  margin-top: 2px;
}

/* Minutes View */
.minutes-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.minutes-actions {
  display: flex;
  gap: 10px;
}

.minutes-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 350px;
}

.markdown-body {
  color: var(--text-sub);
  line-height: 1.6;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--text-main);
  margin-top: 16px;
  margin-bottom: 8px;
}

.markdown-body ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Header Right & Icon Button */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  transform: rotate(30deg);
}

.processing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.processing-indicator.hidden {
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  box-shadow: var(--shadow-glow);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.25s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

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

.form-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
}

.form-group label a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: normal;
  font-size: 0.8rem;
}

.form-group input,
.form-group select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
}

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

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: rgba(255, 255, 255, 0.02);
}

