/* generator.css — TapForge AI Landing Page Generator UI */

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-2: #1a1a24;
  --border: #2a2a3a;
  --accent: #f97316;
  --accent-dim: #f9731622;
  --accent-light: #fb923c;
  --text: #f1f5f9;
  --muted: #71717a;
  --success: #22c55e;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 10px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Generator Page Header */
.gen-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}

.gen-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
}

.gen-header p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* Form */
.gen-form {
  padding: 48px 0 32px;
}

.field {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.niche-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.niche-btn {
  flex: 1;
  min-width: 120px;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
}

.niche-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.niche-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-light);
}

textarea {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 16px;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea::placeholder {
  color: var(--muted);
}

.gen-submit {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.gen-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.gen-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status messages */
.status-bar {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.status-bar.loading {
  display: block;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.status-bar.success {
  display: block;
  background: #052e16;
  color: #4ade80;
  border: 1px solid #10b98144;
}

.status-bar.error {
  display: block;
  background: #2d0a0a;
  color: #f87171;
  border: 1px solid #ef444444;
}

/* Preview panel */
.preview-panel {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}

.preview-panel.visible {
  display: block;
}

.preview-bar {
  background: var(--surface);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.preview-bar span {
  font-size: 0.875rem;
  color: var(--muted);
}

.preview-bar a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

.preview-bar a:hover {
  text-decoration: underline;
}

.preview-iframe {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
}

/* History section */
.history {
  padding: 32px 0 60px;
}

.history h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
}

.history-item:hover {
  border-color: var(--accent);
}

.history-item-left {
  flex: 1;
  min-width: 0;
}

.history-item-prompt {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.niche-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.niche-tag.saas { background: #6366f122; color: #818cf8; }
.niche-tag.gaming { background: #f9731622; color: #fb923c; }
.niche-tag.finance { background: #10b98122; color: #34d399; }

/* Spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}