/* Travisaro Design System — spec-aligned revision */

/* ─────────────────────────────────────────
   DESIGN TOKENS
───────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-main:         #0a0f1e;
  --bg-elevated:     #0d1526;
  --bg-card:         #111827;
  --bg-card-hover:   #16202f;

  /* Brand */
  --accent-main:     #4f8ef7;
  --accent-secondary:#7b5ea7;
  --gradient-main:   linear-gradient(135deg, #4f8ef7, #7b5ea7);
  --gradient-premium:linear-gradient(135deg, rgba(79,142,247,0.12), rgba(123,94,167,0.12));

  /* Text */
  --text-primary:    #e8edf5;
  --text-secondary:  #8899aa;
  --text-muted:      rgba(180, 200, 255, 0.5);

  /* Borders / Dividers */
  --border-subtle:   rgba(255, 255, 255, 0.07);
  --border-medium:   rgba(100, 140, 255, 0.15);
  --border-card:     rgba(255, 255, 255, 0.10);

  /* Status */
  --status-active:   #1ed28c;
  --status-warning:  #ef9f27;
  --status-danger:   #e84545;
  --status-expiring: #ef9f27;
  --status-expired:  #e84545;

  /* Glass layers */
  --glass-bg:        rgba(255, 255, 255, 0.05);
  --glass-hero-bg:   linear-gradient(135deg, rgba(79,142,247,0.15), rgba(123,94,167,0.15));
  --glass-border:    rgba(255, 255, 255, 0.10);
  --glass-blur:      blur(20px);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-11: 0.6875rem;  /* 11px — minimum */
  --text-xs:  0.75rem;   /* 12px — labels */
  --text-sm:  0.875rem;  /* 14px — body */
  --text-base:1rem;      /* 16px */
  --text-lg:  1.125rem;  /* 18px — section headings */
  --text-xl:  1.375rem;  /* 22px — screen titles */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;

  --font-normal:  400;
  --font-medium:  500;
  --font-semibold:600;
  --font-bold:    700;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10:2.5rem;
  --space-12:3rem;
  --space-16:4rem;

  /* Border Radius */
  --radius-sm:    8px;
  --radius-input: 12px;
  --radius-md:    14px;   /* buttons, small cards, list items */
  --radius-lg:    20px;   /* main cards */
  --radius-full:  9999px;
}

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

/* Prevent layout viewport from exceeding visual viewport */
html {
  overflow-x: hidden;
  background: #0a0f1e;
}

/* Hide number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ─────────────────────────────────────────
   BASE
───────────────────────────────────────── */
body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(ellipse 120% 90% at 10% 20%, rgba(79,142,247,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 90% 10%, rgba(123,94,167,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 110% 85% at 80% 75%, rgba(79,142,247,0.06) 0%, transparent 55%),
    linear-gradient(180deg, #0a0f1e 0%, #0d1526 100%);
  /* background-attachment: fixed removed — caused white flash on navigation */
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────── */
.heading-1 {
  font-size: var(--text-xl);      /* 22px — screen title */
  font-weight: var(--font-medium);
  line-height: 1.3;
  color: var(--text-primary);
}
.heading-2 {
  font-size: var(--text-lg);      /* 18px — section heading */
  font-weight: var(--font-medium);
  line-height: 1.3;
  color: var(--text-primary);
}
.heading-3 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: 1.4;
  color: var(--text-primary);
}
.heading-4 {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.5;
  color: var(--text-primary);
}
.text-primary  { color: var(--text-primary);   }
.text-secondary{ color: var(--text-secondary); }
.text-muted    { color: var(--text-muted);     }

/* Label / caption helper */
.label-caption {
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─────────────────────────────────────────
   CARDS — Glassmorphism
───────────────────────────────────────── */

/* Glass Mid — standard card */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(100, 140, 255, 0.20);
}

/* Alias — same as .card */
.card-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

/* Glass Deep — hero / featured card */
.card-elevated,
.card-hero {
  background: linear-gradient(135deg, rgba(79,142,247,0.15), rgba(123,94,167,0.15));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(100, 140, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* Glass Light — list items / trip rows */
.card-list-item {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: background 0.15s ease;
}
.card-list-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* Icon containers inside list items */
.icon-container {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-container-blue   { background: rgba(79,  142, 247, 0.15); color: #4f8ef7; }
.icon-container-amber  { background: rgba(239, 159, 39,  0.15); color: #ef9f27; }
.icon-container-green  { background: rgba(30,  210, 140, 0.15); color: #1ed28c; }
.icon-container-purple { background: rgba(123, 94,  167, 0.15); color: #7b5ea7; }
.icon-container-red    { background: rgba(232, 69,  69,  0.15); color: #e84545; }

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-6);
  min-height: 48px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}

/* Primary — gradient CTA */
.btn-primary {
  background: var(--gradient-main);
  color: #ffffff;
  min-height: 52px;
  font-size: 15px;
  border: none;
  width: 100%;
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.97);
  opacity: 1;
}

/* Secondary — glass */
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  min-height: 48px;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.20);
}
.btn-secondary:active {
  transform: scale(0.97);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  min-height: 40px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ─────────────────────────────────────────
   FORM INPUTS
───────────────────────────────────────── */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
textarea,
select:not([class*="nav"]) {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
}

textarea {
  min-height: unset;
  padding: 14px 16px;
  resize: vertical;
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
textarea:focus {
  border-color: rgba(79, 142, 247, 0.6);
  background: rgba(79, 142, 247, 0.05);
}

.input::placeholder,
input::placeholder,
textarea::placeholder { color: var(--text-secondary); }

.select,
select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}
select:focus {
  border-color: rgba(79, 142, 247, 0.6);
}
/* Fix for dark select options */
select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* Date input icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(2);
  cursor: pointer;
  opacity: 0.7;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type="date"] { color-scheme: dark; }

/* ─────────────────────────────────────────
   STATUS BADGES
───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge-active {
  background: rgba(30, 210, 140, 0.12);
  border: 0.5px solid rgba(30, 210, 140, 0.30);
  color: #1ed28c;
}
.badge-active .badge-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

.badge-warning,
.badge-expiring {
  background: rgba(239, 159, 39, 0.12);
  border: 0.5px solid rgba(239, 159, 39, 0.30);
  color: #ef9f27;
}

.badge-danger,
.badge-expired {
  background: rgba(232, 69, 69, 0.12);
  border: 0.5px solid rgba(232, 69, 69, 0.30);
  color: #e84545;
}

.badge-info {
  background: rgba(79, 142, 247, 0.12);
  border: 0.5px solid rgba(79, 142, 247, 0.30);
  color: #4f8ef7;
}

/* Active dot pulse */
@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ─────────────────────────────────────────
   PROGRESS BAR
───────────────────────────────────────── */
.progress-track {
  background: rgba(255, 255, 255, 0.08);
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease-out;
}
.progress-healthy { background: linear-gradient(90deg, #4f8ef7, #1ed28c); }
.progress-warning  { background: linear-gradient(90deg, #ef9f27, #f7694f); }
.progress-danger   { background: #e84545; }

/* ─────────────────────────────────────────
   BOTTOM NAVIGATION
───────────────────────────────────────── */
.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 15, 30, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
  height: 64px;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  z-index: 9999;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 10px;
  font-weight: var(--font-medium);
  transition: color 0.2s ease;
  border-radius: var(--radius-md);
  position: relative;
}
.nav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.nav-item span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  max-width: 100%;
}
.nav-item:hover { color: var(--text-primary); }

.nav-item.active {
  color: #ffffff;
  background: rgba(79, 142, 247, 0.14);
  border-radius: 12px;
}
.nav-item.active svg {
  stroke: #4f8ef7;
  filter: drop-shadow(0 0 6px rgba(79,142,247,0.55));
}
.nav-item.active span {
  color: #4f8ef7;
  font-weight: 600;
}
/* Top accent line on active item */
.nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2.5px;
  background: linear-gradient(90deg, #4f8ef7, #7b5ea7);
  border-radius: var(--radius-full);
}

/* ─────────────────────────────────────────
   SECTION DIVIDERS
───────────────────────────────────────── */
.divider {
  height: 0.5px;
  background: rgba(255, 255, 255, 0.07);
  margin: var(--space-6) 0;
}

/* ─────────────────────────────────────────
   CHIPS / FILTER PILLS
───────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.20);
}
.chip.active {
  background: rgba(79, 142, 247, 0.15);
  color: var(--accent-main);
  border-color: rgba(79, 142, 247, 0.35);
}

/* ─────────────────────────────────────────
   LINKS
───────────────────────────────────────── */
a {
  color: var(--accent-main);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
a:hover { opacity: 0.80; }

/* ─────────────────────────────────────────
   SKELETON LOADER
───────────────────────────────────────── */
.skeleton {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1;    }
  50%       { opacity: 0.45; }
}

/* ─────────────────────────────────────────
   SECTION TITLE HELPER
───────────────────────────────────────── */
.section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

/* ─────────────────────────────────────────
   UTILITY CLASSES
───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: min(1200px, 100vw);
  margin: 0 auto;
  padding: 0 20px;
}

.page-header { padding: var(--space-6) 0 var(--space-4) 0; }

.accent-border-left {
  border-left: 2px solid var(--accent-main);
  padding-left: var(--space-4);
}

/* Flex */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }

/* Spacing */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }

/* Grid */
.grid          { display: grid; }
.grid-cols-2   { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3   { grid-template-columns: repeat(3, 1fr); }
.grid-responsive {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.grid-responsive-sm {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

/* Width */
.w-full    { width: 100%; }
.max-w-full{ max-width: 100%; }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Overflow */
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto   { overflow-y: auto; }

/* ─────────────────────────────────────────
   FLASH / ALERT BANNERS
───────────────────────────────────────── */
.alert-success {
  background: rgba(30,  210, 140, 0.10);
  border: 0.5px solid rgba(30,  210, 140, 0.30);
  color: #1ed28c;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
}
.alert-warning {
  background: rgba(239, 159, 39,  0.10);
  border: 0.5px solid rgba(239, 159, 39,  0.30);
  color: #ef9f27;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
}
.alert-error {
  background: rgba(232, 69,  69,  0.10);
  border: 0.5px solid rgba(232, 69,  69,  0.30);
  color: #e84545;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
}
.alert-info {
  background: rgba(79,  142, 247, 0.10);
  border: 0.5px solid rgba(79,  142, 247, 0.30);
  color: #4f8ef7;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .heading-1 { font-size: var(--text-base); }
  .heading-2 { font-size: var(--text-sm);   }

  .card, .card-glass { padding: 14px 16px; }

  .grid-cols-2,
  .grid-cols-3 { grid-template-columns: 1fr; }

  body { padding-bottom: 80px; }

  .nav-bottom  { height: 60px; padding: 0 8px; }
  .nav-item    { font-size: 10px; gap: 2px; }
  .nav-item svg{ width: 20px; height: 20px; }

}

@media (max-width: 360px) {
  body { padding-bottom: 88px; }
  .nav-bottom  { height: 58px; padding: 0 4px; }
  .nav-item    { font-size: 9px; }
  .nav-item svg{ width: 18px; height: 18px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--space-6); }
}

/* ── Page entry animation ─────────────────────────────────────────────── */
#page-content{opacity:0;animation:_pi 180ms ease-out forwards;}
@keyframes _pi{to{opacity:1;}}
@media(prefers-reduced-motion:reduce){#page-content{opacity:1;animation:none;}}
