:root {
  --bg-primary: #08080c;
  --bg-surface: #111118;
  --bg-elevated: #1a1a24;
  --accent: #e8913a;
  --accent-glow: rgba(232, 145, 58, 0.15);
  --text-primary: #f0ece6;
  --text-secondary: #8a8694;
  --text-muted: #5a5666;
  --border: #1e1e2a;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; }

.app-container { max-width: 800px; margin: 0 auto; padding: 40px 24px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.logo { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: var(--text-primary); }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }

.page-header { margin-bottom: 40px; }
.page-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.page-header p { color: var(--text-secondary); font-size: 16px; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-surface);
  margin-bottom: 32px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.upload-zone.has-file { border-color: var(--accent); border-style: solid; }
.upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-zone h3 { font-size: 18px; margin-bottom: 8px; }
.upload-zone p { color: var(--text-secondary); font-size: 14px; }
#file-input { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary {
  background: var(--accent);
  color: #08080c;
  width: 100%;
  justify-content: center;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: 8px;
}
.file-info .file-name { font-weight: 600; flex: 1; text-align: left; }
.file-info .file-size { color: var(--text-muted); font-size: 13px; }
.file-info .remove-file { color: var(--text-muted); cursor: pointer; font-size: 18px; }
.file-info .remove-file:hover { color: var(--text-primary); }

.results { margin-top: 48px; }
.results h2 { font-size: 22px; margin-bottom: 24px; }

.result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.result-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--accent); }
.result-card p { color: var(--text-secondary); font-size: 15px; line-height: 1.7; }

.clips-grid { display: flex; flex-direction: column; gap: 12px; }
.clip-item {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.clip-badge {
  background: var(--accent);
  color: #08080c;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.clip-label { font-weight: 600; margin-bottom: 4px; }
.clip-reason { color: var(--text-muted); font-size: 13px; }

.timestamps { display: flex; flex-direction: column; gap: 8px; }
.timestamp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.timestamp-item .time { color: var(--accent); font-weight: 600; font-family: 'Space Grotesk', monospace; }
.timestamp-item .label { color: var(--text-secondary); }

.transcript-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
  max-height: 400px;
  overflow-y: auto;
}
.transcript-block h3 { font-size: 16px; margin-bottom: 16px; color: var(--accent); }
.transcript-block p { color: var(--text-secondary); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

.loading-state {
  text-align: center;
  padding: 48px 0;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { color: var(--text-secondary); }

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 16px;
  color: #fca5a5;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .app-container { padding: 24px 16px; }
  .upload-zone { padding: 40px 20px; }
  .clip-item { flex-direction: column; gap: 8px; }
}