/* app.css — NookGuide app UI styles
 * Imports the same design tokens as theme.css.
 * Covers: header, generator form, guide view, shared buttons.
 */

/* ==================== HEADER ==================== */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-link {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
}

.btn-link:hover { color: var(--fg); }

/* ==================== BUTTONS ==================== */

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover {
  border-color: var(--fg-muted);
  background: var(--bg-warm);
}

.btn-large {
  padding: 14px 32px;
  font-size: 1rem;
}

/* Hero CTA additions */
.hero-cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-hero {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px rgba(200, 85, 61, 0.25);
}

.btn-hero:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(200, 85, 61, 0.3);
}

.hero-cta-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 300;
}

/* ==================== GENERATOR FORM ==================== */

.app-main {
  min-height: calc(100vh - 60px);
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 80px;
}

.generator-wrap {
  width: 100%;
  max-width: 640px;
}

.gen-header {
  text-align: center;
  margin-bottom: 48px;
}

.gen-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 12px;
}

.gen-sub {
  font-size: 1.05rem;
  color: var(--fg-muted);
  font-weight: 300;
}

.gen-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
}

.field-required {
  font-weight: 400;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.field-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg);
  background: white;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 85, 61, 0.12);
}

.field-input::placeholder {
  color: var(--fg-muted);
  opacity: 0.55;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-weight: 300;
}

/* Vibe checkboxes */
.vibes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.vibe-check {
  cursor: pointer;
}

.vibe-check input[type="checkbox"] {
  display: none;
}

.vibe-check-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: white;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  user-select: none;
}

.vibe-check:hover .vibe-check-inner {
  border-color: var(--accent-light);
  background: var(--accent-bg);
}

.vibe-check input:checked + .vibe-check-inner {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 2px rgba(200, 85, 61, 0.15);
  transform: translateY(-1px);
}

.vibe-check-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.vibe-check-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}

/* Form error */
.form-error {
  background: #fef0ec;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

/* Generate button */
.btn-generate {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(200, 85, 61, 0.2);
}

.btn-generate:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200, 85, 61, 0.28);
}

.btn-generate:active {
  transform: translateY(0);
}

/* ==================== LOADING STATE ==================== */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 40px 0;
}

.loading-pulse {
  position: relative;
  width: 72px;
  height: 72px;
}

.loading-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

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

.loading-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--fg);
}

.loading-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  font-weight: 300;
  max-width: 420px;
  line-height: 1.65;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.loading-step {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: white;
  border: 1.5px solid var(--card-border);
  transition: all 0.3s ease;
  text-align: left;
}

.loading-step.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
  transform: translateX(4px);
}

/* ==================== GUIDE VIEW ==================== */

.guide-page {
  background: var(--bg);
}

.guide-main {
  min-height: calc(100vh - 60px);
}

.guide-hero {
  padding: 64px 24px 56px;
  background: linear-gradient(175deg, var(--bg) 0%, var(--bg-warm) 60%, var(--accent-bg) 100%);
  text-align: center;
}

.guide-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.guide-vibes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.vibe-pill {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  padding: 4px 14px;
}

.guide-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 16px;
}

.guide-title em {
  font-style: italic;
  color: var(--accent);
}

.guide-address {
  font-size: 1rem;
  color: var(--fg-muted);
  font-weight: 400;
  margin-bottom: 4px;
}

.guide-city {
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 300;
}

/* Spots grid */
.guide-content {
  padding: 60px 24px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.spots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.spot-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.spot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(44, 36, 25, 0.07);
}

.spot-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  min-width: 44px;
  padding-top: 2px;
}

.spot-body {
  flex: 1;
}

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

.spot-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.spot-distance {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.spot-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.25;
}

.spot-description {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 12px;
}

.spot-tip {
  background: var(--accent-bg);
  border-left: 2.5px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
}

.tip-label {
  font-weight: 700;
  color: var(--accent);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 2px;
}

.tip-text {
  color: var(--fg);
  line-height: 1.5;
}

/* Guide footer CTA */
.guide-footer-cta {
  padding: 60px 24px;
  background: var(--fg);
  text-align: center;
}

.guide-footer-label {
  font-size: 0.85rem;
  color: rgba(250,247,242,0.5);
  margin-bottom: 24px;
  font-weight: 300;
}

.guide-footer-cta .btn-primary {
  background: var(--accent);
  margin-right: 12px;
}

.guide-footer-cta .btn-secondary {
  background: transparent;
  color: rgba(250,247,242,0.8);
  border-color: rgba(250,247,242,0.25);
}

.guide-footer-cta .btn-secondary:hover {
  background: rgba(250,247,242,0.08);
  border-color: rgba(250,247,242,0.5);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .app-header {
    padding: 0 20px;
  }

  .app-main {
    padding: 40px 16px 60px;
  }

  .vibes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .spots-grid {
    grid-template-columns: 1fr;
  }

  .guide-content {
    padding: 40px 16px 60px;
  }

  .guide-hero {
    padding: 48px 16px 40px;
  }

  .header-actions .btn-primary {
    font-size: 0.82rem;
    padding: 8px 14px;
  }
}

/* ==================== AUTH PAGES ==================== */

.auth-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px 36px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 28px;
  font-weight: 300;
}

.auth-toggle-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle-link:hover {
  text-decoration: underline;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==================== DASHBOARD ==================== */

.dashboard-main {
  min-height: calc(100vh - 60px);
  background: var(--bg);
  padding: 48px 24px 80px;
}

.dashboard-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.dashboard-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  font-weight: 300;
}

.header-user-name {
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 400;
}

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

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(44, 36, 25, 0.07);
}

.dashboard-card-top {
  margin-bottom: 4px;
}

.dashboard-card-vibes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vibe-pill-sm {
  font-size: 10px;
  padding: 3px 10px;
}

.vibe-pill-more {
  background: var(--bg-warm);
  border-color: var(--card-border);
  color: var(--fg-muted);
}

.dashboard-card-neighborhood {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.25;
}

.dashboard-card-address {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 300;
}

.dashboard-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.dashboard-card-date {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.dashboard-card-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

/* Dashboard empty state */
.dashboard-empty {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  font-size: 3rem;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--fg);
}

.empty-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  font-weight: 300;
  max-width: 320px;
}

/* ==================== VIBES GRID VARIANTS ==================== */

.vibes-grid-5col {
  grid-template-columns: repeat(5, 1fr);
}

/* ==================== GUIDE PDF CTA EXTRAS ==================== */

.pdf-cta-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: rgba(250,247,242,0.95);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.pdf-cta-sub {
  font-size: 1rem;
  color: rgba(250,247,242,0.6);
  font-weight: 300;
  max-width: 420px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.pdf-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pdf-btn-locked {
  position: relative;
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.pdf-save-note {
  margin-top: 20px;
  font-size: 0.88rem;
  color: rgba(250,247,242,0.5);
  font-weight: 300;
}

.gen-save-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 300;
  margin-top: -8px;
}

/* ==================== RESPONSIVE ADDITIONS ==================== */

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vibes-grid-5col {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .vibes-grid-5col {
    grid-template-columns: repeat(3, 1fr);
  }
  .auth-card {
    padding: 28px 20px;
  }
  .dashboard-main {
    padding: 32px 16px 60px;
  }
  .pdf-cta-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin: 0 auto;
  }
}
