/* ============ THEME TOKENS ============ */
:root {
  /* Light mode tokens */
  --body-bg: radial-gradient(circle at top left, #eef2ff, transparent 55%),
    radial-gradient(circle at bottom right, #f5f3ff, transparent 60%),
    linear-gradient(135deg, #f9fafb, #ffffff);

  --card-bg: #ffffff;
  --card-bg-soft: rgba(255, 255, 255, 0.92);
  --primary: #4f46e5;
  --primary-soft: #e0e7ff;
  --primary-strong: #4338ca;
  --accent-green: #22c55e;

  --border-subtle: #e5e7eb;
  --border-strong: #c7d2fe;

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;

  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-chip: 0 8px 20px rgba(15, 23, 42, 0.06);

  --radius-lg: 22px;
}

/* Dark theme override */
:root[data-theme="dark"] {
  --body-bg: radial-gradient(circle at top left, #111827, transparent 55%),
    radial-gradient(circle at bottom right, #020617, transparent 60%),
    linear-gradient(135deg, #020617, #020617);

  --card-bg: #020617;
  --card-bg-soft: rgba(15, 23, 42, 0.98);
  --primary: #a5b4fc;
  --primary-soft: #1e293b;
  --primary-strong: #6366f1;
  --accent-green: #22c55e;

  --border-subtle: #1f2937;
  --border-strong: #4b5563;

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.7);
  --shadow-chip: 0 8px 20px rgba(15, 23, 42, 0.9);
}

/* ============ RESET ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  min-height: 100vh;
  color: var(--text-main);
  background: var(--body-bg);
  transition: background 0.25s ease, color 0.25s ease;
}

.app {
  min-height: 100vh;
}

/* ============ HEADER ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.9);
  transition: background 0.25s ease, border-color 0.25s ease;
}

/* dark header background */
:root[data-theme="dark"] .app-header {
  background: rgba(15, 23, 42, 0.9);
  border-bottom-color: rgba(30, 64, 175, 0.6);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* brand pill */
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-bg-soft);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: conic-gradient(
    from 150deg,
    #6366f1,
    #a855f7,
    #ec4899,
    #6366f1
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-size: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ THEME TOGGLE ============ */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  font-size: 12px;
  background: var(--card-bg-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  box-shadow: var(--shadow-chip);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.1s ease;
}

.theme-toggle-icon {
  font-size: 14px;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--primary-soft);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 3px;
}

/* ============ MAIN LAYOUT ============ */
.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 18px 40px;
}

/* ============ INPUT CARD ============ */
.input-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(229, 231, 235, 0.9);
  padding: 24px 22px 22px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* dark border tweak */
:root[data-theme="dark"] .input-card {
  border-color: var(--border-subtle);
}

.input-header {
  margin-bottom: 14px;
}

.input-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.input-helper {
  font-size: 13px;
  color: var(--text-muted);
}

/* Textarea */
.goal-input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  font-size: 14px;
  min-height: 110px;
  resize: vertical;
  background: #f9fafb;
  outline: none;
  color: var(--text-main);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

:root[data-theme="dark"] .goal-input {
  background: #020617;
  border-color: #1f2937;
}

.goal-input::placeholder {
  color: var(--text-soft);
}

.goal-input:focus-visible {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.25);
}

.input-footnote {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

/* ============ LLM PILL GROUP ============ */
.llm-section {
  margin-top: 18px;
}

.llm-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.llm-helper {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.llm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* pill button */
.llm-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  background: #f9fafb;
  box-shadow: var(--shadow-chip);
  font-size: 13px;
  color: var(--text-main);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

:root[data-theme="dark"] .llm-pill {
  background: #020617;
}

.llm-pill input {
  display: none;
}

.llm-pill:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

:root[data-theme="dark"] .llm-pill:hover {
  background: #020617;
}

/* Colored dots */
.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d1d5db;
}

.pill-dot-gpt {
  background: #22c55e;
}

.pill-dot-claude {
  background: #38bdf8;
}

.pill-dot-gemini {
  background: #6366f1;
}

.pill-dot-llama {
  background: #fb923c;
}

.pill-dot-general {
  background: #a855f7;
}

.pill-label {
  white-space: nowrap;
}

/* Selected pill using :has */
.llm-pill:has(input:checked) {
  background: radial-gradient(circle at top left, #eef2ff, #ffffff);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.35);
}

:root[data-theme="dark"] .llm-pill:has(input:checked) {
  background: radial-gradient(circle at top left, #0f172a, #020617);
  border-color: var(--border-strong);
}

/* ============ PRIMARY BUTTON ============ */
.primary-btn {
  margin-top: 22px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #f9fafb;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.55);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.4);
}

.primary-btn:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 3px;
}

.btn-icon,
.btn-icon-arrow {
  font-size: 16px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  margin-top: 18px;
}

.empty-card {
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  background: var(--card-bg-soft);
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(148, 163, 184, 0.15);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--primary-soft);
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 10px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 6px;
}

.empty-footnote {
  font-size: 12px;
  color: var(--text-soft);
  max-width: 520px;
  margin: 0 auto;
}

/* ============ RESULTS SECTION ============ */
.results {
  margin-top: 22px;
}

.results-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.results-header p {
  font-size: 13px;
  color: var(--text-muted);
}

/* cards grid */
.cards-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* ============ PROMPT CARD ============ */
.prompt-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.prompt-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.06), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.prompt-card:hover::before {
  opacity: 1;
}

.prompt-card.recommended {
  border-color: var(--primary);
  box-shadow: 0 18px 40px rgba(129, 140, 248, 0.5);
}

.prompt-card.recommended::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, #a855f7, #6366f1);
}

/* card header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-soft);
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-weight: 600;
}

/* features */
.features-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.features-list {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* generated prompt */
.prompt-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.prompt-text {
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 9px 10px;
  max-height: 190px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.4;
  color: #111827;
}

/* dark prompt text bg */
:root[data-theme="dark"] .prompt-text {
  background: #020617;
  color: #e5e7eb;
}

/* copy button */
.copy-row {
  display: flex;
  justify-content: flex-end;
}

.copy-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 6px 11px;
  font-size: 12px;
  background: #f9fafb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #374151;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.1s ease;
}

:root[data-theme="dark"] .copy-btn {
  background: #020617;
  color: #e5e7eb;
}

.copy-btn:hover {
  background: #eef2ff;
  border-color: var(--border-strong);
  transform: translateY(-0.5px);
}

:root[data-theme="dark"] .copy-btn:hover {
  background: #020617;
}

/* ============ UTILITIES ============ */
.hidden {
  display: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .app-main {
    padding-top: 22px;
  }

  .input-card {
    padding: 20px 16px 18px;
  }

  .brand-pill {
    padding-inline: 12px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}
