:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #232736;
  --border: #2d3148;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --text: #e8eaf6;
  --text-muted: #8b90a0;
  --success: #4caf82;
  --error: #ef5350;
  --curiosite: #6c63ff;
  --emotion: #e91e8c;
  --provocation: #ff6b2b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header { text-align: center; }
header h1 { font-size: 2rem; font-weight: 700; }
.subtitle { color: var(--text-muted); margin-top: 0.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); }
.drop-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.drop-preview { display: flex; align-items: center; gap: 0.5rem; justify-content: center; }
.file-icon { font-size: 1.5rem; }
.remove-btn { color: var(--error) !important; }

/* Options */
.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.option-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); }
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

/* Progress */
.progress-steps { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.step {
  padding: 0.6rem 1rem;
  background: var(--surface2);
  border-radius: 6px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.3s;
}
.step.active {
  border-left-color: var(--accent);
  color: var(--text);
  background: rgba(108, 99, 255, 0.1);
}
.step.done {
  border-left-color: var(--success);
  color: var(--success);
}

/* Hooks grid */
.hooks-grid { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.hook-card {
  background: var(--surface2);
  border-radius: 8px;
  padding: 1rem;
  border-left: 4px solid var(--border);
}
.hook-card.curiosite { border-left-color: var(--curiosite); }
.hook-card.emotion { border-left-color: var(--emotion); }
.hook-card.provocation { border-left-color: var(--provocation); }

.hook-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.hook-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.hook-reasoning { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.hook-actions { display: flex; gap: 0.5rem; }
.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.copy-btn:hover { border-color: var(--accent); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

/* Context details */
.context-details { margin-bottom: 1rem; }
.context-details summary { cursor: pointer; color: var(--text-muted); font-size: 0.9rem; }
.context-content { margin-top: 0.75rem; }
.context-content h3 { font-size: 0.85rem; color: var(--text-muted); margin: 0.75rem 0 0.25rem; }
.context-content p { font-size: 0.85rem; background: var(--surface2); padding: 0.5rem; border-radius: 4px; }

/* Error card */
.error-card { border-color: var(--error); }
.error-card h2 { color: var(--error); }

/* History */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.history-item:last-child { border-bottom: none; }
.history-meta { color: var(--text-muted); font-size: 0.75rem; }
.status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.status-completed { background: rgba(76, 175, 130, 0.2); color: var(--success); }
.status-failed { background: rgba(239, 83, 80, 0.2); color: var(--error); }
.status-pending, .status-extracting, .status-transcribing,
.status-analyzing_visual, .status-generating_hooks {
  background: rgba(108, 99, 255, 0.2);
  color: var(--accent);
}

@media (max-width: 480px) {
  .options { grid-template-columns: 1fr; }
}
