/* ============================================================
   MTT Map — Styles
   Taco Tour vibes: warm, bold, festive. System-fast.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  /* Core palette */
  --bg:           #FFF8F0;
  --bg-card:      #FFFFFF;
  --fg:           #1C0600;
  --muted:        #8A6652;
  --border:       #EBDDD2;
  --shadow:       0 4px 20px rgba(100, 30, 0, 0.10);
  --shadow-lift:  0 8px 30px rgba(100, 30, 0, 0.16);

  /* Brand */
  --primary:        #E85516;
  --primary-dark:   #C43E0A;
  --primary-light:  #FFF0E6;
  --gold:           #F5A623;
  --gold-light:     #FFF9ED;
  --shell-bg:       #FFF3E6;

  /* Layout */
  --header-h:   60px;
  --radius:     14px;
  --tap:        44px;
  --map-gap:    12px;

  /* Typography */
  --font:         'Nunito', system-ui, sans-serif;
  --font-display: 'Fredoka One', system-ui, sans-serif;

  /* Header */
  --header-bg: #1C0600;
  --header-fg: #FFE2C8;
}

/* ===================== RESET ===================== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  background: var(--shell-bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* ===================== APP SHELL ===================== */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===================== HEADER ===================== */
.app-header {
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--header-bg);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.app-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--header-fg);
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1;
}

.app-title::before {
  content: '🌮 ';
}

/* ===================== TABS ===================== */
.tabs {
  justify-self: center;
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
  padding: 4px;
  gap: 4px;
}

.tab {
  height: 32px;
  min-width: 72px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: rgba(255, 220, 195, 0.65);
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  border-radius: 999px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.tab.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(232, 85, 22, 0.55);
}

/* ===================== HEADER ACTIONS ===================== */
.header-actions {
  display: inline-flex;
  gap: 6px;
  justify-self: end;
}

/* ===================== ICON BUTTONS ===================== */

/* Base */
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--header-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 150ms, transform 100ms;
  flex-shrink: 0;
}

.icon-btn svg { width: 20px; height: 20px; }

.icon-btn:active { transform: scale(0.93); }

/* Non-header icon buttons (map buttons, list hearts, sheet close, card fav) */
#view-map .locate-btn,
.sheet .icon-btn,
.list-item .icon-btn,
#card .icon-btn,
.about-header .icon-btn {
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
}

/* Locate button: branded orange */
.locate-btn {
  position: absolute;
  top: calc(var(--map-gap) + 10px + env(safe-area-inset-top));
  right: calc(var(--map-gap) + 10px + env(safe-area-inset-right));
  z-index: 1000;
  background: var(--primary) !important;
  border-color: var(--primary-dark) !important;
  color: #fff !important;
  box-shadow: 0 3px 14px rgba(232, 85, 22, 0.45);
}

.locate-btn:hover,
.locate-btn:focus {
  background: var(--primary-dark) !important;
}

.locate-btn:disabled {
  opacity: 0.55;
}

/* About-header icon buttons */
.about-header .icon-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: var(--header-fg) !important;
}

/* ===================== MAIN CONTENT ===================== */
.app-main {
  flex: 1;
  min-height: 0;
  position: relative;
}

.view {
  height: 100%;
  width: 100%;
}

.view[hidden] { display: none !important; }

/* ===================== MAP VIEW ===================== */
#view-map {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--map-gap);
}

/* Rounded "card" framing around the map */
.map-card {
  flex: 1;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#map {
  height: 100%;
  width: 100%;
}

/* Toast */
.map-toast {
  position: absolute;
  top: calc(var(--map-gap) + 10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--fg);
  color: #FFD6B0;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  max-width: calc(100% - 24px);
  text-align: center;
  white-space: nowrap;
}

.map-toast.is-visible { opacity: 1; }

/* ===================== LIST VIEW ===================== */
#view-list {
  padding: var(--map-gap);
  background: var(--shell-bg);
  height: 100%;
}

.list {
  height: 100%;
  overflow: auto;
  padding: 0 0 90px;
  background: transparent;
}

/* Individual stop card */
.list-item {
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  margin: 0 0 10px;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(100, 30, 0, 0.06);
  transition: box-shadow 140ms ease, transform 120ms ease;
}

.list-item:active {
  transform: scale(0.99);
  box-shadow: 0 1px 4px rgba(100, 30, 0, 0.08);
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-item-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--fg);
  margin: 0;
  line-height: 1.3;
}

.list-item-desc {
  margin: 6px 0 8px;
  color: #5A3520;
  font-size: 14px;
  font-style: italic;
  line-height: 1.4;
}

.list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

/* Tags */
.tag {
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gold-light);
  color: #7A4A00;
  border: 1.5px solid #F0D090;
}

/* Empty state */
.list .muted {
  padding: 36px 16px !important;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

/* ===================== BOTTOM DETAIL CARD ===================== */
#card {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-card);
  border-top: 3px solid var(--primary);
  padding: 14px 16px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 28px rgba(100, 30, 0, 0.18);
  display: none;
  z-index: 1100;
  animation: slideUp 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1.3;
}

#card p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #6A4A30;
}

/* ===================== FAVORITES ===================== */
.fav-btn {
  transition: color 150ms ease, transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.fav-btn svg { width: 20px; height: 20px; }

.fav-btn.is-fav {
  color: #E0245E;
  transform: scale(1.2);
}

.fav-btn:active { transform: scale(0.88); }

/* ===================== OVERLAYS ===================== */
.overlay[hidden] { display: none; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 6, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ===================== FILTER SHEET ===================== */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -10px 50px rgba(100, 30, 0, 0.22);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: sheetUp 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0.7; }
  to   { transform: translateY(0);    opacity: 1;   }
}

/* Drag handle */
.sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  height: 52px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.sheet-body {
  padding: 16px 16px 24px;
  overflow: auto;
}

/* ===================== FILTER CONTROLS ===================== */
.filter-block { margin: 0 0 16px; }

.filter-label {
  display: block;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 10px;
}

.filter-input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 2px solid var(--border);
  padding: 0 14px;
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--fg);
  transition: border-color 150ms;
  outline: none;
}

.filter-input:focus { border-color: var(--primary); }

.filter-hint {
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Chip (diet tag) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--bg-card);
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 160ms ease;
  color: var(--fg);
  user-select: none;
}

.chip:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 2px 10px rgba(232, 85, 22, 0.35);
}

.chip input { display: none; }

/* Favorites toggle */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 160ms ease;
  color: var(--fg);
  user-select: none;
}

.filter-toggle:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.filter-toggle input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Filter actions */
.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* ===================== BUTTONS ===================== */
.primary-btn {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
  box-shadow: 0 3px 12px rgba(232, 85, 22, 0.35);
}

.primary-btn:hover  { background: var(--primary-dark); }
.primary-btn:active { transform: scale(0.97); }

.secondary-btn {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: background 150ms ease;
}

.secondary-btn:hover { background: var(--shell-bg); }

/* ===================== ABOUT SCREEN ===================== */
.about {
  position: absolute;
  inset: 0;
  background: var(--header-bg);
  display: flex;
  flex-direction: column;
  color: #FFE2C8;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.about-header {
  height: var(--header-h);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  align-items: center;
  padding: 8px 10px;
  flex-shrink: 0;
}

.about-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--header-fg);
  letter-spacing: 0.01em;
}

.about-spacer { width: var(--tap); }

.about-body {
  padding: 24px 20px;
  overflow: auto;
  line-height: 1.7;
  flex: 1;
}

.about-body p {
  margin: 0 0 14px;
  font-size: 15px;
}

.about-body strong {
  color: var(--gold);
}

.about-body a {
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}

.about-body a:hover { text-decoration: underline; }

.about-body .muted {
  color: rgba(255, 220, 190, 0.5);
  font-size: 13px;
}

.about-body .about-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 12px;
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 18px 0;
}

/* ===================== MISC ===================== */
button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* Muted utility */
.muted { color: var(--muted); }

/* Leaflet taco marker */
.leaflet-div-icon.taco-marker {
  background: transparent;
  border: 0;
}

.taco-marker svg {
  display: block;
  width: 60px;
  height: 60px;
}
