/* Jetway — design system */
/* Fonts loaded in HTML head */

:root {
  --bg-deep: #0a0e1a;
  --bg-mid: #111827;
  --bg-card: #161e2e;
  --bg-card-hover: #1a2540;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --accent-dim: rgba(56, 189, 248, 0.08);
  --warm: #f59e0b;
  --warm-glow: rgba(245, 158, 11, 0.15);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.12);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(148, 163, 184, 0.08);
  --border-accent: rgba(56, 189, 248, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* ── Ambient background ── */
.ambient {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.ambient::before {
  content: '';
  position: absolute; top: -40%; left: -20%;
  width: 80vw; height: 80vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.06) 0%, transparent 70%);
  animation: drift 25s ease-in-out infinite;
}
.ambient::after {
  content: '';
  position: absolute; bottom: -30%; right: -10%;
  width: 60vw; height: 60vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.04) 0%, transparent 70%);
  animation: drift 30s ease-in-out infinite reverse;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5vw, 3vh); }
}

/* ── Layout ── */
.container {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--text-primary); text-decoration: none;
}
.nav-logo svg { color: var(--accent); }
.nav-tagline {
  font-size: 0.75rem; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #0a0e1a;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: #7dd3fc;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-accent); color: var(--accent); }
.btn-danger {
  background: transparent; color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 6px 12px; font-size: 0.8rem;
}
.btn-danger:hover { background: var(--danger-glow); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-refresh {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border-accent); padding: 6px 12px; font-size: 0.8rem;
}
.btn-refresh:hover { background: var(--accent-glow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: rgba(148, 163, 184, 0.15); }
.card-deal {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.04) 100%);
}

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 12px; align-items: end;
}
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase;
}
.field input, .field select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  transition: all 0.2s ease; outline: none;
  width: 100%;
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus, .field select:focus {
  border-color: var(--border-accent);
  background: rgba(56, 189, 248, 0.04);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field select option { background: var(--bg-mid); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
}
.badge-deal {
  background: var(--success-glow); color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}
.badge-over {
  background: var(--danger-glow); color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.badge-airline {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border-accent);
}

/* ── Route cards ── */
.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s ease;
}
.route-card:hover { border-color: rgba(148,163,184,0.2); transform: translateY(-2px); }
.route-card.is-deal {
  border-color: rgba(16,185,129,0.3);
  box-shadow: 0 0 20px rgba(16,185,129,0.07);
}

.route-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.route-airports {
  display: flex; align-items: center; gap: 10px;
}
.airport-code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem; font-weight: 700; color: var(--text-primary);
}
.route-arrow {
  color: var(--accent); font-size: 1.1rem;
}
.route-names {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
}

.price-row {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
}
.price-current {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700;
}
.price-current.is-deal { color: var(--success); }
.price-current.over-budget { color: var(--warm); }
.price-label { font-size: 0.8rem; color: var(--text-muted); }
.budget-label {
  font-size: 0.8rem; color: var(--text-muted);
}

.route-meta {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.route-actions {
  display: flex; gap: 8px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Section headers ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
}
.section-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ── Deals feed ── */
.deals-list { display: flex; flex-direction: column; gap: 10px; }
.deal-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.deal-item:hover { border-color: rgba(148,163,184,0.15); }
.deal-item.is-deal { border-color: rgba(16,185,129,0.2); }
.deal-route {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 0.95rem; min-width: 80px;
}
.deal-airline { font-size: 0.85rem; color: var(--text-secondary); flex: 1; }
.deal-date { font-size: 0.8rem; color: var(--text-muted); }
.deal-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  margin-left: auto;
}
.deal-price.is-deal { color: var(--success); }
.deal-price.over-budget { color: var(--text-primary); }

/* ── Empty states ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; font-size: 1.1rem; }
.empty-state p { font-size: 0.9rem; line-height: 1.6; }

/* ── Stats row ── */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; }
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem; font-weight: 700;
}
.stat-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1000; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp 0.3s ease;
  max-width: 340px;
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast-text { font-size: 0.88rem; color: var(--text-secondary); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Loading ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page sections ── */
.page-hero {
  padding: 40px 0 32px;
}
.page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700; margin-bottom: 8px;
}
.page-hero p { font-size: 1rem; color: var(--text-secondary); }

.section { margin-bottom: 40px; }

/* ── Pulse dot ── */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ── Price mini-chart ── */
.mini-prices {
  display: flex; gap: 4px; align-items: flex-end;
  height: 28px; margin-top: 10px;
}
.price-bar {
  flex: 1; border-radius: 2px 2px 0 0;
  background: var(--border); min-height: 4px;
  transition: background 0.2s;
}
.price-bar.current { background: var(--accent); opacity: 0.7; }
.price-bar.lowest { background: var(--success); }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; margin-bottom: 24px; }
.tab {
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; cursor: pointer;
  color: var(--text-muted); background: transparent; border: none;
  transition: all 0.2s ease;
}
.tab.active {
  background: var(--accent-dim); color: var(--accent);
}
.tab:hover:not(.active) { color: var(--text-secondary); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .deal-item { flex-wrap: wrap; }
  .deal-airline { order: 3; }
}
