/* Passage — Styles */
/* Clean, minimal, focused */

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a25;
  --text: #e8e8ed;
  --text-subtle: #8888a0;
  --accent: #7c5ce0;
  --accent-hover: #9070f0;
  --success: #4caf50;
  --error: #e05050;
  --border: #2a2a3a;
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.container.wide {
  max-width: 900px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.tagline {
  color: var(--text-subtle);
  font-style: italic;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  margin-top: 1rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 1rem 0;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(124, 92, 224, 0.05);
}

.dropzone-content p {
  margin: 0.5rem 0;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}

.subtle {
  color: var(--text-subtle);
  font-size: 0.875rem;
}

.formats {
  color: var(--text-subtle);
  font-size: 0.75rem;
  margin-top: 1rem !important;
}

/* File info */
.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-hover);
  border-radius: var(--radius);
  margin: 1rem 0;
}

.file-info .btn-secondary {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* Memories section */
.memories-section {
  margin: 1rem 0;
}

.memories-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text-subtle);
  cursor: pointer;
  width: 100%;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.memories-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.memories-toggle.active {
  border-style: solid;
  border-color: var(--accent);
  color: var(--text);
}

.toggle-icon {
  font-size: 1.25rem;
  font-weight: 300;
  transition: transform 0.2s;
}

.memories-toggle.active .toggle-icon {
  transform: rotate(45deg);
}

.memories-container {
  margin-top: 0.75rem;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.memories-container .subtle {
  margin-bottom: 0.75rem;
}

.memories-input {
  width: 100%;
  min-height: 150px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  resize: vertical;
}

.memories-input:focus {
  outline: none;
  border-color: var(--accent);
}

.memories-input::placeholder {
  color: var(--text-subtle);
  opacity: 0.7;
}

/* Progress */
.progress-container {
  background: var(--bg);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
}

.progress-steps {
  margin-top: 1.5rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-subtle);
}

.step.active {
  color: var(--text);
}

.step.complete {
  color: var(--success);
}

.step-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
}

.step.complete .step-indicator {
  background: var(--success);
}

.step.active .step-indicator {
  background: var(--accent);
  border-color: var(--accent);
}

/* Tabs */
.tabs-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  padding: 1.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 500;
}

.edit-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

/* Markdown preview */
.markdown-preview {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-height: 500px;
  overflow-y: auto;
}

.markdown-preview h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.markdown-preview h2 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.75rem;
}

.markdown-preview h3 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

.markdown-preview p {
  margin: 0.75rem 0;
}

.markdown-preview ul,
.markdown-preview ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.markdown-preview li {
  margin: 0.25rem 0;
}

.markdown-preview strong {
  color: var(--accent);
}

.markdown-preview blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-subtle);
  font-style: italic;
}

.markdown-preview code {
  background: var(--bg-hover);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
}

.markdown-preview hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Edit area */
.edit-area {
  width: 100%;
  min-height: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  resize: vertical;
}

.edit-area:focus {
  outline: none;
  border-color: var(--accent);
}

/* Actions */
.actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.actions .btn-primary {
  flex: 2;
  margin-top: 0;
}

.actions .btn-secondary {
  flex: 1;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer p {
  margin: 0.25rem 0;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Error state */
#error-section {
  text-align: center;
}

#error-message {
  color: var(--error);
  margin: 1rem 0;
}

#error-section .btn-primary {
  max-width: 200px;
  margin: 1rem auto 0;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .tabs {
    justify-content: flex-start;
  }

  .tab {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn-primary,
  .actions .btn-secondary {
    flex: none;
    width: 100%;
  }
}
