/* ZingaStay — vanilla CSS design system. No framework, no CDN. */

:root {
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-500: #14b8a6;
  --primary-600: #0d9488;
  --primary-700: #0f766e;
  --primary-800: #115e59;

  --bg: #f9fafb;
  --bg-elevated: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;

  --radius: 0.75rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111827;
  --bg-elevated: #1f2937;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --border: #374151;
  --danger-bg: #3f1d1d;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111827;
    --bg-elevated: #1f2937;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #374151;
    --danger-bg: #3f1d1d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Layout ── */
.container { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-600);
}
.nav-links { display: flex; align-items: center; gap: 1rem; }

main { flex: 1; padding: 2rem 0; }
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary-600); color: #fff; }
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ── Forms ── */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 1px;
}
.field .hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-card {
  max-width: 32rem;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* ── Cards / grid ── */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card-img-wrap { aspect-ratio: 4/3; overflow: hidden; background: linear-gradient(135deg, var(--primary-700), var(--primary-500)); }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card-title { font-weight: 700; font-size: 1rem; }
.card-meta { color: var(--text-muted); font-size: 0.85rem; }
.price { font-weight: 700; color: var(--primary-700); }
:root[data-theme="dark"] .price,
:root:not([data-theme="light"]) .price { color: var(--primary-500); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-100);
  color: var(--primary-800);
}
:root[data-theme="dark"] .badge,
:root:not([data-theme="light"]) .badge { background: var(--primary-800); color: var(--primary-100); }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.alert-info { background: var(--primary-50); color: var(--primary-800); border: 1px solid var(--primary-500); }
:root[data-theme="dark"] .alert-info,
:root:not([data-theme="light"]) .alert-info { background: var(--primary-800); color: var(--primary-50); }

/* ── Messages / chat ── */
.thread { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.bubble { max-width: 30rem; padding: 0.6rem 0.9rem; border-radius: 1rem; font-size: 0.9rem; }
.bubble-mine { align-self: flex-end; background: var(--primary-600); color: #fff; border-bottom-right-radius: 0.25rem; }
.bubble-theirs { align-self: flex-start; background: var(--bg-elevated); border: 1px solid var(--border); border-bottom-left-radius: 0.25rem; }
.bubble-meta { font-size: 0.7rem; opacity: 0.75; margin-top: 0.2rem; }

/* ── Utility ── */
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }

.stars { color: #f59e0b; letter-spacing: 0.1em; }
.review { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
.review:last-child { border-bottom: none; }

/* Fixed outer geometry keeps lazy statistics from moving surrounding content. */
.visitor-box {
  width: min(100%, 24rem);
  height: 12rem;
  margin: 0 auto 1rem;
  overflow: auto;
  contain: layout;
  text-align: left;
  --surface: var(--bg-elevated);
  --ink: var(--text);
  --ink-soft: var(--text-muted);
  --line: var(--border);
  --line-soft: var(--border);
}
.visitor-box .vt-widget { max-width: 100%; }
