/* ═══════════════════════════════════════════════════
   TRAVEL EXPLORER — Global Styles
   Aesthetic: Warm editorial travel magazine
   Fonts: Playfair Display + DM Sans + Space Mono
════════════════════════════════════════════════════ */

:root {
  --sand:     #f5efe6;
  --sand-d:   #ede3d3;
  --ink:      #1a1410;
  --ink-soft: #4a3f35;
  --rust:     #c8522a;
  --rust-d:   #a8421e;
  --gold:     #d4a843;
  --gold-d:   #b8902e;
  --teal:     #2a7a6e;
  --teal-l:   #3d9e90;
  --coral:    #e8705a;
  --sky:      #4a8fb5;
  --green:    #5a9e6e;
  --purple:   #7a5a9e;
  --surface:  #fffdf9;
  --border:   rgba(26,20,16,0.12);
  --shadow:   0 4px 24px rgba(26,20,16,0.10);
  --shadow-lg:0 8px 48px rgba(26,20,16,0.16);
  --radius:   12px;
  --radius-lg:20px;
  --sidebar-w: 260px;
  --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--sand);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  font-size: 15px;
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────────────── */
h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; line-height: 1.2; }
.mono { font-family: 'Space Mono', monospace; }

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  padding: 0;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
  width: 44px; height: 44px;
  background: var(--rust);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700;
  line-height: 1.2;
}
.brand-sub { font-size: 11px; opacity: 0.45; letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 14px;
  flex: 1;
}
.nav-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.6);
  text-align: left;
  padding: 11px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  transition: var(--transition);
  letter-spacing: 0.01em;
}
.nav-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-btn.active { background: var(--rust); color: #fff; }
.nav-icon { font-size: 17px; }

.sidebar-trip-select {
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.4;
  margin-bottom: 8px;
}
#globalTripSelect {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
}
#globalTripSelect option { background: #2a2420; }

.sidebar-footer {
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.db-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; opacity: 0.5;
}
.db-dot {
  width: 7px; height: 7px;
  background: #5adb6e;
  border-radius: 50%;
  display: inline-block;
}

/* ── Mobile Header ──────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  align-items: center;
  gap: 14px;
  z-index: 90;
  height: 58px;
}
.hamburger {
  background: none; border: none;
  color: #fff; font-size: 22px;
  cursor: pointer; padding: 0;
}
.mobile-brand {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700;
}

/* ── Main Content ───────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 40px 48px;
}

/* ── Views ──────────────────────────────────────── */
.view { display: block; animation: fadeIn 0.3s ease; }
.view.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.page-title {
  font-size: 38px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}

/* ── Section Title ──────────────────────────────── */
.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  opacity: 0.6;
  margin: 32px 0 16px;
}

/* ── Stat Cards ─────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon { font-size: 26px; margin-bottom: 12px; }
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 700;
  color: var(--ink); line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 12px; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Trip Grid (Dashboard) ──────────────────────── */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.trip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.trip-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--rust);
}
.trip-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.trip-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700;
  margin-bottom: 4px;
}
.trip-card-dest {
  font-size: 13px; opacity: 0.5;
  margin-bottom: 16px;
}
.trip-card-dates {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  opacity: 0.45;
  margin-bottom: 16px;
}
.trip-card-budget {
  display: flex; justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.trip-card-budget-label { font-size: 12px; opacity: 0.5; }
.trip-card-budget-val {
  font-family: 'Space Mono', monospace;
  font-size: 18px; font-weight: 700;
  color: var(--rust);
}
.mini-bar-track {
  background: var(--sand-d);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--rust);
  transition: width 0.5s ease;
}
.mini-bar-fill.over { background: #e03a2e; }
.trip-card-actions {
  display: flex; gap: 8px;
  margin-top: 16px;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  border: none; border-radius: 9px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary { background: var(--rust); color: #fff; }
.btn-primary:hover { background: var(--rust-d); box-shadow: 0 4px 16px rgba(200,82,42,0.3); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--sand-d); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-danger { background: #e03a2e; color: #fff; }
.btn-danger:hover { background: #c02e23; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-l); }

/* ── Data Table ─────────────────────────────────── */
.trips-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: var(--sand-d);
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--sand); }
.empty-row { text-align: center; color: var(--ink-soft); opacity: 0.5; padding: 40px; }

/* status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-ok      { background: #d4f0dc; color: #1a6e30; }
.badge-warn    { background: #fde8cc; color: #9a5200; }
.badge-over    { background: #fdd8d6; color: #9a1a16; }

/* ── Expenses ───────────────────────────────────── */
.expense-trip-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.expense-trip-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.expense-trip-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.5;
  white-space: nowrap;
}
#expenseTripSelect {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  min-width: 260px;
}
.expense-trip-info {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin-bottom: 12px;
}
.budget-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.budget-bar-track {
  background: var(--sand-d);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
}
.budget-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.6s ease;
}
.budget-bar-fill.danger { background: linear-gradient(90deg, var(--coral), #e03a2e); }

.expense-filters {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.expense-filters select,
.expense-filters input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.expense-filters input { flex: 1; min-width: 160px; }
.expense-filters select:focus,
.expense-filters input:focus { outline: 2px solid var(--rust); }

.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.expense-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.expense-item:hover { box-shadow: var(--shadow); }
.expense-cat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.expense-info {}
.expense-desc { font-weight: 500; font-size: 15px; margin-bottom: 3px; }
.expense-meta { font-size: 12px; opacity: 0.5; display: flex; gap: 10px; }
.expense-amount {
  font-family: 'Space Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  color: var(--rust);
  text-align: right;
  white-space: nowrap;
}
.expense-actions { display: flex; gap: 6px; }

/* Category colors */
.cat-accommodation { background: #dbeafe; }
.cat-food          { background: #fef3c7; }
.cat-transport     { background: #dcfce7; }
.cat-shopping      { background: #fae8ff; }
.cat-activities    { background: #ffedd5; }
.cat-health        { background: #fee2e2; }
.cat-communication { background: #e0f2fe; }
.cat-visa          { background: #f1f5f9; }
.cat-insurance     { background: #f0fdf4; }
.cat-other         { background: #f4f4f5; }

/* ── Analytics ──────────────────────────────────── */
.analytics-trip-selector {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
  font-size: 14px;
}
.analytics-trip-selector select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.analytics-card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-bottom: 20px;
}
.analytics-card.full-width { grid-column: 1 / -1; }

/* Donut Chart */
.donut-wrap {
  display: flex; align-items: center; gap: 28px;
  flex-wrap: wrap;
}
.donut-svg { flex-shrink: 0; }
.donut-legend { flex: 1; min-width: 160px; }
.legend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.legend-item:last-child { border-bottom: none; }
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-name { flex: 1; }
.legend-pct {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.7;
}
.legend-amount {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--rust);
}

/* Bar Chart */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 120px; font-size: 13px; text-align: right; opacity: 0.7; }
.bar-track {
  flex: 1; height: 24px;
  background: var(--sand-d);
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  display: flex; align-items: center; padding-left: 10px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.bar-val {
  width: 80px;
  text-align: right;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
}

/* Summary numbers */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.summary-item { text-align: center; padding: 16px; }
.summary-val {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700;
  color: var(--rust);
}
.summary-lbl { font-size: 12px; opacity: 0.5; margin-top: 4px; }

/* ── Modals ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,20,16,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal-sm { max-width: 400px; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0;
}
.modal-header h2 { font-size: 22px; }
.modal-close {
  background: var(--sand); border: none;
  width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer;
  font-size: 16px; color: var(--ink);
  transition: var(--transition);
}
.modal-close:hover { background: var(--sand-d); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 0 28px 24px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.form-group:not(.form-row .form-group) { margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.6; }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--sand);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--rust);
  background: var(--surface);
}
.form-group textarea { resize: vertical; }

/* ── Toast ──────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 500;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  min-width: 220px;
}
.toast.success { border-left: 4px solid #5adb6e; }
.toast.error   { border-left: 4px solid var(--coral); }
.toast.info    { border-left: 4px solid var(--sky); }
@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Empty State ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.4; }
.empty-state p { opacity: 0.5; margin-bottom: 20px; font-size: 15px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 80px 18px 30px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-value { font-size: 22px; }
  .page-title { font-size: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .expense-item { grid-template-columns: 40px 1fr; }
  .expense-actions { display: none; }
}

/* ── Plan My Trip ────────────────────────────────── */

/* Nav item — planner visually distinct in sidebar */
.nav-btn[data-view="planner"] {
  position: relative;
  background: linear-gradient(135deg, rgba(212,168,67,0.12), rgba(200,82,42,0.10));
  border: 1px solid rgba(212,168,67,0.25);
  color: var(--gold-d);
  font-weight: 600;
}
.nav-btn[data-view="planner"]:hover,
.nav-btn[data-view="planner"].active {
  background: linear-gradient(135deg, var(--rust), #b8420e);
  border-color: transparent;
  color: #fff;
}
.nav-btn[data-view="planner"]::after {
  content: 'AI';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--gold), var(--rust));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-btn[data-view="planner"].active::after {
  background: rgba(255,255,255,0.6);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Page header badge — replaced by AI banner */
.planner-badge { display: none; }

/* AI banner */
.planner-ai-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #1a1410 0%, #2a1a0e 50%, #1a1a2e 100%);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(212,168,67,0.2);
}

.planner-ai-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 10% 50%, rgba(212,168,67,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 80% 30%, rgba(42,122,110,0.2) 0%, transparent 55%),
    radial-gradient(ellipse 40% 60% at 60% 80%, rgba(200,82,42,0.12) 0%, transparent 50%);
  animation: auroraShift 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auroraShift {
  0%   { opacity: 0.7; transform: scale(1) translateX(0); }
  50%  { opacity: 1;   transform: scale(1.05) translateX(10px); }
  100% { opacity: 0.8; transform: scale(0.98) translateX(-5px); }
}

.planner-ai-orb {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.planner-ai-orb-core {
  position: absolute;
  inset: 10px;
  background: linear-gradient(135deg, var(--gold), var(--rust));
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(212,168,67,0.5);
  animation: orbPulse 2.4s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 16px rgba(212,168,67,0.45); }
  50%       { transform: scale(1.12); box-shadow: 0 0 28px rgba(212,168,67,0.7); }
}

.planner-ai-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(212,168,67,0.3);
  animation: orbRing 3s linear infinite;
}

.planner-ai-orb-ring::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  top: -3px;
  left: calc(50% - 3px);
  box-shadow: 0 0 6px var(--gold);
}

@keyframes orbRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.planner-ai-text { position: relative; z-index: 1; }

.planner-ai-label {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.planner-ai-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
}

.planner-ai-powered {
  margin-left: auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

.planner-ai-powered-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--gold);
  animation: dotBlink 1.8s ease-in-out infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.planner-search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer line at top of search card */
.planner-search-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold) 30%,
    var(--rust) 60%,
    var(--teal) 80%,
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmerLine 3s linear infinite;
}

@keyframes shimmerLine {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.planner-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.planner-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.planner-field-sm {
  flex: 0 0 130px;
  min-width: 110px;
}

.planner-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.planner-field input,
.planner-field select {
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  transition: var(--transition);
}

.planner-field input:focus,
.planner-field select:focus {
  outline: 2px solid var(--rust);
  background: var(--surface);
}

.planner-divider {
  font-size: 20px;
  opacity: 0.3;
  padding-bottom: 10px;
  align-self: flex-end;
}

.planner-go-btn {
  width: 100%;
  padding: 15px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 12px;
  background: linear-gradient(135deg, #c8522a, #d4a843, #2a7a6e, #c8522a);
  background-size: 300% 100%;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: background-position 0.6s ease, transform 0.2s, box-shadow 0.2s;
  animation: gradientFlow 4s linear infinite;
  box-shadow: 0 4px 20px rgba(200,82,42,0.3);
}

.planner-go-btn:hover:not(:disabled) {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(200,82,42,0.45);
}

.planner-go-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Loading */
.planner-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 24px;
}

/* Neural node animation instead of plain spinner */
.planner-ai-nodes {
  position: relative;
  width: 72px;
  height: 72px;
}

.planner-ai-nodes-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(212,168,67,0.15);
  animation: nodesRing 2s linear infinite;
}

.planner-ai-nodes-ring::before,
.planner-ai-nodes-ring::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: -4px;
  left: calc(50% - 4px);
}

.planner-ai-nodes-ring::before {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.planner-ai-nodes-ring::after {
  background: var(--rust);
  box-shadow: 0 0 10px var(--rust);
  top: auto;
  bottom: -4px;
}

@keyframes nodesRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.planner-ai-nodes-inner {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(42,122,110,0.3);
  animation: nodesRing 1.4s linear infinite reverse;
}

.planner-ai-nodes-inner::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  border-radius: 50%;
  top: -3px;
  left: calc(50% - 3px);
}

.planner-ai-nodes-core {
  position: absolute;
  inset: 28px;
  background: linear-gradient(135deg, var(--gold), var(--rust));
  border-radius: 50%;
  animation: orbPulse 1.6s ease-in-out infinite;
}

.planner-loading-label {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--ink);
  opacity: 0.75;
}

.planner-loading-sub {
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.45;
  letter-spacing: 0.05em;
  animation: loadingFade 1.5s ease-in-out infinite alternate;
}

@keyframes loadingFade {
  from { opacity: 0.3; }
  to   { opacity: 0.7; }
}

/* Empty state */
.planner-empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--ink-soft);
  opacity: 0.55;
}

.planner-empty-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

/* Results layout */
.planner-hero {
  background: linear-gradient(135deg, var(--ink) 0%, #2d1f15 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.planner-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(212,168,67,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at bottom left, rgba(42,122,110,0.2) 0%, transparent 55%);
  pointer-events: none;
}

.planner-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.planner-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 8px;
}

.planner-hero-meta {
  font-size: 13px;
  opacity: 0.55;
  margin-bottom: 28px;
}

.planner-hero-totals {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.planner-total-item {}

.planner-total-val {
  font-family: 'Space Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.planner-total-label {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Budget cards grid */
.planner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.planner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.planner-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.planner-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.planner-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.planner-card-icon {
  font-size: 28px;
  line-height: 1;
}

.planner-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
}

.planner-card-subtitle {
  font-size: 12px;
  opacity: 0.5;
  margin-top: 2px;
}

.planner-card-amount {
  font-family: 'Space Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--rust);
  margin-bottom: 4px;
}

.planner-card-per {
  font-size: 12px;
  opacity: 0.45;
  margin-bottom: 16px;
}

.planner-line-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.planner-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.planner-line-label { opacity: 0.65; }

.planner-line-val {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
}

/* Tips section */
.planner-tips-card {
  background: linear-gradient(135deg, #f0faf8 0%, #e8f5f0 100%);
  border: 1px solid rgba(42,122,110,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.planner-tips-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.planner-tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.planner-tip {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.planner-tip-dot {
  width: 20px;
  height: 20px;
  background: var(--teal);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 700;
  margin-top: 1px;
}

/* Save to trip CTA */
.planner-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

.planner-cta-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
}

.planner-cta-sub {
  font-size: 13px;
  opacity: 0.5;
  margin-top: 3px;
}

.planner-cta-actions { display: flex; gap: 12px; }

/* Error state */
.planner-error {
  background: #fff5f5;
  border: 1px solid rgba(200,82,42,0.25);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--rust);
}

@media (max-width: 700px) {
  .planner-search-row { flex-direction: column; }
  .planner-divider { display: none; }
  .planner-field, .planner-field-sm { flex: 1 1 100%; }
  .planner-hero-title { font-size: 24px; }
  .planner-hero-totals { gap: 20px; }
  .planner-total-val { font-size: 22px; }
}