/* ── Travels with My Love — Global Styles ────────────────────────────────────
   Design system: dustanie.com tokens
   Lavender bg · Violet primary · Amber accent · Deep indigo text
   Exception: .passport-interior (achievements page) uses parchment theme
   ─────────────────────────────────────────────────────────────────────────── */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400;1,9..144,600&family=Special+Elite&display=swap");

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:          #F4F3FF;
  --surface:     #FFFFFF;
  --surface-2:   #F0EFF9;
  --border:      #E0DEF7;
  --border-hover:#C4B5FD;

  --violet:      #7C3AED;
  --violet-light:#EDE9FE;
  --violet-dark: #5B21B6;
  --amber:       #D97706;
  --amber-light: #FEF3C7;
  --indigo:      #1E1B4B;

  --text:        #1E1B4B;
  --text-sub:    #4C4580;
  --text-hint:   #8B85C1;
  --text-inv:    #FFFFFF;

  --shadow-sm:   0 1px 3px rgba(124,58,237,.08);
  --shadow-md:   0 4px 12px rgba(124,58,237,.12);
  --shadow-lg:   0 8px 24px rgba(124,58,237,.15);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;

  /* Per-page accent colours */
  --c-cities:     #0891B2;
  --c-countries:  #8B4BC4;
  --c-states:     #3D6CB3;
  --c-parks:      #3C9A5A;
  --c-landmarks:  #D89040;
  --c-cruises:    #2D8F8A;
  --c-roadtrips:  #C34848;
  --c-planned:    #5D55B8;
  --c-wishlist:   #D8703A;
  --c-stratford:  #8B2252;
  --c-restaurants:#B04A6A;
}

/* ── Reset / Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; width: 100%; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--indigo);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: var(--violet);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.sidebar-brand-text { line-height: 1.25; }
.sidebar-brand-text .line1 {
  font-family: "Fraunces", serif;
  font-size: 13px; color: rgba(255,255,255,.95); font-weight: 400;
}
.sidebar-brand-text .line2 {
  font-family: "Fraunces", serif;
  font-size: 13px; color: rgba(255,255,255,.6); font-style: italic;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.sidebar-section {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
  transition: all .15s;
  border-left: 3px solid transparent;
}

.sidebar-link i { width: 16px; text-align: center; font-size: 13px; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar-link.active {
  color: #C4B5FD;
  background: rgba(124,58,237,.25);
  border-left-color: var(--violet);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
}

#nav-user-name {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-signout {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.5);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.btn-signout:hover { border-color: rgba(255,255,255,.5); color: rgba(255,255,255,.8); }

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px;
  max-width: 1200px;
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 4px;
}

.page-header .subtitle {
  font-size: 14px;
  color: var(--text-sub);
}

/* ── Hero Banner (compact, per-page accent) ──────────────────────────────── */
.hero-banner {
  background: var(--violet);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: #fff;
}

.hero-banner.accent-cities    { background: linear-gradient(135deg, #0891B2, #0669A0); }
.hero-banner.accent-countries { background: linear-gradient(135deg, #8B4BC4, #6834A0); }
.hero-banner.accent-states    { background: linear-gradient(135deg, #3D6CB3, #2A4C8A); }
.hero-banner.accent-parks     { background: linear-gradient(135deg, #3C9A5A, #287644); }
.hero-banner.accent-landmarks { background: linear-gradient(135deg, #D89040, #B06820); }
.hero-banner.accent-cruises   { background: linear-gradient(135deg, #2D8F8A, #1A6A65); }
.hero-banner.accent-roadtrips { background: linear-gradient(135deg, #C34848, #962F2F); }
.hero-banner.accent-planned   { background: linear-gradient(135deg, #5D55B8, #3E3790); }
.hero-banner.accent-wishlist  { background: linear-gradient(135deg, #D8703A, #AA4F1C); }
.hero-banner.accent-stratford { background: linear-gradient(135deg, #8B2252, #6B1840); }
.hero-banner.accent-restaurants{background: linear-gradient(135deg, #B04A6A, #8A2A4A); }

.hero-icon { font-size: 28px; opacity: .85; }
.hero-text { flex: 1; }
.hero-text h2 {
  font-family: "Fraunces", serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 2px;
}
.hero-text p { font-size: 13px; opacity: .8; }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
}

.hero-stat {
  text-align: center;
  padding: 0 20px;
  border-right: 1px solid rgba(255,255,255,.2);
}
.hero-stat:last-child { border-right: none; padding-right: 0; }
.hero-stat .num {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 600;
  display: block;
  line-height: 1;
}
.hero-stat .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .7;
  display: block;
  margin-top: 3px;
}

.hero-action .btn-hero {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-action .btn-hero:hover { background: rgba(255,255,255,.28); }

/* ── Cards / Tiles ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* ── Stat Grid (dashboard) ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-family: "Fraunces", serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--indigo);
  line-height: 1;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}

/* ── VoyCards (collection grid) ─────────────────────────────────────────── */
.voycards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.voycard {
  border-radius: var(--radius);
  padding: 20px;
  min-height: 130px;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.voycard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }

.voycard-label {
  font-family: "Fraunces", serif;
  font-size: 16px;
  font-weight: 500;
  opacity: .95;
}
.voycard-bottom { display: flex; align-items: flex-end; justify-content: space-between; }
.voycard-num {
  font-family: "Fraunces", serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}
.voycard-icon { font-size: 30px; opacity: .55; }

.vc-states     { background: linear-gradient(140deg, #3D6CB3, #2A4C8A); }
.vc-countries  { background: linear-gradient(140deg, #8B4BC4, #6834A0); }
.vc-cities     { background: linear-gradient(140deg, #0891B2, #0669A0); }
.vc-parks      { background: linear-gradient(140deg, #3C9A5A, #287644); }
.vc-landmarks  { background: linear-gradient(140deg, #D89040, #B06820); }
.vc-cruises    { background: linear-gradient(140deg, #2D8F8A, #1A6A65); }
.vc-roadtrips  { background: linear-gradient(140deg, #C34848, #962F2F); }
.vc-planned    { background: linear-gradient(140deg, #5D55B8, #3E3790); }
.vc-wishlist   { background: linear-gradient(140deg, #D8703A, #AA4F1C); }
.vc-stratford  { background: linear-gradient(140deg, #8B2252, #6B1840); }
.vc-restaurants{ background: linear-gradient(140deg, #B04A6A, #8A2A4A); }

/* ── Year Cards ──────────────────────────────────────────────────────────── */
.year-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.year-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  text-decoration: none;
  display: block;
  transition: all .2s;
  position: relative;
}
.year-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.year-card .year-num {
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--indigo);
  display: block;
}
.year-card .year-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}
.year-card .year-arrow {
  position: absolute;
  top: 18px; right: 18px;
  color: var(--text-hint);
  font-size: 13px;
}
.year-card .year-miles {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-light);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--violet);
  color: #fff;
}
.btn-primary:hover { background: var(--violet-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
}
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--violet-light); color: var(--violet); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Badges / Pills ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-violet   { background: var(--violet-light); color: var(--violet-dark); }
.badge-amber    { background: var(--amber-light); color: #92400E; }
.badge-green    { background: #DCFCE7; color: #166534; }
.badge-blue     { background: #DBEAFE; color: #1E40AF; }
.badge-rose     { background: #FFE4E6; color: #9F1239; }
.badge-gray     { background: #F1F5F9; color: #475569; }
.badge-teal     { background: #CCFBF1; color: #0F766E; }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.filter-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  font-size: 13px;
}
.filter-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.filter-search input:focus { outline: none; border-color: var(--violet); }

.filter-select {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--violet); }

/* ── Data Grid ───────────────────────────────────────────────────────────── */
.data-grid {
  display: grid;
  gap: 14px;
}
.data-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.data-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.data-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Status Badges ───────────────────────────────────────────────────────── */
.status-visited  { background: #DCFCE7; color: #166534; }
.status-planned  { background: #DBEAFE; color: #1E40AF; }
.status-wishlist { background: var(--amber-light); color: #92400E; }
.status-home     { background: var(--violet-light); color: var(--violet-dark); }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-family: "Fraunces", serif;
  font-size: 18px;
  color: var(--indigo);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-hint);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Form Elements ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

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

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--indigo);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  max-width: 320px;
}
.toast.success { background: #166534; }
.toast.error   { background: #9F1239; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Map Containers ──────────────────────────────────────────────────────── */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 360px;
}

.map-container.tall { height: 500px; }
.map-container.full { height: calc(100vh - 160px); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-hint);
}
.empty-state i { font-size: 40px; margin-bottom: 16px; display: block; }
.empty-state h3 { font-family: "Fraunces", serif; font-size: 18px; color: var(--text-sub); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .voycards-grid { grid-template-columns: repeat(2, 1fr); }
  .year-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .data-grid.cols-3, .data-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-banner { flex-wrap: wrap; gap: 12px; }
  .hero-stats { flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .voycards-grid { grid-template-columns: 1fr; }
  .data-grid.cols-2, .data-grid.cols-3, .data-grid.cols-4 { grid-template-columns: 1fr; }
}

/* ── Passport Interior Exception ─────────────────────────────────────────── */
.passport-interior {
  font-family: "Fraunces", serif;
  background: #f3ecd8;
  color: #1a1209;
  border-radius: var(--radius-lg);
  padding: 32px;
}
