/* ============================================================
   Whereto.Beer — styles.css
   Mobile-first, playful, red/pink/gold. Map is the hero.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --red:        #F0263A;   /* bright red */
  --red-deep:   #C81830;
  --pink:       #FF4D6D;   /* reddish pink */
  --pink-soft:  #FF8FA3;
  --gold:       #F5A623;   /* beer gold */
  --gold-light: #FFD25E;
  --cream:      #FFF6E5;   /* light cream */
  --white:      #FFFFFF;
  --ink:        #3A1320;   /* dark plum for text */

  --grad-hot:   linear-gradient(135deg, var(--pink) 0%, var(--red) 60%, var(--red-deep) 100%);
  --grad-beer:  linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);

  --radius: 18px;
  --shadow: 0 8px 24px rgba(122, 14, 30, 0.25);
  --font-display: 'Baloo 2', 'Arial Rounded MT Bold', Verdana, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  --map-top-offset: 82px;  /* distance from map top to clear the header */
  --bottom-bar-h:   44px;  /* fixed bottom bar visual height (excl. safe area) */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
}

/* ============================================================
   Header — fixed, semi-transparent, never blocks the map center
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 6px 14px 2px;
  border-radius: 0 0 22px 22px;
  background: rgba(255, 246, 229, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none; /* taps go straight through to the map */
}
.logo {
  display: block;
  width: min(72vw, 340px);
  height: auto;
}

/* ============================================================
   Map
   ============================================================ */
.map-wrap {
  position: relative;
  height: 100svh; /* full screen; footer lives below the fold */
  width: 100%;
}
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #d8ecd4;
}

/* Zoom controls sit top-right, pushed below the floating header */
.leaflet-top.leaflet-right    { margin-top: var(--map-top-offset); }
/* Attribution sits bottom-right: lift it above the always-visible bottom bar */
.leaflet-bottom.leaflet-right { margin-bottom: calc(var(--bottom-bar-h) + 10px); }
.leaflet-control-zoom a {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  font-size: 20px;
  color: var(--red-deep) !important;
  border-radius: 12px !important;
  font-family: var(--font-display);
}
.leaflet-control-zoom { border-radius: 14px !important; overflow: hidden; box-shadow: var(--shadow) !important; }

/* ---------- Venue markers: big, bold, easy to tap ---------- */
.beer-pin {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 50% 4px; /* droplet-ish */
  transform: rotate(0deg);
  border: 3px solid var(--white);
  box-shadow: 0 4px 10px rgba(122, 14, 30, 0.35);
  font-size: 22px;
  transition: transform .18s ease;
}
.beer-pin:hover { transform: scale(1.12); }
.beer-pin--gold { background: var(--grad-beer); }
.beer-pin--red  { background: var(--grad-hot); }
.beer-pin--pink { background: linear-gradient(180deg, var(--pink-soft), var(--pink)); }
.beer-pin--star {
  animation: starPulse 0.9s ease-in-out 3;
  outline: 4px solid var(--gold-light);
}
@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.35); }
}

/* drop-in animation when markers appear */
.beer-pin--drop { animation: dropIn .45s cubic-bezier(.2,.9,.3,1.4) both; }
@keyframes dropIn {
  from { transform: translateY(-26px) scale(.4); opacity: 0; }
  to   { transform: translateY(0)     scale(1);  opacity: 1; }
}

/* ---------- User location: pulsing dot ---------- */
.user-dot {
  width: 20px; height: 20px;
  background: var(--red);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(240, 38, 58, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 38, 58, 0.45); }
  70%  { box-shadow: 0 0 0 18px rgba(240, 38, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 38, 58, 0); }
}

/* ---------- Cluster bubbles ---------- */
.beer-cluster {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad-hot);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
}
.beer-cluster small { font-size: 11px; line-height: 1; }

/* ---------- Popups ---------- */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  font-family: var(--font-body);
}
.leaflet-popup-content { margin: 14px 16px !important; min-width: 200px; }
.venue-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--red-deep);
  margin: 0 0 2px;
}
.venue-meta { margin: 2px 0; font-size: .86rem; color: #6b3a47; }
.venue-go {
  display: block;
  margin-top: 10px;
  padding: 10px 14px;
  text-align: center;
  background: var(--grad-hot);
  color: var(--white) !important;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(200, 24, 48, .35);
}
.venue-go:active { transform: translateY(1px); }
.venue-alt {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-size: .78rem;
  color: #6b3a47;
}

/* ============================================================
   Floating buttons
   ============================================================ */
.fab {
  position: absolute;
  z-index: 900;
  left: 50%;
  bottom: calc(var(--bottom-bar-h) + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: var(--grad-hot);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.fab:hover { transform: translateX(-50%) scale(1.05); }
.fab:active { transform: translateX(-50%) scale(.97); }

.locate-fab {
  position: absolute;
  z-index: 900;
  right: 10px;
  /* 102px = Leaflet control margin-top(10) + 2×zoom buttons(81) + 11px gap */
  top: calc(var(--map-top-offset) + 102px);
  width: 60px; height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  font-size: 30px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Loading overlay
   ============================================================ */
.loading {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 229, 0.6);
  backdrop-filter: blur(3px);
}
.loading-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  text-align: center;
}
.loading-card p {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--red-deep);
}

/* tiny animated beer mug */
.mug { display: inline-block; }
.mug-glass {
  position: relative;
  width: 44px; height: 54px;
  border: 4px solid var(--red-deep);
  border-radius: 6px 6px 10px 10px;
  overflow: hidden;
  background: var(--cream);
}
.mug-glass::after { /* handle */
  content: "";
  position: absolute;
  right: -16px; top: 10px;
  width: 14px; height: 24px;
  border: 4px solid var(--red-deep);
  border-left: none;
  border-radius: 0 10px 10px 0;
}
.mug-beer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--grad-beer);
  animation: fillUp 1.6s ease-in-out infinite alternate;
}
@keyframes fillUp { from { height: 25%; } to { height: 85%; } }
.mug-foam {
  position: absolute;
  top: 2px; left: 2px; right: 2px;
  height: 9px;
  background: var(--white);
  border-radius: 6px;
  opacity: .9;
}

/* ============================================================
   Location picker
   ============================================================ */
.picker {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(58, 19, 32, 0.45);
  backdrop-filter: blur(4px);
}
.picker-card {
  width: min(440px, 100%);
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px 22px;
  text-align: center;
}
.picker-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 4px;
  color: var(--red-deep);
}
.picker-sub { margin: 0 0 16px; font-size: .92rem; color: #6b3a47; }
.picker-search { display: flex; gap: 8px; }
.picker-search input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--pink-soft);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
}
.picker-search input:focus { outline: 3px solid var(--gold-light); border-color: var(--red); }
.picker-search button {
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--grad-hot);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
}
.search-results { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; }
.search-results li button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-top: 6px;
  border: 2px solid var(--cream);
  border-radius: 12px;
  background: var(--cream);
  font-family: var(--font-body);
  font-size: .92rem;
  cursor: pointer;
}
.search-results li button:hover,
.search-results li button:focus { border-color: var(--gold); background: #fff; }
.use-location {
  margin-top: 16px;
  width: 100%;
  padding: 13px;
  border: 2px dashed var(--gold);
  border-radius: 999px;
  background: var(--cream);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--red-deep);
  cursor: pointer;
}
.use-location:hover { background: var(--gold-light); }
.picker-error { color: var(--red); font-size: .85rem; margin: 10px 0 0; }

/* ============================================================
   Empty state + toast
   ============================================================ */
.empty-state {
  position: absolute;
  z-index: 950;
  left: 50%;
  bottom: calc(var(--bottom-bar-h) + 72px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(380px, calc(100% - 24px));
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.empty-state p {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--red-deep);
}
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.empty-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--grad-beer);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(122,14,30,.2);
}

.toast {
  position: absolute;
  z-index: 1300;
  top: calc(96px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .88rem;
  box-shadow: var(--shadow);
  max-width: calc(100% - 24px);
  text-align: center;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--grad-hot);
  color: var(--white);
  text-align: center;
}
.footer-skyline { display: block; width: 100%; height: 70px; }
.footer-inner { padding: 28px 18px calc(34px + env(safe-area-inset-bottom)); }
.footer-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 14px;
  text-shadow: 0 2px 0 rgba(122,14,30,.35);
}
.siblings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.sibling {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red-deep);
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(122,14,30,.3);
  transition: transform .15s ease;
}
.sibling:hover { transform: translateY(-3px) rotate(-1.5deg); }
.donate {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--grad-beer);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(122,14,30,.35);
  transition: transform .15s ease;
}
.donate:hover { transform: scale(1.06) rotate(1deg); }
.credits { margin: 22px 0 0; font-size: .76rem; opacity: .85; }
.credits a { color: var(--cream); }

/* ============================================================
   Always-visible bottom bar: sibling links + donate
   ============================================================ */
.bottom-bar {
  position: fixed;
  z-index: 960;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(200, 24, 48, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.bar-link {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.bar-link:hover { background: rgba(255, 255, 255, 0.28); }
.bar-donate {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--grad-beer);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.bar-donate:hover { transform: scale(1.05); }

/* ============================================================
   Accessibility & misc
   ============================================================ */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Larger screens: bigger logo, roomier buttons, taller header needs more top clearance */
@media (min-width: 768px) {
  :root { --map-top-offset: 108px; }
  .logo { width: 380px; }
  .fab { font-size: 1.2rem; padding: 16px 30px; }
}
