/* ==========================================
   EMBARK — App Styles (non-landing pages)
   ========================================== */

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: block;
  margin-bottom: 32px;
}

.auth-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 8px;
}

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

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

.auth-switch {
  margin-top: 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* App nav */
.app-nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 8vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-user { color: var(--fg-muted); font-size: 0.85rem; }

/* App main */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 8vw;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--fg);
}

.section-title-sm {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 20px;
}

.section-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  margin-top: -24px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--fg);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}
.btn-outline:hover { border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { color: var(--fg); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-danger { color: #e05c5c; }
.btn-danger:hover { color: #ff7b7b; }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.alert-error { background: rgba(220, 80, 80, 0.15); border: 1px solid rgba(220, 80, 80, 0.3); color: #e05c5c; }
.alert-success { background: rgba(80, 200, 120, 0.15); border: 1px solid rgba(80, 200, 120, 0.3); color: #6fcf8a; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; color: var(--fg-muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.form-group input, .form-group select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 1rem;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

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

.add-flight-form { display: flex; flex-direction: column; gap: 24px; max-width: 560px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}
.empty-icon { color: var(--fg-muted); margin-bottom: 24px; }
.empty-state h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.6rem; font-weight: 400; color: var(--fg); margin-bottom: 12px; }
.empty-state p { color: var(--fg-muted); margin-bottom: 32px; }

/* Flight cards */
.flights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.flight-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flight-route { display: flex; align-items: center; gap: 10px; }
.airport-code {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
}
.route-arrow { color: var(--accent); font-size: 1.2rem; }
.flight-number { color: var(--fg-muted); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.flight-date { color: var(--fg-muted); font-size: 0.85rem; }
.flight-price { display: flex; align-items: baseline; gap: 8px; }
.price-label { color: var(--fg-muted); font-size: 0.75rem; }
.price-value { font-size: 1.1rem; font-weight: 600; color: var(--fg); }
.price-down { color: #6fcf8a !important; }
.flight-status { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.checked-at { color: var(--fg-muted); font-size: 0.75rem; }

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}
.status-active { background: rgba(80, 200, 120, 0.15); color: #6fcf8a; }
.status-cancelled { background: rgba(220, 80, 80, 0.15); color: #e05c5c; }
.status-inactive { background: rgba(245, 240, 232, 0.08); color: var(--fg-muted); }

.flight-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Check flights button */
.check-flights-section { border-top: 1px solid var(--border); padding-top: 32px; display: flex; align-items: center; gap: 16px; }
.check-status { color: var(--fg-muted); font-size: 0.9rem; }

/* Detail page */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 40px; }
.detail-route { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.airport-code-lg { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 3rem; font-weight: 300; color: var(--fg); }
.route-arrow-lg { color: var(--accent); font-size: 1.5rem; }
.detail-flight-number { color: var(--fg-muted); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.detail-date { color: var(--fg-muted); font-size: 0.9rem; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 48px; }
.detail-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.detail-card-label { color: var(--fg-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.detail-card-value { font-size: 1.4rem; font-weight: 600; color: var(--fg); }

/* Price history chart */
.price-history-section, .notifications-section { margin-bottom: 40px; }
.price-chart { display: flex; flex-direction: column; gap: 12px; }
.price-row { display: flex; align-items: center; gap: 12px; }
.price-date { color: var(--fg-muted); font-size: 0.8rem; width: 80px; flex-shrink: 0; }
.price-bar { height: 8px; background: var(--accent-dim); border-radius: 4px; min-width: 4px; max-width: 200px; }
.price-amt { font-size: 0.85rem; font-weight: 500; width: 60px; text-align: right; }

/* Notifications */
.notification-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.notification-type { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--accent-dim); padding: 3px 8px; border-radius: 100px; }
.notification-msg { flex: 1; color: var(--fg-muted); font-size: 0.85rem; }
.notification-date { color: var(--fg-muted); font-size: 0.75rem; }

.remove-flight-form { margin-top: 48px; }

.result-area { margin-top: 20px; }

/* Booking cards on dashboard */
.bookings-section { margin-bottom: 0; }
.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.booking-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}
.booking-card:hover { border-color: var(--accent); }
.booking-card-header { display: flex; align-items: center; justify-content: space-between; }
.booking-icon { font-size: 1.2rem; }
.booking-state-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
}
.booking-state-badge.state-booked,
.booking-state-badge.state-monitored { background: rgba(80, 200, 120, 0.15); color: #6fcf8a; }
.booking-state-badge.state-rebook_eligible { background: rgba(245, 200, 66, 0.15); color: #f5c842; }
.booking-state-badge.state-searching { background: rgba(120, 100, 220, 0.15); color: #a08af5; }
.booking-date { color: var(--fg-muted); font-size: 0.85rem; }
.booking-budget { display: flex; align-items: baseline; gap: 8px; }
.booking-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Responsive */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .detail-header { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}