/* =========================================================
   Udhaba.com — Design System
   Vibrant roadside dhaba aesthetic: bold signage colors,
   friendly rounded type, built for quick scanning on a phone
   mounted in a truck cab.
   ========================================================= */

:root {
  --red: #D6301F;
  --red-dark: #A8210F;
  --saffron: #F2A71B;
  --saffron-light: #FDF1DC;
  --asphalt: #232323;
  --asphalt-light: #33312E;
  --cream: #FFF8ED;
  --green: #2E7D4F;
  --green-light: #E4F3EA;
  --ink: #201C18;
  --ink-soft: #5A5248;
  --line: #E8DCC5;
  --white: #FFFFFF;

  --font-display: 'Baloo 2', 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; }
a { color: var(--red); }
button { font-family: var(--font-body); cursor: pointer; }

.app-shell { position: fixed; inset: 0; display: flex; flex-direction: column; }

.top-bar {
  background: var(--asphalt);
  color: var(--white);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  border-bottom: 4px solid var(--saffron);
}
.top-bar .brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.top-bar .brand .mark { background: var(--red); color: var(--white); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 1.1rem; }
.top-bar .tagline { font-size: 0.72rem; color: rgba(255,255,255,0.6); font-weight: 500; }

.filter-bar { display: flex; gap: 0.5rem; padding: 0.7rem 1rem; background: var(--asphalt); overflow-x: auto; z-index: 20; }
.filter-pill { flex-shrink: 0; background: var(--asphalt-light); color: var(--white); border: none; padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; transition: background 0.15s ease; }
.filter-pill.active { background: var(--red); }
.filter-pill:hover { background: var(--red-dark); }

#map { flex: 1; width: 100%; z-index: 1; }

.leaflet-popup-content-wrapper { border-radius: var(--radius-sm); font-family: var(--font-body); }
.popup-card h4 { font-size: 1.05rem; margin-bottom: 0.2rem; }
@media (max-width: 500px) {
  .popup-card p { font-size: 0.75rem; margin: 0.1rem 0; }
  .popup-route-warning { font-size: 0.62rem; padding: 0.25rem 0.4rem; margin-top: 0.35rem; }
  .popup-card h4 { font-size: 0.9rem; margin-bottom: 0.1rem; }
  .popup-card { padding: 0; }
  .popup-spots, .popup-restaurant-parking { font-size: 0.78rem; margin-top: 0.25rem; }
  .popup-actions, .popup-actions-secondary { margin-top: 0.4rem; gap: 0.4rem; }
  .popup-btn { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
}
.popup-card .popup-type { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.15rem 0.5rem; border-radius: 999px; margin-bottom: 0.4rem; }
.popup-type.restaurant { background: var(--saffron-light); color: #8A5A0A; }
.popup-type.parking { background: var(--green-light); color: var(--green); }
.popup-type.repair { background: #DCE9F2; color: #3A6EA5; }
.popup-card p { margin: 0.2rem 0; font-size: 0.85rem; color: var(--ink-soft); }
.popup-card .popup-distance { font-weight: 700; color: var(--red); }
.popup-card .popup-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.popup-btn { flex: 1; text-align: center; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; text-decoration: none; border: none; }
.popup-btn.directions { background: var(--asphalt); color: var(--white); }
.popup-btn.report { background: var(--green); color: var(--white); }
.popup-btn.report:disabled { background: #B7C4BC; cursor: not-allowed; }
.popup-btn.report.too-far { background: #B7C4BC; cursor: not-allowed; }
.popup-spots { font-size: 0.85rem; font-weight: 700; color: var(--green); margin-top: 0.4rem; }
.popup-spots.stale { color: var(--ink-soft); font-weight: 500; }
.popup-reported-at { font-size: 0.72rem; color: var(--ink-soft); margin-top: 0.15rem; }

.popup-issue-banner {
  background: #FDEAE7;
  color: #A8210F;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  margin: 0.4rem 0;
}

.popup-route-warning {
  font-size: 0.7rem;
  color: var(--ink-soft);
  background: var(--saffron-light);
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.popup-restaurant-parking { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; margin-top: 0.3rem; }

.popup-actions-secondary { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.popup-btn.issue { background: var(--saffron); color: var(--ink); }
.popup-btn.issue.too-far { background: #E3D9C2; color: #9A9284; cursor: not-allowed; }

.tel-link { color: var(--red); font-weight: 600; text-decoration: underline; }

.locate-btn { position: absolute; bottom: 6.2rem; right: 1rem; z-index: 15; background: var(--red); color: var(--white); border: none; border-radius: 999px; width: 52px; height: 52px; font-size: 1.3rem; box-shadow: 0 4px 14px rgba(0,0,0,0.3); display: grid; place-items: center; }
.locate-btn:active { background: var(--red-dark); }

.bottom-sheet { background: var(--white); border-top-left-radius: 20px; border-top-right-radius: 20px; box-shadow: 0 -6px 24px rgba(0,0,0,0.15); z-index: 10; max-height: 24vh; display: flex; flex-direction: column; }
.sheet-handle { width: 40px; height: 5px; background: var(--line); border-radius: 999px; margin: 0.6rem auto 0.3rem; flex-shrink: 0; }
.bottom-sheet.is-collapsed .sheet-list { display: none; }
.bottom-sheet.is-collapsed { max-height: none; }
.sheet-header { cursor: pointer; }
@media (max-width: 600px) {
  .bottom-sheet { max-height: 20vh; }
}
.sheet-header { padding: 0.2rem 1.1rem 0.5rem; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.sheet-header h3 { font-size: 1rem; }
.sheet-list { overflow-y: auto; padding: 0 0.6rem 0.8rem; }
.sheet-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.sheet-item:last-child { border-bottom: none; }
.sheet-item .icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.sheet-item .icon.restaurant { background: var(--saffron-light); }
.sheet-item .icon.parking { background: var(--green-light); }
.sheet-item .icon.repair { background: #DCE9F2; }
.sheet-item .info { flex: 1; min-width: 0; }
.sheet-item .info .name { font-weight: 700; font-size: 0.9rem; }
.sheet-item .info .meta { font-size: 0.76rem; color: var(--ink-soft); }
.sheet-item .distance { font-weight: 700; color: var(--red); font-size: 0.85rem; white-space: nowrap; }
.sheet-empty { padding: 1.5rem 1rem; text-align: center; color: var(--ink-soft); font-size: 0.85rem; }
.sheet-empty .sheet-locate-btn {
  display: inline-block;
  margin-top: 0.6rem;
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.is-open { display: flex; }
.modal-card { background: var(--white); border-radius: 18px 18px 0 0; padding: 1.4rem 1.3rem 1.8rem; width: 100%; max-width: 480px; }
.modal-card h3 { margin-bottom: 0.6rem; }
.modal-card label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink-soft); }
.modal-card input[type="number"] { width: 100%; padding: 0.7rem 0.8rem; font-size: 1.1rem; border: 2px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.modal-card select, .modal-card textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  resize: vertical;
}
.modal-actions { display: flex; gap: 0.6rem; }
.modal-btn { flex: 1; padding: 0.75rem; border-radius: var(--radius-sm); border: none; font-weight: 700; font-size: 0.95rem; }
.modal-btn.cancel { background: var(--line); color: var(--ink); }
.modal-btn.submit { background: var(--green); color: var(--white); }

.toast { position: fixed; top: 5.5rem; left: 50%; transform: translateX(-50%); background: var(--asphalt); color: var(--white); padding: 0.7rem 1.2rem; border-radius: 999px; font-size: 0.85rem; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; max-width: 90vw; text-align: center; }
.toast.is-visible { opacity: 1; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Static content pages (About / Contact / Privacy / Disclaimer) ---------- */
.content-page-body {
  overflow: auto;
  position: static;
}
.content-header {
  background: var(--asphalt);
  color: var(--white);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--saffron);
  flex-wrap: wrap;
  gap: 0.6rem;
}
.content-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.content-header .brand .mark {
  background: var(--red);
  color: var(--white);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.content-header nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 1rem;
}
.content-header nav a:hover { color: var(--saffron); }

.content-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.2rem 1.3rem 3rem;
}
.content-wrap h1 {
  font-size: 1.9rem;
  margin-bottom: 0.3rem;
}
.content-wrap .content-subtitle {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.6rem;
}
.content-wrap h2 {
  font-size: 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}
.content-wrap p, .content-wrap li {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}
.content-wrap a { color: var(--red); font-weight: 600; }
.content-wrap ul { padding-left: 1.3rem; }

.content-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
}
.content-card strong { color: var(--red); }

.content-footer {
  background: var(--asphalt);
  color: rgba(255,248,237,0.6);
  text-align: center;
  padding: 1.4rem 1rem;
  font-size: 0.78rem;
}
.content-footer a { color: rgba(255,248,237,0.85); }
