/* ── TripStamp Design System ── */
/* Dark: deep navy (#12151F) + teal mint accent */
/* Light: clean white + teal mint accent (GoTour style) */

:root {
  /* ── DARK MODE (default) ── */
  --bg:      #12151F;
  --bg2:     #1A1D2E;
  --bg3:     #1E2235;
  --bg4:     #242840;
  --border:  rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.12);

  --text:    #E8EDF5;
  --text2:   #8892A4;
  --text3:   #546070;

  --accent:      #00D4AA;   /* teal-mint primary */
  --accent2:     #00E5B8;   /* lighter hover */
  --accent-dark: #00A882;   /* pressed state */
  --accent-dim:  rgba(0,212,170,0.12);
  --accent-glow: rgba(0,212,170,0.25);

  --blue:     #4FACFE;
  --blue-dim: rgba(79,172,254,0.12);

  --green:     #00D4AA;   /* reuse accent for success */
  --green-dim: rgba(0,212,170,0.12);

  --red:     #FF5C7A;
  --red-dim: rgba(255,92,122,0.12);

  --yellow:     #FFD166;
  --yellow-dim: rgba(255,209,102,0.12);

  --purple:     #A78BFA;
  --purple-dim: rgba(167,139,250,0.12);

  --shadow:    0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --nav-h: 64px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  /* ── LIGHT MODE — GoTour style ── */
  --bg:      #F0F4F8;
  --bg2:     #FFFFFF;
  --bg3:     #F7FAFC;
  --bg4:     #EDF2F7;
  --border:  rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.12);

  --text:    #1A1D2E;
  --text2:   #4A5568;
  --text3:   #A0AEC0;

  --accent:      #00BFA5;
  --accent2:     #00D4AA;
  --accent-dark: #009E88;
  --accent-dim:  rgba(0,191,165,0.1);
  --accent-glow: rgba(0,191,165,0.2);

  --blue:     #2B6CB0;
  --blue-dim: rgba(43,108,176,0.1);

  --green:     #00BFA5;
  --green-dim: rgba(0,191,165,0.1);

  --red:     #E53E3E;
  --red-dim: rgba(229,62,62,0.1);

  --yellow:     #D69E2E;
  --yellow-dim: rgba(214,158,46,0.1);

  --purple:     #6B46C1;
  --purple-dim: rgba(107,70,193,0.1);

  --shadow:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
h1,h2,h3,h4,h5,h6 { line-height: 1.25; color: var(--text); font-weight: 700; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.85; }
p { color: var(--text2); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
input, select, textarea, button { font-family: var(--font); }

/* ── Phone-first overrides ── */
.container    { max-width: 480px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 1rem; }
.container-md { max-width: 480px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 1.5rem 0; }
.section-header { margin-bottom: 1rem; }

/* ── Navbar ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 0.5rem;
}
[data-theme="light"] .nav {
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
[data-theme="dark"] .nav,
:root:not([data-theme]) .nav {
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.nav-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text) !important; }
.nav-logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.nav-name { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.nav-name span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 0.125rem; flex: 1; margin-left: 0.75rem; }
.nav-link {
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text2);
  transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--accent);
  cursor: pointer; overflow: hidden; transition: box-shadow 0.15s;
}
.nav-avatar:hover { box-shadow: 0 0 0 3px var(--accent-glow); }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; color: var(--text2);
  transition: all 0.15s; outline: none;
}
.theme-toggle:hover { background: var(--accent-dim); color: var(--accent); }

.hamburger {
  display: none; width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border2);
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: 1.1rem; outline: none;
}
@media(max-width:768px) { .nav-links { display: none; } .hamburger { display: flex; } }

/* ── Page container ── */
.page { padding-top: var(--nav-h); min-height: 100vh; }
.container    { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 1.5rem; }
.container-md { max-width: 880px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; cursor: pointer; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border2); }

/* Glass card variant */
.card-glass {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.25rem;
}
[data-theme="light"] .card-glass {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.06);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.625rem 1.375rem;
  border-radius: var(--radius-sm); border: none;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: all 0.18s ease; text-decoration: none !important;
  font-family: var(--font); outline: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent); color: #0D1117;
  box-shadow: 0 4px 16px var(--accent-glow);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent2);
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-secondary {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg4); border-color: var(--accent); }

.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); border-color: var(--accent); }

.btn-outline {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover:not(:disabled) { background: var(--accent); color: #0D1117; }

.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 12px var(--red-dim); }
.btn-danger:hover:not(:disabled) { filter: brightness(0.9); }

.btn-sm  { padding: 0.375rem 0.875rem; font-size: 0.8125rem; border-radius: 8px; }
.btn-lg  { padding: 0.875rem 2rem; font-size: 1rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; aspect-ratio: 1; }

/* ── Badges / Tags ── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.625rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
}
.badge-teal   { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,212,170,0.3); }
.badge-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,212,170,0.3); }
.badge-red    { background: var(--red-dim); color: var(--red); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); }
.badge-gray   { background: var(--bg3); color: var(--text3); border: 1px solid var(--border2); }
.badge-gold   { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(255,209,102,0.3); }

/* ── Forms ── */
.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: block; margin-bottom: 0.4rem;
  font-size: 0.8125rem; font-weight: 600; color: var(--text2);
  letter-spacing: 0.01em;
}
.form-input {
  width: 100%; padding: 0.75rem 1rem;
  background: var(--bg3); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.9rem; font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-input::placeholder { color: var(--text3); }

.form-select {
  width: 100%; padding: 0.75rem 1rem;
  background: var(--bg3); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.9rem; font-family: var(--font);
  cursor: pointer; outline: none; appearance: none;
}
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

textarea.form-input { resize: vertical; min-height: 90px; }
.form-error { color: var(--red); font-size: 0.8rem; margin-top: 0.3rem; min-height: 1.1em; }
.form-hint  { color: var(--text3); font-size: 0.78rem; margin-top: 0.25rem; }

/* ── Stat cards ── */
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.125rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.stat-value { font-size: 1.875rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text3); font-weight: 500; letter-spacing: 0.02em; }
.stat-change { font-size: 0.75rem; color: var(--green); font-weight: 600; }

/* ── XP bar ── */
.xp-bar { height: 6px; background: var(--bg4); border-radius: 999px; overflow: hidden; }
.xp-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.6s ease;
}

/* ── Passport Stamp ── */
.stamp {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.25rem; padding: 0.875rem 0.625rem;
  border: 1.5px dashed var(--border2); border-radius: var(--radius);
  text-align: center; background: var(--bg2); position: relative;
  transition: border-color 0.2s;
}
.stamp:hover { border-color: var(--accent); }
.stamp-icon  { font-size: 1.5rem; }
.stamp-name  { font-size: 0.72rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stamp-country { font-size: 0.65rem; color: var(--text3); }
.stamp-date  { font-size: 0.6rem; color: var(--accent); font-weight: 600; }

/* ── Layout grids ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
@media(max-width:768px) {
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
  .container,.container-sm,.container-md { padding: 0 1rem; }
}
@media(max-width:480px) { .grid-auto { grid-template-columns: repeat(2,1fr); } }

/* ── Sections ── */
.section { padding: 3rem 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; }
.section-title { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.section-sub   { font-size: 0.875rem; color: var(--text2); margin-top: 0.2rem; }

/* ── Cover image ── */
.cover-img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius); }
.cover-placeholder {
  width: 100%; height: 220px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  display: flex; align-items: center; justify-content: center; font-size: 4rem;
}

/* ── Avatars ── */
.avatar { border-radius: 50%; object-fit: cover; background: var(--accent-dim); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 96px; height: 96px; }
.avatar-text {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent); background: var(--accent-dim);
  border-radius: 50%;
}

/* ── Tabs ── */
.tabs { display: flex; gap: 0.125rem; border-bottom: 1.5px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: 0.625rem 1rem; font-size: 0.875rem; font-weight: 600;
  color: var(--text3); cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  transition: all 0.15s; background: none; border-top: none;
  border-left: none; border-right: none; font-family: var(--font);
}
.tab:hover { color: var(--text2); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Rarity colors ── */
.rarity-common    { color: var(--text3); }
.rarity-uncommon  { color: #4ADE80; }
.rarity-rare      { color: var(--blue); }
.rarity-epic      { color: var(--purple); }
.rarity-legendary { color: var(--yellow); }

/* ── Alerts ── */
.alert {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; margin-bottom: 1rem;
}
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,212,170,0.25); }
.alert-error   { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,92,122,0.25); }
.alert-info    { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,212,170,0.25); }
.alert-yellow  { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(255,209,102,0.25); }

/* ── Dropdown ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 300;
  overflow: hidden; display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.7rem 1rem; font-size: 0.875rem; color: var(--text2);
  cursor: pointer; transition: background 0.1s; text-decoration: none !important;
}
.dropdown-item:hover { background: var(--bg3); color: var(--text); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* ── Loading ── */
.loading { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 3rem; color: var(--text3); }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 3rem; text-align: center; }
.empty-icon  { font-size: 3rem; opacity: 0.4; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text2); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── Animations ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.fade-in  { animation: fadeIn  0.3s ease both; }
.fade-up  { animation: fadeUp  0.35s ease both; }
.scale-in { animation: scaleIn 0.25s ease both; }

/* ── Mobile menu ── */
.mobile-menu {
  display: none; position: fixed; inset: 0; top: var(--nav-h);
  background: var(--bg2); z-index: 190; padding: 1rem;
  flex-direction: column; gap: 0.375rem;
  border-top: 1px solid var(--border); overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-link {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem;
  border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600;
  color: var(--text2); text-decoration: none !important; transition: all 0.15s;
}
.mobile-link:hover { background: var(--bg3); color: var(--text); }

/* ── Hero gradient helper ── */
.hero-grad-teal {
  background: radial-gradient(ellipse 70% 50% at 50% 0%, var(--accent-dim), transparent 70%);
}
.hero-grad-blue {
  background: radial-gradient(ellipse 70% 50% at 50% 0%, var(--blue-dim), transparent 70%);
}

/* ── Teal glow card ── */
.card-glow { box-shadow: 0 0 0 1px var(--accent-dim), var(--shadow); }

/* ── Search bar ── */
.search-wrap { position: relative; }
.search-wrap .form-input { padding-left: 2.75rem; }
.search-icon {
  position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 1rem; pointer-events: none;
}

/* ── Chip/filter ── */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.875rem; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600;
  border: 1.5px solid var(--border2); background: var(--bg2); color: var(--text2);
  cursor: pointer; text-decoration: none !important; transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Map ── */
#map { width: 100%; height: 100%; }
.leaflet-container { background: var(--bg3) !important; }

/* ── Flight route display ── */
.route-display { display: flex; align-items: center; gap: 1rem; }
.route-airport { text-align: center; }
.route-code { font-size: 1.75rem; font-weight: 900; color: var(--text); line-height: 1; }
.route-name { font-size: 0.7rem; color: var(--text3); margin-top: 0.2rem; }
.route-line { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; color: var(--accent); }
.route-arrow { font-size: 1.25rem; }
.route-meta  { font-size: 0.7rem; color: var(--text3); }

/* ── Data table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left; padding: 0.7rem 1rem;
  color: var(--text3); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.03em;
  border-bottom: 1.5px solid var(--border); background: var(--bg3);
}
.data-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border: none; }
.data-table tr:hover td { background: var(--bg3); }

/* ── Teal gradient button (hero CTA) ── */
.btn-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0D1117; font-weight: 800;
  box-shadow: 0 8px 24px var(--accent-glow);
  border: none; border-radius: var(--radius-sm);
  padding: 0.875rem 2.25rem; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  cursor: pointer; transition: all 0.2s; text-decoration: none !important;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px var(--accent-glow); }

/* ── Verified tick ── */
.verified-tick {
  display: inline-flex; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #0D1117;
  align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 900;
}
