/* Local Food Map — styles
 * Scoped to the local-food-map.html page. Lives alongside styles.css; pulls
 * the NGH green accent (#00875A) for chrome and uses per-layer marker colors
 * from the JSON payload at runtime.
 */

/* ---- Map shell ---- */

.lf-map-page {
  background: #0a0e14;
  color: #e5e7eb;
}

.lf-map-intro {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
}

.lf-map-intro h2 {
  font-size: 1.75rem;
  color: #00875A;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.lf-map-intro p {
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

.lf-map-shell {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 480px;
  max-height: 820px;
  background: #1f2937;
  overflow: hidden;
  margin: 0 auto;
  max-width: 1400px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

.map-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  color: #fca5a5;
  font-weight: 600;
  text-align: center;
}

/* Leaflet attribution tweak */
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.85) !important;
}

/* ---- Food markers ---- */

.food-marker-bubble {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 18px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ---- Top control bars (left = filters, right = location + layers) ---- */

.lf-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 800;
}

.lf-controls-left {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 800;
}

.lf-control-btn {
  appearance: none;
  border: none;
  background: rgba(17, 24, 39, 0.92);
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, transform 0.05s;
  position: relative;
}

.lf-control-btn:hover,
.lf-control-btn:focus-visible {
  background: rgba(0, 135, 90, 0.92);
  outline: none;
}

.lf-control-btn:active {
  transform: translateY(1px);
}

.lf-control-btn.loading {
  opacity: 0.6;
  cursor: progress;
}

.layer-toggle-badge,
.filter-toggle-badge {
  background: #00875A;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

.layer-toggle-badge.hidden,
.filter-toggle-badge.hidden {
  display: none;
}

/* ---- Layer menu drawer (right slide-out) + Filter menu drawer (left slide-out) ---- */

.layer-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 850;
}
.layer-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Filter menu drawer (mirrors layer menu, slides from left) ---- */

.filter-menu {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 86%);
  background: #1f2937;
  border-right: 1px solid rgba(75, 85, 99, 0.6);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
  transform: translateX(-100%);
  transition: transform 0.25s;
  z-index: 900;
  overflow-y: auto;
  color: #e5e7eb;
}

.filter-menu.open {
  transform: translateX(0);
}

.filter-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(75, 85, 99, 0.5);
}

.filter-menu-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}

.filter-menu-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.filter-menu-close:hover {
  color: #fff;
}

.filter-section {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.4);
}

.filter-section h4 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #00875A;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 14px;
  color: #d1d5db;
}

.filter-option:hover {
  color: #fff;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #00875A;
  flex-shrink: 0;
}

.filter-zip-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.filter-zip-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  min-width: 0;
}

.filter-zip-input:focus {
  outline: none;
  border-color: #00875A;
  background: rgba(255, 255, 255, 0.1);
}

.filter-zip-clear {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.filter-zip-clear:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}

.filter-zip-status {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
  min-height: 16px;
}

.filter-zip-status.error {
  color: #fca5a5;
}

.filter-zip-status.success {
  color: #6ed8a8;
}

.filter-reset {
  display: block;
  width: calc(100% - 32px);
  margin: 14px 16px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-reset:hover {
  background: rgba(0, 135, 90, 0.18);
  border-color: rgba(0, 135, 90, 0.5);
}

.filter-menu-footer {
  font-size: 11px;
  color: #6b7280;
  padding: 14px 16px;
  border-top: 1px solid rgba(75, 85, 99, 0.4);
  line-height: 1.4;
}

.layer-menu {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 86%);
  background: #1f2937;
  border-left: 1px solid rgba(75, 85, 99, 0.6);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.25s;
  z-index: 900;
  overflow-y: auto;
  color: #e5e7eb;
}

.layer-menu.open {
  transform: translateX(0);
}

.layer-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(75, 85, 99, 0.5);
}

.layer-menu-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}

.layer-menu-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.layer-menu-close:hover {
  color: #fff;
}

.layer-menu-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 10px 16px 14px;
  line-height: 1.5;
}

.layer-menu-body {
  padding: 4px 0 8px;
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(55, 65, 81, 0.4);
  transition: background 0.1s;
}

.layer-toggle:hover {
  background: rgba(0, 135, 90, 0.08);
}

.layer-toggle input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: #00875A;
  flex-shrink: 0;
}

.layer-toggle input[type='checkbox']:checked + .layer-icon + .layer-name {
  color: #fff;
  font-weight: 600;
}

.layer-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.layer-name {
  flex: 1;
  font-size: 14px;
  color: #d1d5db;
}

.layer-count {
  font-size: 11px;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: 4px;
}

.layer-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  flex-shrink: 0;
}

.layer-menu-footer {
  font-size: 11px;
  color: #6b7280;
  padding: 14px 16px;
  border-top: 1px solid rgba(75, 85, 99, 0.4);
  line-height: 1.4;
}

/* ---- Info card (left overlay) ---- */

.info-card-host {
  position: absolute;
  top: 70px;
  left: 12px;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100% - 90px);
  z-index: 870;
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s, transform 0.2s;
}

.info-card-host.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.info-card {
  background: rgba(17, 24, 39, 0.96);
  border-radius: 10px;
  border-left: 4px solid #9ca3af;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  color: #e5e7eb;
}

.info-card-titlebar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.info-card-dot {
  width: 9px;
  height: 9px;
  border-radius: 5px;
  margin-top: 7px;
  flex-shrink: 0;
}

.info-card-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: #f3f4f6;
  margin: 0;
  line-height: 1.3;
}

.info-card-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  font-size: 18px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-card-close:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}

.info-card-description {
  color: #d1d5db;
  font-size: 13.5px;
  line-height: 1.45;
  margin: 0 0 10px;
  padding-left: 17px;
}

.info-phone-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 17px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #93c5fd;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.info-phone-row:hover {
  background: rgba(96, 165, 250, 0.3);
}

.info-phone-icon {
  font-size: 14px;
}

.info-facts {
  margin-left: 17px;
}

.info-fact {
  display: flex;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.4;
  color: #d1d5db;
}

.info-fact-icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.info-fact-text {
  flex: 1;
}

.info-links {
  margin: 12px 0 0 17px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-link {
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}

.info-link-primary {
  /* per-marker color, set inline */
}

.info-link-secondary {
  color: #93c5fd;
}

.info-link-ai {
  color: #a78bfa;
  font-weight: 700;
}

.info-link:hover {
  text-decoration: none;
}

.info-link-disabled {
  color: #6b7280;
  font-style: italic;
  cursor: not-allowed;
}

/* ---- Mobile tuning ---- */

@media (max-width: 640px) {
  .lf-map-shell {
    height: 78vh;
    min-height: 420px;
    border-radius: 0;
  }

  .lf-map-intro {
    padding: 1rem 1rem 0.5rem;
  }

  .lf-map-intro h2 {
    font-size: 1.4rem;
  }

  .lf-control-btn {
    font-size: 13px;
    padding: 0.5rem 0.75rem;
  }

  .info-card-host {
    top: 60px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100% - 80px);
  }
}
