/* ============================================================
   AI Image Generator - Styles
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --bg-card: #141416;
  --bg-card-hover: #1a1a1e;
  --border: #2a2a2e;
  --border-focus: #6366f1;
  --text: #f5f5f7;
  --text-muted: #8b8b94;
  --text-dim: #5c5c66;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --green: #22c55e;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 80px 0 40px;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-hover);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

/* ============================================================
   GENERATOR CARD
   ============================================================ */
.generator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 720px;
  margin: 0 auto 24px;
}

.input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.input-row input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-row input::placeholder {
  color: var(--text-dim);
}

.input-row button {
  padding: 14px 28px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 140px;
}

.input-row button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.input-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* Prompt hints */
.prompt-hints {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-label {
  font-size: 13px;
  color: var(--text-dim);
}

.hint-chip {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.hint-chip:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-glow);
}

/* Result area */
#resultArea {
  margin-top: 24px;
  text-align: center;
}

#generatedImage img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

#resultInfo {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

#resultInfo .revised-prompt {
  font-style: italic;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

/* Error area */
#errorArea {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 14px;
}

/* Rate limit info */
.rate-info {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* Trust line */
.trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.trust-line .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-section {
  padding: 80px 0;
}

.gallery-section h2,
.how-section h2,
.comparison-section h2,
.cta-section h2 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.gallery-item .gallery-caption {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how-section {
  padding: 80px 0;
  background: var(--bg-card);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.step-card {
  text-align: center;
  padding: 32px 24px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 2px solid var(--accent);
  color: var(--accent-hover);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================
   COMPARISON
   ============================================================ */
.comparison-section {
  padding: 80px 0;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.compare-card {
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.compare-card.positive {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
  position: relative;
}

.compare-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 100px;
}

.compare-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.compare-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--red);
}

.compare-price.free {
  color: var(--green);
}

.compare-card ul {
  list-style: none;
  margin-bottom: 16px;
}

.compare-card ul li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.compare-card.negative ul li::before {
  content: "\2717 ";
  color: var(--red);
  margin-right: 6px;
}

.compare-card.positive ul li::before {
  content: "\2713 ";
  color: var(--green);
  margin-right: 6px;
}

.compare-cta {
  display: block;
  text-align: center;
  padding: 12px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.compare-cta:hover {
  background: var(--accent-hover);
}

/* ============================================================
   WAITLIST / CTA
   ============================================================ */
.cta-section {
  padding: 80px 0;
  background: var(--bg-card);
  text-align: center;
}

.waitlist-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto 12px;
}

.waitlist-form input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.waitlist-form input:focus {
  border-color: var(--border-focus);
}

.waitlist-form button {
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.waitlist-form button:hover {
  background: var(--accent-hover);
}

#waitlistMessage {
  min-height: 24px;
  font-size: 14px;
}

#waitlistMessage .success {
  color: var(--green);
}

#waitlistMessage .error {
  color: var(--red);
}

.waitlist-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hero { padding: 48px 0 24px; }

  .input-row {
    flex-direction: column;
  }

  .input-row button {
    min-width: auto;
  }

  .steps-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-card.positive {
    order: -1;
  }

  .trust-line {
    flex-wrap: wrap;
    gap: 8px;
  }

  .trust-line .dot { display: none; }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .waitlist-form {
    flex-direction: column;
  }

  .footer-content {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ============================================================
   IMAGE MODAL (for gallery)
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
}

.modal-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}

.modal-prompt {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  max-width: 600px;
  text-align: center;
  z-index: 1001;
}
