/* ============================================================
   LA Vibes — Design Tokens & Shared Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 0.75rem;

  /* Light theme */
  --background:   40 33% 96%;
  --foreground:   150 20% 15%;
  --card:         40 30% 98%;
  --card-fg:      150 20% 15%;
  --primary:      150 30% 28%;
  --primary-fg:   40 33% 96%;
  --secondary:    45 25% 90%;
  --secondary-fg: 150 20% 20%;
  --muted:        40 20% 92%;
  --muted-fg:     150 5.2% 22.7%;
  --accent:       80 25% 85%;
  --accent-fg:    150 20% 18%;
  --destructive:  0 60% 50%;
  --destructive-fg: 0 0% 98%;
  --border:       0 0% 37.3%;
  --ring:         150 30% 28%;
  --chart-1:      150 30% 40%;
  --chart-2:      80 25% 50%;
  --chart-3:      40 40% 55%;
  --chart-4:      30 50% 60%;
  --chart-5:      0 30% 55%;
}

html.dark {
  --background:   150 15% 8%;
  --foreground:   0 0% 100%;
  --card:         150 12% 11%;
  --card-fg:      0 0% 100%;
  --primary:      80 30% 65%;
  --primary-fg:   150 15% 8%;
  --secondary:    150 10% 16%;
  --secondary-fg: 0 0% 100%;
  --muted:        150 10% 16%;
  --muted-fg:     0 0% 100%;
  --accent:       150 12% 18%;
  --accent-fg:    0 0% 100%;
  --destructive:  0 50% 40%;
  --destructive-fg: 0 0% 98%;
  --border:       0 0% 100%;
  --ring:         80 30% 65%;
  --chart-1:      150 30% 50%;
  --chart-2:      80 30% 60%;
  --chart-3:      40 40% 60%;
  --chart-4:      30 50% 65%;
}

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

html { font-family: var(--font-sans); }

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Colour Utilities ---------- */
.bg-background   { background-color: hsl(var(--background)); }
.bg-card         { background-color: hsl(var(--card)); }
.bg-primary      { background-color: hsl(var(--primary)); }
.bg-secondary    { background-color: hsl(var(--secondary)); }
.bg-muted        { background-color: hsl(var(--muted)); }
.bg-accent       { background-color: hsl(var(--accent)); }
.bg-destructive  { background-color: hsl(var(--destructive)); }
.bg-secondary\/50 { background-color: hsl(var(--secondary) / 0.5); }

.text-foreground      { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-fg)); }
.text-primary         { color: hsl(var(--primary)); }
.text-destructive     { color: hsl(var(--destructive)); }
.text-primary-foreground { color: hsl(var(--primary-fg)); }

.border-border   { border-color: hsl(var(--border)); }
.border-primary  { border-color: hsl(var(--primary)); }

.bg-primary\/5   { background-color: hsl(var(--primary) / 0.05); }
.bg-primary\/30  { background-color: hsl(var(--primary) / 0.3); }
.bg-primary\/40  { background-color: hsl(var(--primary) / 0.4); }
.bg-primary\/55  { background-color: hsl(var(--primary) / 0.55); }
.bg-primary\/60  { background-color: hsl(var(--primary) / 0.6); }
.bg-primary\/80  { background-color: hsl(var(--primary) / 0.8); }

/* ---------- Typography ---------- */
.font-serif { font-family: var(--font-serif); }
.font-sans  { font-family: var(--font-sans); }

/* ---------- Focus ring ---------- */
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

/* ---------- Navigation ---------- */
#site-nav {
  width: 100%;
  background-color: hsl(var(--background));
  position: relative;
  z-index: 50;
}
#site-nav .nav-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
#site-nav .nav-logo img { height: 6rem; margin-top: 45px; display: block; }
#site-nav .nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}
@media (min-width: 768px) {
  #site-nav .nav-inner { padding: 0 2rem; }
  #site-nav .nav-links { display: flex; }
}
#site-nav .nav-links a {
  font-family: var(--font-sans);
  font-size: 12px;
  color: hsl(var(--muted-fg));
  text-decoration: none;
  transition: color 0.15s;
}
#site-nav .nav-links a:hover,
#site-nav .nav-links a.active { color: hsl(var(--foreground)); font-weight: 500; }
#site-nav .nav-actions { display: flex; align-items: center; gap: 0.5rem; }
#site-nav .btn-icon {
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: hsl(var(--muted-fg));
  transition: color 0.15s;
  border-radius: 9999px;
}
#site-nav .btn-icon:hover { color: hsl(var(--foreground)); }
#site-nav .btn-icon svg { width: 1rem; height: 1rem; }

/* Hamburger — hidden at desktop, force with !important to beat any resets */
#hamburger-btn { display: flex; }
@media (min-width: 768px) { #hamburger-btn { display: none !important; } }

/* Mobile off-canvas */
#mobile-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.3);
}
#mobile-overlay.open { display: block; }
#mobile-menu {
  position: fixed; top: 0; right: 0;
  height: 100%; width: 18rem;
  background: white;
  /* hidden off-screen AND invisible so shadow doesn't bleed into viewport */
  visibility: hidden; pointer-events: none;
  z-index: 51;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}
html.dark #mobile-menu { background: hsl(var(--card)); }
#mobile-menu.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
#mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.4);
}
#mobile-menu-header span { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: hsl(var(--foreground)); }
#mobile-menu nav { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
#mobile-menu nav a {
  font-family: var(--font-sans); font-size: 0.875rem;
  color: hsl(var(--muted-fg)); text-decoration: none;
  padding: 0.25rem 0; transition: color 0.15s;
}
#mobile-menu nav a:hover,
#mobile-menu nav a.active { color: hsl(var(--foreground)); font-weight: 500; }

/* ---------- Footer ---------- */
#site-footer {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border) / 0.4);
}
#site-footer .footer-row {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 1rem;
}
#site-footer .footer-logo img { height: 3rem; }
#site-footer .footer-links { display: flex; gap: 1rem; }
#site-footer .footer-links a {
  font-family: var(--font-sans); font-size: 0.75rem;
  color: hsl(var(--muted-fg)); text-decoration: none;
  transition: color 0.15s;
}
#site-footer .footer-links a:hover { color: hsl(var(--foreground)); }
#site-footer p {
  margin-top: 1rem;
  font-family: var(--font-sans); font-size: 0.75rem;
  color: hsl(var(--muted-fg));
}

/* ---------- Card / Panel ---------- */
.panel {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600;
  padding: 0.625rem 1.5rem; border-radius: calc(var(--radius) - 2px);
  border: none; cursor: pointer; transition: opacity 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background-color: hsl(var(--foreground));
  color: hsl(var(--background));
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-outline {
  background: none;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-fg));
}
.btn-outline:hover { color: hsl(var(--foreground)); border-color: hsl(var(--foreground)); }

/* ---------- Form inputs ---------- */
.input {
  width: 100%; background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans); font-size: 0.875rem; color: hsl(var(--foreground));
  outline: none; transition: box-shadow 0.15s;
}
.input::placeholder { color: hsl(var(--muted-fg) / 0.6); }
.input:focus { box-shadow: 0 0 0 1px hsl(var(--ring)); }
textarea.input { resize: none; }
select.input { cursor: pointer; }

/* ---------- Toggle Switch ---------- */
.toggle-wrap { display: flex; align-items: center; gap: 0.5rem; }
.toggle {
  position: relative; width: 2.5rem; height: 1.25rem;
  border-radius: 9999px; background: hsl(var(--border));
  border: none; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.toggle.on { background: hsl(var(--primary)); }
.toggle::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 1rem; height: 1rem; border-radius: 9999px;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(1.25rem); }

/* ---------- Pill buttons ---------- */
.pill {
  display: inline-flex; align-items: center;
  padding: 0.375rem 1rem; border-radius: 9999px;
  font-family: var(--font-sans); font-size: 0.875rem;
  border: 1px solid #d6d6d6; background: #d6d6d6; color: #000;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.pill:hover { border-color: #a0a0a0; }
.pill.active { background: #325D47; color: white; border-color: #325D47; }

/* ---------- Mobile h1 top-margin fix ---------- */
@media (max-width: 767px) { h1 { margin-top: 35px; } }
@media (max-width: 450px) { .qr-preview-wrapper { transform: scale(0.75); transform-origin: top center; } }

/* ---------- Placeholder color ---------- */
::placeholder { color: hsl(var(--muted-fg)); }

/* ---------- Scrollbar (optional, WebKit) ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: hsl(var(--border) / 0.5); border-radius: 99px; }

/* ---------- Stat cell ---------- */
.stat-cell {
  text-align: center; padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--secondary) / 0.5);
}
.stat-cell .stat-value {
  font-family: var(--font-serif); font-size: 1.75rem; font-weight: 600;
  color: hsl(var(--foreground));
}
.stat-cell .stat-label {
  font-family: var(--font-sans); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: hsl(var(--muted-fg)); margin-top: 0.25rem;
}

/* ---------- Section title ---------- */
.section-title {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem;
}
.section-title span {
  font-family: var(--font-sans); font-size: 0.7rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: hsl(var(--muted-fg)); white-space: nowrap;
}
.section-title hr { flex: 1; border: none; border-top: 1px solid hsl(var(--border) / 0.6); }

/* ---------- Animate spin ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.8s linear infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
