/* ═══════════════════════════════════════════════════════════════════════════
   Amato Travel Connect — design tokens + component classes.

   Hand-written, always loaded (works with the compiled Tailwind build OR the
   CDN fallback). Tailwind utilities come from static/css/tailwind.css.
   Edit tokens / components here; edit static/src/main.css for the Tailwind
   source. Rebuild utilities with `npm run css:build`.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Theme tokens (light) ── */
:root {
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --primary: 213 94% 38%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222 47% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222 47% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 213 94% 38%;
  --radius: 0.75rem;
}

/* ── Theme tokens (dark) ── */
.dark {
  --background: 222 47% 11%;
  --foreground: 210 40% 98%;
  --card: 217 33% 17%;
  --card-foreground: 210 40% 98%;
  --primary: 213 94% 48%;
  --primary-foreground: 210 40% 98%;
  --secondary: 217 19% 27%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217 19% 27%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217 19% 27%;
  --accent-foreground: 222 47% 11.2%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217 19% 27%;
  --input: 217 19% 27%;
  --ring: 213 94% 48%;
}

/* ── Base ── */
body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: background-color 0.3s, color 0.3s;
}

/* ── Token-driven utilities (also emitted by the Tailwind build; kept here so
      the CDN fallback and dynamic classes always resolve) ── */
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.border-border { border-color: hsl(var(--border)); }
.border-primary { border-color: hsl(var(--primary)); }

/* ── Glass ── */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.dark .glass {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── Card ── */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s, transform 0.3s;
}
.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover {
  background: hsl(var(--primary) / 0.88);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px hsl(var(--primary) / 0.35);
}
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600; font-size: 0.875rem;
  border: 1px solid hsl(var(--border)); cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: hsl(var(--accent));
  transform: translateY(-1px);
}

/* ── Input ── */
.input {
  width: 100%;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* ── Table / filter helpers ── */
.divide-border > :not([hidden]) ~ :not([hidden]) { border-color: hsl(var(--border)); }
.thead-row { background-color: hsl(var(--muted)); border-bottom: 1px solid hsl(var(--border)); }
.tbody-row { border-bottom: 1px solid hsl(var(--border)); transition: background-color 0.15s; }
.tbody-row:last-child { border-bottom: none; }
.tbody-row:hover { background-color: hsl(var(--muted) / 0.4); }
.th-cell {
  text-align: left; padding: 0.75rem 1rem; font-size: 0.7rem; font-weight: 600;
  color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap;
}
.td-cell { padding: 0.875rem 1rem; }
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem;
  padding: 1rem; border-bottom: 1px solid hsl(var(--border));
}
.chip-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.625rem 1rem;
  background-color: hsl(var(--muted)); border-bottom: 1px solid hsl(var(--border));
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.625rem;
  border-radius: 9999px; background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary)); font-size: 0.75rem; font-weight: 500;
}

/* ── Text gradient ── */
.text-gradient {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.65));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Animations ── */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.slide-up { animation: slideUp 0.5s ease-out; }
.fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }
.animate-spin { animation: spin 1s linear infinite; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--muted)); }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground)); }

/* ── Form helpers ── */
.form-label { font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); }
.form-error { font-size: 0.875rem; color: hsl(var(--destructive)); }
