/* public/css/styles.css */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, Segoe UI, Roboto, sans-serif; }
#map { position: absolute; inset: 0; }
.hidden { display: none !important; }

#top-bar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 5; }
.search { background: #fff; border-radius: 22px; padding: 8px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.15); display: flex; gap: 8px; align-items: center; }
.search input { border: 0; outline: 0; flex: 1; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #fff; border: 1px solid #ddd; border-radius: 16px; padding: 6px 12px; font-size: 13px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: pointer; }
.chip.active { background: #2e7d32; color: #fff; border-color: #2e7d32; }

.geo { position: absolute; right: 14px; bottom: 96px; z-index: 5; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: 20px; cursor: pointer; }
.legend { position: absolute; left: 12px; bottom: 16px; z-index: 5; background: rgba(255,255,255,.95); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.legend span { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sw.yes { background: #2e9b36; } .sw.no { background: #e03b3b; } .sw.unk { background: #9aa0a6; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.18); padding: 12px 16px 16px; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.sheet .grab { width: 38px; height: 5px; background: #d2d2d6; border-radius: 3px; margin: 0 auto 10px; }
.sheet-header { flex: 0 0 auto; }            /* fixed header: name, address, summary */
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }  /* only the fuel list scrolls */
.sheet-close { display: none; position: absolute; top: 8px; right: 10px; z-index: 1; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f1f1f3; color: #555; font-size: 20px; line-height: 30px; text-align: center; cursor: pointer; padding: 0; }
.sheet-close:hover { background: #e4e4e8; }
.sheet h2 { font-size: 16px; margin: 0; padding-right: 36px; }
.sheet .addr { font-size: 12px; color: #8a8a8e; margin: 2px 0 12px; }
.hero { border-radius: 12px; padding: 10px 12px; text-align: center; margin-bottom: 12px; font-weight: 700; }
.hero.yes { background: #eef8ef; color: #1e7d24; border: 1px solid #cde9cf; }
.hero.no { background: #fdeaea; color: #c62828; border: 1px solid #f3c2c2; }
.hero.unknown { background: #f1f1f3; color: #777; border: 1px solid #ddd; }
.recent { margin-top: 10px; }
.recent-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #9aa0a6; margin-bottom: 6px; }
.recent-list { display: flex; flex-wrap: wrap; gap: 6px; }
.recent-empty { font-size: 12px; color: #b0b0b4; }
.rv { font-size: 11px; padding: 3px 8px; border-radius: 10px; border: 1px solid; white-space: nowrap; }
.rv.yes { background: #f1faf2; color: #1e7d24; border-color: #bfe0c1; }
.rv.no { background: #fdf2f2; color: #c62828; border-color: #f0c4c4; }
.fuel-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f0f2; }
.fuel-row .f-name { font-weight: 500; }
.fuel-row .badge { justify-self: start; }
.fuel-row .vote-btns { justify-self: end; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 10px; font-weight: 600; }
.badge.yes { background: #e3f4e4; color: #1e7d24; } .badge.no { background: #fdeaea; color: #c62828; } .badge.unknown { background: #f1f1f3; color: #888; }
.vote-btns button { font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid; margin-left: 6px; cursor: pointer; background: #fff; }
.vote-btns .v-yes { color: #1e7d24; border-color: #bfe0c1; } .vote-btns .v-no { color: #c62828; border-color: #f0c4c4; }
.vote-btns .v-yes.chosen { background: #2e9b36; color: #fff; border-color: #2e9b36; }
.vote-btns .v-no.chosen { background: #e03b3b; color: #fff; border-color: #e03b3b; }
.vote-btns button:disabled { cursor: default; opacity: .55; }
.vote-btns button:disabled.chosen { opacity: 1; } /* keep the chosen vote vivid */

/* User location marker (blue dot + pulsing accuracy halo handled as a map layer). */
.user-dot { width: 16px; height: 16px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(26,115,232,.25); }

/* "Stations near you" list rows inside the shared sheet. */
.sheet-back { display: block; background: none; border: 0; color: #1a73e8; font-size: 13px; font-weight: 600; padding: 0 0 8px; cursor: pointer; }
.near-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid #f0f0f2; padding: 11px 0; cursor: pointer; font: inherit; }
.near-row:first-child { border-top: 0; }
.near-row:hover { background: #f7f8fa; }
.near-dot { width: 11px; height: 11px; border-radius: 50%; }
.near-info { min-width: 0; }
.near-name { display: block; font-weight: 600; font-size: 14px; color: #202124; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-addr { display: block; font-size: 12px; color: #70757a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-dist { font-size: 13px; font-weight: 600; color: #202124; white-space: nowrap; }

.gate { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; }
.gate-scrim { position: absolute; inset: 0; background: rgba(20,30,22,.45); backdrop-filter: blur(5px); }
.gate-card { position: relative; background: #fff; border-radius: 20px; padding: 26px 22px; max-width: 320px; margin: 0 20px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.gate-logo { width: 56px; height: 56px; border-radius: 16px; background: #2e7d32; color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.gate-card h1 { font-size: 18px; margin: 0 0 8px; }
.gate-card p { font-size: 13px; color: #777; margin: 0 0 18px; line-height: 1.5; }
.tg-btn { display: inline-flex; gap: 8px; align-items: center; background: #229ed9; color: #fff; font-weight: 700; font-size: 14px; padding: 12px 20px; border-radius: 12px; text-decoration: none; }
.max-btn { display: inline-flex; gap: 8px; align-items: center; background: linear-gradient(135deg, #6a5cff, #3b4fe0); color: #fff; font-weight: 700; font-size: 14px; padding: 12px 20px; border-radius: 12px; text-decoration: none; margin-top: 10px; }
.modal { position: absolute; inset: 0; z-index: 11; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.4); }
.modal-card { background: #fff; border-radius: 16px; padding: 22px; max-width: 320px; margin: 0 20px; text-align: center; }
.map-blurred .maplibregl-canvas { filter: blur(5px); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1c1c1e; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Desktop: Google-Maps-style left column — constrained-width search and a
   left-docked station panel instead of a full-width bottom sheet. */
@media (min-width: 760px) {
  #top-bar { left: 16px; right: auto; width: 380px; max-width: calc(100vw - 32px); }
  .sheet {
    left: 16px; right: auto; top: 132px; bottom: 16px;
    width: 380px; max-width: calc(100vw - 32px);
    max-height: none; border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  }
  .sheet .grab { display: none; }
  .sheet-close { display: block; }
  .geo { bottom: 24px; }
}
