/* ============================================================
   Roost Dashboard — matches landing page design tokens
   ============================================================ */

/* App layout */
.app-body {
  min-height: 100vh;
  background: var(--bg);
}

/* ── NAV ─────────────────────────────────────────────────── */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links { display: flex; gap: 8px; align-items: center; }

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--fg);
  background: var(--card-bg);
}
.nav-link-ghost {
  border: 1px solid var(--card-border);
  font-size: 13px;
}

/* ── MAIN ─────────────────────────────────────────────────── */
.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 88px 24px 80px;
}

/* ── SETUP PANEL ──────────────────────────────────────────── */
.setup-header {
  text-align: center;
  margin-bottom: 48px;
}

.setup-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--card-border);
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--accent-glow);
  margin-bottom: 20px;
}

.setup-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.setup-desc {
  font-size: 1.05rem;
  color: var(--fg-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
}

.setup-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-group { display: flex; flex-direction: column; gap: 10px; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12px; }

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  width: fit-content;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-warm);
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.stepper-btn:hover { background: var(--accent-glow); border-color: var(--accent); }

.stepper-val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 40px;
  text-align: center;
}

/* Budget input */
.budget-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  gap: 4px;
}
.budget-prefix {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}
.budget-input {
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  width: 120px;
}
.budget-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Diet chips */
.diet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diet-chip {
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid var(--card-border);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.diet-chip:hover { border-color: var(--accent); color: var(--accent-soft); }
.diet-chip-active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-soft);
}

/* Generate button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #0d1117;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 18px 40px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: -0.01em;
}
.btn-generate:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-generate:active { transform: scale(0.98); }

.btn-icon { font-size: 1.2rem; }

/* ── GENERATING ───────────────────────────────────────────── */
.generating-section {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.generating-inner {
  text-align: center;
  position: relative;
}

.pulse-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: pulse-ring 2s ease-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -70%);
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -70%) scale(0.8); opacity: 0.5; }
  100% { transform: translate(-50%, -70%) scale(1.6); opacity: 0; }
}

.generating-icon { font-size: 3rem; margin-bottom: 20px; }

.generating-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.generating-desc { color: var(--fg-muted); margin-bottom: 40px; }

.gen-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

.gen-step {
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: 14px;
  color: var(--fg-muted);
  transition: all 0.3s;
}
.gen-step.active {
  border-color: var(--accent);
  color: var(--accent-soft);
  background: var(--accent-glow);
}
.gen-step.done {
  border-color: rgba(240, 165, 0, 0.3);
  color: var(--fg-muted);
}
.gen-step.done::before { content: '✓ '; color: var(--accent); }

/* ── RESULTS ─────────────────────────────────────────────── */
.results-header {
  margin-bottom: 32px;
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.results-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--card-border);
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent-glow);
}

.results-week {
  font-size: 13px;
  color: var(--fg-muted);
}

.results-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.3;
}

.results-actions { display: flex; gap: 10px; }

.btn-primary {
  padding: 10px 20px;
  background: var(--accent);
  color: #0d1117;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  padding: 10px 20px;
  background: var(--card-bg);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--fg); }

/* Cost bar */
.cost-bar {
  display: flex;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.cost-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  border-right: 1px solid var(--card-border);
}
.cost-item:last-child { border-right: none; }

.cost-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.cost-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.over-budget { color: #ff6b6b !important; }

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 6px;
  border-radius: 12px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.tab-active {
  background: var(--accent);
  color: #0d1117;
  font-weight: 700;
}

/* Days grid */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.day-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.day-card:hover { border-color: var(--accent); }

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(240, 165, 0, 0.04);
}

.day-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-soft);
}

.day-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
}

.meals-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.meal-item {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(240, 165, 0, 0.06);
}
.meal-item:last-child { border-bottom: none; }

.meal-time-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.meal-icon { font-size: 14px; }
.meal-time-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--fg-muted); flex: 1; }
.meal-cost { font-size: 12px; color: var(--fg-muted); }

.meal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
}

.meal-desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}

.meal-prep { font-size: 11px; color: var(--fg-muted); }

/* Grocery list */
.grocery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.grocery-category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.grocery-cat-header {
  padding: 12px 18px;
  background: rgba(240, 165, 0, 0.06);
  border-bottom: 1px solid var(--card-border);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-soft);
  letter-spacing: 0.02em;
}

.grocery-items-list {
  list-style: none;
  padding: 8px 0;
}

.grocery-item {
  padding: 6px 18px;
  transition: background 0.15s;
}
.grocery-item:hover { background: rgba(240, 165, 0, 0.04); }
.grocery-item-checked .grocery-item-name {
  text-decoration: line-through;
  opacity: 0.4;
}

.grocery-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.grocery-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.grocery-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--fg);
  transition: opacity 0.2s;
}

.grocery-item-qty {
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
}

.grocery-item-cost {
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
  min-width: 48px;
  text-align: right;
}

.grocery-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── ERROR ────────────────────────────────────────────────── */
.error-section {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-inner {
  text-align: center;
  max-width: 360px;
}

.error-icon { font-size: 3rem; margin-bottom: 16px; }
.error-inner h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.error-inner p { color: var(--fg-muted); margin-bottom: 24px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-main { padding: 76px 16px 60px; }
  .setup-form { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .cost-bar { flex-direction: column; }
  .cost-item { border-right: none; border-bottom: 1px solid var(--card-border); }
  .cost-item:last-child { border-bottom: none; }
  .app-nav { padding: 0 16px; }
  .results-actions { flex-direction: column; }
}
