:root {
  --navy: #071b44;
  --blue: #1467ee;
  --blue-dark: #0e56cd;
  --blue-pale: #eaf3ff;
  --text: #14213d;
  --muted: #63708a;
  --line: #dfe6f1;
  --surface: #ffffff;
  --background: #f7f9fc;
  --success: #0b9b6b;
  --shadow: 0 18px 45px rgba(21, 46, 94, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.site-header {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(223,230,241,.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--navy);
}

.brand > span:last-child > span { color: var(--blue); }
.brand-mark { color: var(--blue); font-size: 34px; line-height: 1; }

.desktop-nav { display: flex; gap: 34px; align-items: center; font-weight: 600; }
.desktop-nav a, .link-button { transition: color .2s ease; }
.desktop-nav a:hover, .link-button:hover { color: var(--blue); }

.link-button, .text-button {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
}

.header-actions { display: flex; align-items: center; gap: 18px; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.user-email { font-size: 14px; font-weight: 600; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.button {
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(20,103,238,.24);
}

.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: var(--blue); background: #fff; border: 1px solid var(--line); }
.mobile-menu-button { display: none; border: 0; background: none; font-size: 24px; }

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(420px, .85fr) 1.35fr;
  background: #fff;
  overflow: hidden;
}

.hero-copy {
  padding: clamp(60px, 7vw, 100px) clamp(28px, 5vw, 88px);
  z-index: 2;
  background: linear-gradient(90deg, #fff 82%, rgba(255,255,255,.15));
}

.eyebrow, .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.eyebrow {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-pale);
}

h1 {
  margin: 22px 0 20px;
  font-size: clamp(52px, 5vw, 76px);
  line-height: .98;
  letter-spacing: -4px;
  color: var(--navy);
}

h1 span { color: var(--blue); }

.hero-copy > p {
  max-width: 600px;
  font-size: 18px;
  line-height: 1.65;
  color: #36435e;
}

.search-panel {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  max-width: 680px;
}

.search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(21,46,94,.07);
  color: var(--blue);
}

.search-field input {
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.current-location {
  margin-top: 15px;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 600;
  padding: 0;
}

.search-feedback {
  min-height: 24px;
  margin-top: 10px !important;
  font-size: 14px !important;
  color: var(--success) !important;
}

.hero-map {
  position: relative;
  min-height: 560px;
  background: #f2efe5;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.leaflet-cool-pin {
  width: 40px;
  height: 48px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  background: var(--blue);
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 20px rgba(9,52,128,.25);
}
.leaflet-cool-pin span { display: block; transform: rotate(45deg); }
.leaflet-cool-pin:hover { filter: brightness(1.05); }
.leaflet-cool-pin.orange { background: #ff6b24; }
.leaflet-cool-pin.teal { background: #11a7a2; }
.leaflet-cool-pin.purple { background: #7646d7; }
.leaflet-cool-pin.green { background: #12a36c; }
.leaflet-cool-pin.grey { background: #9aa5b8; }

.map-controls {
  position: absolute;
  top: 90px;
  right: 24px;
  z-index: 5;
  display: grid;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-controls button {
  width: 44px; height: 44px;
  background: white; border: 0; border-bottom: 1px solid var(--line);
  color: var(--navy); font-size: 20px;
}

.filter-trigger {
  position: absolute;
  right: 28px;
  bottom: 26px;
  z-index: 5;
  padding: 14px 18px;
  display: flex;
  gap: 28px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.content-shell {
  width: min(1440px, calc(100% - 40px));
  margin: -34px auto 0;
  position: relative;
  z-index: 10;
  padding: 28px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(223,230,241,.85);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}

h2 {
  margin: 6px 0 0;
  color: var(--navy);
  font-size: clamp(30px, 3vw, 46px);
  letter-spacing: -1.8px;
}

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.explore-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.venue-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.load-status, .load-error {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
.load-error { color: #c0392b; }

.venue-card:hover, .venue-card.selected {
  transform: translateY(-3px);
  border-color: #b8d1fb;
  box-shadow: 0 16px 30px rgba(28,68,135,.12);
}

.card-image-wrap { position: relative; height: 176px; }
.card-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cool-badge {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(255,255,255,.94);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--blue);
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(21,46,94,.12);
}
.cool-badge-solid { background: var(--blue); color: #fff; }
.moderation-badge.pending { background: #fff4de; color: #9a6300; }
.moderation-badge.rejected { background: #fde8e8; color: #b3261e; }
.save-button {
  position: absolute;
  right: 12px; top: 12px;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: var(--navy);
  font-size: 17px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(21,46,94,.12);
  transition: transform .15s ease;
}
.save-button:hover { transform: scale(1.08); }
.save-button.saved { color: #e0245e; }
.card-body { padding: 17px; }
.card-type { color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.card-body h3 { margin: 7px 0 5px; font-size: 21px; color: var(--navy); }
.card-location, .card-description { color: var(--muted); line-height: 1.5; }
.card-description { min-height: 48px; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; color: var(--muted); }
.card-meta strong { color: var(--text); }

.detail-card {
  overflow: hidden;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(21,46,94,.08);
  position: sticky;
  top: 96px;
}

.detail-card > img { width: 100%; height: 210px; object-fit: cover; display: block; }
.detail-body { padding: 22px; }
.detail-tag { margin: 0; color: var(--blue); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.detail-body h3 { margin: 8px 0 5px; font-size: 29px; color: var(--navy); }
.detail-address, .detail-description { color: var(--muted); line-height: 1.55; }
.rating-title { margin-top: 22px; font-weight: 800; }
.cooling-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--blue); }
.snow-rating { display: inline-flex; gap: 6px; }
.cool-dot {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-pale);
  color: #b9cdf2;
  font-size: 13px;
}
.cool-dot.filled { background: var(--blue); color: #fff; }
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}
.detail-metrics div { padding: 0 10px; border-right: 1px solid var(--line); }
.detail-metrics div:first-child { padding-left: 0; }
.detail-metrics div:last-child { border-right: 0; }
.detail-metrics strong, .detail-metrics span { display: block; }
.detail-metrics span { margin-top: 4px; font-size: 11px; color: var(--muted); }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-link {
  display: block;
  margin: 14px auto 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
}

.confirm-cooling { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.confirm-trigger {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--blue-pale);
  color: var(--blue);
  font-weight: 700;
  padding: 12px;
  border-radius: 11px;
}
.confirm-form { margin-top: 14px; display: grid; gap: 12px; }
.cooling-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.cooling-picker button {
  flex: 1;
  min-width: 60px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  padding: 9px 6px;
  border-radius: 9px;
}
.cooling-picker button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.confirm-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  outline: 0;
  resize: vertical;
  font: inherit;
}
.confirm-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,103,238,.12); }
.confirm-feedback { min-height: 18px; margin-top: 10px !important; font-size: 13px !important; color: var(--success) !important; }

.promo-bar {
  width: min(1370px, calc(100% - 40px));
  margin: 28px auto 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 26px 30px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.promo-item { display: flex; gap: 12px; align-items: flex-start; }
.promo-item > span { font-size: 22px; color: var(--blue); flex-shrink: 0; }
.promo-item h3 { margin: 0; color: var(--navy); font-size: 14px; }
.promo-item p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; font-size: 12.5px; }

.promo-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid #bcd6ff;
  background: var(--blue-pale);
  color: var(--navy);
  white-space: nowrap;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease;
}
.promo-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(20,103,238,.14); }
.promo-cta-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.promo-cta strong { display: block; font-size: 14px; }
.promo-cta small { display: block; font-size: 12px; color: var(--blue); font-weight: 600; }

footer {
  padding: 34px clamp(20px, 5vw, 70px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.footer-brand { font-size: 20px; }
.footer-brand .brand-mark { font-size: 26px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4,15,38,.62);
  backdrop-filter: blur(10px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 34px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 35px 80px rgba(0,0,0,.25);
}
.modal-close {
  position: absolute; right: 18px; top: 14px;
  border: 0; background: none; font-size: 32px; color: var(--muted);
}
.modal > p { color: var(--muted); }
.venue-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.venue-form label { display: grid; gap: 8px; font-weight: 700; color: var(--navy); }
.venue-form input, .venue-form select, .venue-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  outline: 0;
  resize: vertical;
}
.venue-form input:focus, .venue-form select:focus, .venue-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,103,238,.12); }
.full-width { grid-column: 1 / -1; }
.form-success { color: var(--success) !important; font-weight: 700; }

.locate-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.locate-venue-button {
  flex: 1;
  min-width: 180px;
  text-align: center;
  padding: 12px !important;
  border: 1px dashed #b8d1fb !important;
  border-radius: 11px;
  background: var(--blue-pale) !important;
  color: var(--blue) !important;
  font-weight: 700;
}
.locate-venue-button:disabled { opacity: .6; }

#venue-location-map {
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: crosshair;
}
.location-match {
  margin: 2px 0 0 !important;
  font-size: 13px !important;
  color: var(--muted) !important;
}
.location-match.error { color: #b3261e !important; font-weight: 700; }

.duplicate-warning {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: #fff4de;
  border: 1px solid #f3dca9;
}
.duplicate-warning[hidden] { display: none; }
.duplicate-warning p { margin: 0 0 12px; color: #7a5400; font-weight: 600; font-size: 14px; }
.duplicate-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.duplicate-actions .button { flex: 1; min-width: 160px; padding: 11px 14px; font-size: 13px; }

.auth-modal { width: min(420px, 100%); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--background); border-radius: 12px; margin-bottom: 22px; }
.auth-tab { flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.auth-tab.active { background: #fff; color: var(--navy); box-shadow: 0 4px 10px rgba(21,46,94,.08); }
.auth-heading { margin: 0 0 4px; font-size: 24px; color: var(--navy); }
.auth-subheading { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.google-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-weight: 700;
  color: var(--navy);
}
.google-button:hover { border-color: #b8d1fb; }
.google-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 8px; font-weight: 700; color: var(--navy); }
.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  outline: 0;
}
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,103,238,.12); }
.auth-feedback { min-height: 20px; margin-top: 14px !important; font-size: 13px !important; color: var(--muted) !important; }

.admin-modal { width: min(640px, 100%); max-height: 80vh; }
.admin-list { display: grid; gap: 14px; margin-top: 20px; }
.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.admin-row-body h3 { margin: 6px 0 4px; font-size: 18px; color: var(--navy); }
.admin-row-body p { margin: 4px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.admin-row-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.admin-row-actions .button { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
.admin-section-heading { margin: 28px 0 4px; font-size: 20px; color: var(--navy); }
.admin-section-subheading { margin: 0; color: var(--muted); font-size: 13px; }
.button-danger { color: #b3261e; background: #fde8e8; }
.button-danger:hover { background: #fbd4d4; }

.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .desktop-nav { display: none; }
  .mobile-menu-button { display: block; }
  .hero { grid-template-columns: 1fr; }
  .hero-map { min-height: 420px; }
  .hero-copy { padding-bottom: 40px; }
  .explore-layout { grid-template-columns: 1fr; }
  .detail-card { position: static; display: grid; grid-template-columns: 320px 1fr; }
  .detail-card > img { height: 100%; }
  .promo-bar { grid-template-columns: repeat(2, 1fr); }
  .promo-cta { grid-column: 1 / -1; }

  .mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 15;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(21,46,94,.12);
    padding: 12px clamp(20px, 4vw, 64px) 20px;
  }
  .mobile-nav:not([hidden]) { display: flex; }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a, .mobile-nav > .link-button {
    padding: 14px 4px;
    font-weight: 600;
    color: var(--navy);
    border-bottom: 1px solid var(--line);
    text-align: left;
    background: none;
  }
  .mobile-nav-divider { height: 1px; background: var(--line); margin: 6px 0; }
  .mobile-nav .button { width: 100%; margin: 4px 0; }
  .mobile-nav-account { display: flex; align-items: center; gap: 10px; padding: 12px 4px 4px; }
  .mobile-nav-account .user-email { flex: 1; max-width: none; }
}

@media (max-width: 780px) {
  .site-header { height: 68px; padding-inline: 18px; }
  .brand { font-size: 21px; }
  .brand-mark { font-size: 28px; }
  .header-actions > .text-button, .header-actions > .button { display: none; }
  .user-email { max-width: 90px; }
  .hero-copy { padding: 48px 22px 30px; }
  h1 { font-size: 50px; letter-spacing: -3px; }
  .search-panel { flex-direction: column; }
  .search-panel .button { width: 100%; }
  .hero-map { min-height: 350px; }
  .content-shell { width: calc(100% - 20px); margin-top: -16px; padding: 18px; border-radius: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filter-chips { justify-content: flex-start; overflow-x: auto; width: 100%; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { white-space: nowrap; }
  .venue-grid { grid-template-columns: 1fr; }
  .detail-card { grid-template-columns: 1fr; }
  .detail-card > img { height: 220px; }
  .promo-bar { grid-template-columns: 1fr; width: calc(100% - 20px); padding: 22px; }
  footer { width: calc(100% - 20px); }
  footer { margin: 0 auto 10px; border: 1px solid var(--line); border-radius: 18px; flex-direction: column; text-align: center; }
  .venue-form { grid-template-columns: 1fr; }
  .full-width { grid-column: 1; }
}
