/* ============================================================
   GuideToSFOT — MAP UI STYLESHEET
   Clean, organized, no inline styles anywhere
   ============================================================ */


/* ------------------------------------------------------------
   MAP CONTAINER
------------------------------------------------------------ */
#sfo-map {
  width: 100%;
  height: 80vh;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.leaflet-container:fullscreen {
  width: 100% !important;
  height: 100% !important;
}

/* ------------------------------------------------------------
   MAP CONTROLS WRAPPER
------------------------------------------------------------ */
#map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 12px;
}


/* ------------------------------------------------------------
   SEARCH BOX
------------------------------------------------------------ */
#map-search-container {
  position: relative;
  flex: 1;
  min-width: 260px;
}

#map-search {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #bbb;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#map-search:focus {
  outline: none;
  border-color: #305c8d;
  box-shadow: 0 0 0 2px rgba(48, 92, 141, 0.2);
}

/* Search dropdown */
#map-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 4px;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.map-search-item {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

.map-search-item:hover {
  background: #f2f6fa;
}

/* Flash when selected */
.search-result.flash {
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.25s ease;
}


/* ------------------------------------------------------------
   FILTERS — POLISHED CHECKBOXES
------------------------------------------------------------ */
#map-layer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  min-width: 260px;
}

/* Prevent accidental text highlighting */
#map-layer-filters label {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#map-layer-filters label:hover {
  background: #f0f4fa;
}

/* Custom checkbox */
#map-layer-filters input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #305c8d;
  border-radius: 3px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  margin: 0;
  box-sizing: border-box;
}

/* Checked state */
#map-layer-filters input[type="checkbox"]:checked {
  background-color: currentColor;
  border-color: currentColor;
}

/* Centered checkmark */
#map-layer-filters input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Checked label text */
#map-layer-filters input[type="checkbox"]:checked + span {
  color: #305c8d;
  font-weight: 600;
}


/* ============================================================
   CATEGORY COLOR MAPPING FOR FILTER BUTTONS
============================================================ */

/* Base neutral label style */
#map-layer-filters label {
  border: 1px solid #ddd;
  background: #fafafa;
}

/* Hover */
#map-layer-filters label:hover {
  background: #f0f0f0;
}

/* --------------------------
   RIDES (#660303)
--------------------------- */
#map-layer-filters input[data-layer="rides"] {
  border-color: #660303;
}
#map-layer-filters input[data-layer="rides"]:checked {
  background: #660303;
  border-color: #660303;
}
#map-layer-filters input[data-layer="rides"]:checked + span {
  color: #660303;
  font-weight: 600;
}

/* --------------------------
   DINING (#1C4D66)
--------------------------- */
#map-layer-filters input[data-layer="dining"] {
  border-color: #1C4D66;
}
#map-layer-filters input[data-layer="dining"]:checked {
  background: #1C4D66;
  border-color: #1C4D66;
}
#map-layer-filters input[data-layer="dining"]:checked + span {
  color: #1C4D66;
  font-weight: 600;
}

/* --------------------------
   SHOPPING (#006303)
--------------------------- */
#map-layer-filters input[data-layer="shopping"] {
  border-color: #006303;
}
#map-layer-filters input[data-layer="shopping"]:checked {
  background: #006303;
  border-color: #006303;
}
#map-layer-filters input[data-layer="shopping"]:checked + span {
  color: #006303;
  font-weight: 600;
}

/* --------------------------
   ENTERTAINMENT (#A8531E)
--------------------------- */
#map-layer-filters input[data-layer="entertainment"] {
  border-color: #A8531E;
}
#map-layer-filters input[data-layer="entertainment"]:checked {
  background: #A8531E;
  border-color: #A8531E;
}
#map-layer-filters input[data-layer="entertainment"]:checked + span {
  color: #A8531E;
  font-weight: 600;
}

/* --------------------------
   FACILITIES (#38185B)
--------------------------- */
#map-layer-filters input[data-layer="facilities"] {
  border-color: #38185B;
}
#map-layer-filters input[data-layer="facilities"]:checked {
  background: #38185B;
  border-color: #38185B;
}
#map-layer-filters input[data-layer="facilities"]:checked + span {
  color: #38185B;
  font-weight: 600;
}

/* --------------------------
   LABELS (Generic Black)
--------------------------- */
#map-layer-filters input[data-layer="labels"] {
  border-color: #000000;
}

#map-layer-filters input[data-layer="labels"]:checked {
  background: #000000;
  border-color: #000000;
}

#map-layer-filters input[data-layer="labels"]:checked + span {
  color: #000000;
  font-weight: 600;
}


/* ------------------------------------------------------------
   POPUP STYLING — REFINED & CONSISTENT
------------------------------------------------------------ */
.leaflet-popup-content {
  font-family: inherit;
  padding: 10px 12px;
  line-height: 1.4;
  width: 260px;              /* tighter, proportional width */
  max-width: 90vw;           /* responsive limit for mobile */
  box-sizing: border-box;
  text-align: center;
}

/* Override Leaflet's default popup paragraph spacing */
.leaflet-popup-content p {
  margin: 2px 0 !important;
  line-height: 1.3;
}

/* Title */
.popup-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

/* Description */
.popup-desc {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 0.75rem;
}

/* Image */
.popup-image {
  width: 100%;
  max-width: 250px;          /* never exceed native thumbnail size */
  height: auto;
  display: block;
  margin: 0 auto 0.75rem auto;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Height badge + Fast Lane icon row */
.ride-popup-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0.75rem 0;
}

/* Height badge */
.height-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: #305c8d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Fast Lane logo */
.fastlane-icon {
  height: 20px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

/* Popup links */
.popup-link {
  display: inline-block;
  font-weight: 600;
  font-size: 13px;
  color: #305c8d;
  text-decoration: none;
  margin-top: 4px;
}

.popup-link:hover {
  text-decoration: underline;
}

/* Popup card wrapper */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
