/* =========================================================
   791 Map Views: 
   1. Emergency Navigation Map (From Call Screen / Video Screen)
   2. Healthcare Explorer & Saved Locations (From Main Clinic Screen)
   ========================================================= */

.map-view-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #E5E7EB;
  z-index: 485; /* Stacks above Voice Call (200) and Video Call (470) */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 0 0 50px 50px;
}

.map-view-overlay.active {
  transform: translateY(0);
  pointer-events: auto;
}

/* Base Leaflet Map Canvas Container */
.map-canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #E5E7EB;
}

#leaflet-map, #explorer-leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.leaflet-control-attribution {
  display: none !important;
}

.leaflet-control-zoom {
  margin-top: 80px !important;
  margin-left: 12px !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

/* ---------------------------------------------------------
   1. EMERGENCY NAVIGATION VIEW STYLES (CENTERED)
   --------------------------------------------------------- */
.map-top-banner {
  width: calc(100% - 24px);
  margin: 12px auto 0 auto;
  background-color: var(--color-primary-teal);
  color: #FFFFFF;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 500;
  position: relative;
  text-align: center;
}

.map-turn-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.map-destination-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.map-bottom-dock {
  position: relative;
  width: 100%;
  margin: 0;
  background-color: var(--color-primary-teal);
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  border-bottom-left-radius: 50px;
  border-bottom-right-radius: 50px;
  padding: 20px 20px 38px 20px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  z-index: 500;
}

.map-close-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--color-sos-red);
  color: #FFFFFF;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease;
  flex-shrink: 0;
  position: absolute;
  left: 20px;
}

.map-close-btn:active {
  transform: scale(0.92);
}

.map-close-btn svg {
  width: 24px;
  height: 24px;
  stroke: #FFFFFF;
}

/* ETA & Route Details - Perfectly Centered */
.map-eta-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #FFFFFF;
}

.map-eta-time {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-align: center;
}

.map-eta-distance {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-top: 4px;
  opacity: 0.95;
  text-align: center;
}

/* ---------------------------------------------------------
   2. HEALTHCARE EXPLORER & SWIPABLE BOTTOM SHEET
   --------------------------------------------------------- */
.explorer-search-header {
  width: calc(100% - 24px);
  margin: 12px auto 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 500;
  position: relative;
}

.explorer-back-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #FFFFFF;
  border: none;
  color: var(--color-primary-teal);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

.explorer-back-btn:active {
  transform: scale(0.94);
}

.explorer-back-btn svg {
  width: 22px;
  height: 22px;
}

.explorer-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 0 14px;
  height: 44px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  gap: 10px;
}

.explorer-search-box svg {
  width: 20px;
  height: 20px;
  color: #6B7280;
  flex-shrink: 0;
}

.explorer-search-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  background: transparent;
}

.explorer-search-input::placeholder {
  color: #9CA3AF;
}

/* Swipable Saved Locations Bottom Sheet */
.saved-locations-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #FFFFFF;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  border-bottom-left-radius: 50px;
  border-bottom-right-radius: 50px;
  padding: 12px 20px 36px 20px;
  z-index: 500;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 380px;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  touch-action: none;
}

/* Collapsed Peek State */
.saved-locations-sheet.collapsed {
  transform: translateY(270px);
}

.saved-sheet-drag-zone {
  width: 100%;
  cursor: grab;
  padding: 4px 0 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.saved-sheet-drag-zone:active {
  cursor: grabbing;
}

.saved-sheet-handle {
  width: 42px;
  height: 5px;
  background-color: #CBD5E1;
  border-radius: 3px;
  margin-bottom: 8px;
}

.saved-sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  text-align: center;
}

.saved-locations-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 8px 2px 10px 2px;
  margin-top: 4px;
}

.saved-location-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  text-align: left;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.saved-location-card:hover {
  background: #F1F5F9;
  border-color: var(--color-primary-teal);
}

.saved-location-card:active {
  transform: scale(0.98);
}

.saved-location-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-location-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary-teal);
}

.saved-location-address {
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
}

.saved-location-tag {
  font-size: 11px;
  font-weight: 600;
  color: #0369A1;
  background: #E0F2FE;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
  width: fit-content;
}

.saved-location-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 137, 123, 0.1);
  color: var(--color-primary-teal);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.saved-location-action-icon svg {
  width: 16px;
  height: 16px;
}
