/* map-page.css - Styles for Google Maps-style full-screen map layout */

/* ===== Full-screen map layout ===== */
body.map-page {
  overflow: hidden;
  background: #e8e4df;
}
body.map-page .header {
  display: none;
}
body.map-page .sidebar {
  display: none;
}
body.map-page #main {
  margin: 0;
  padding: 0;
  margin-top: 0;
}
body.map-page #mapid {
  position: fixed;
  top: calc(-1 * env(safe-area-inset-top, 0px));
  left: calc(-1 * env(safe-area-inset-left, 0px));
  width: calc(100vw + env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px));
  height: calc(100vh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
  height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
  min-height: calc(100vh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  min-height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  border-radius: 0 !important;
  z-index: 0;
  aspect-ratio: auto;
  box-sizing: border-box;
}
body.map-page #mapid > div > div {
  height: calc(100vh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) !important;
}
body.map-page #updateMapButton {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
}

/* ===== Floating search bar ===== */
.gm-search-bar {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(28px + env(safe-area-inset-left, 0px));
  z-index: 1000;
  width: 400px;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  padding: 4px;
}
.gm-search-bar .gm-hamburger {
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 20px;
  color: #444;
  flex-shrink: 0;
  line-height: 1;
}
.gm-search-bar input {
  border: none;
  outline: none;
  flex: 1;
  padding: 8px 12px 8px 0;
  font-size: 15px;
  background: transparent;
  min-width: 0;
}
.gm-search-bar .gm-search-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #4154f1;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

/* ===== Floating slide-out panel ===== */
.gm-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 400px;
  max-width: 85vw;
  z-index: 1005;
  background: #fff;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow: hidden;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
}
.gm-panel.open {
  transform: translateX(0);
}
.gm-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1004;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gm-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.gm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gm-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #444;
  padding: 4px 8px;
  line-height: 1;
}
.gm-panel > ul {
  flex-shrink: 0;
}
.gm-panel .sidebar-scrollable {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Content summary below search bar ===== */
.gm-content-summary {
  position: fixed;
  top: calc(68px + env(safe-area-inset-top, 0px));
  left: calc(28px + env(safe-area-inset-left, 0px));
  z-index: 999;
  width: 400px;
  max-width: calc(100vw - 32px);
  font-size: 13px;
  color: #444;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  line-height: 1.4;
  box-sizing: border-box;
}

/* ===== Map toolbar (drawer toggle + legend + share) ===== */
.gm-toolbar {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Floating legend ===== */
.gm-legend {
  background: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  font-size: 0.875rem;
}

/* ===== Floating logo ===== */
.gm-logo {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  font-size: 18px;
  font-weight: 700;
  color: #012970;
  font-family: "Bungee", sans-serif;
  text-decoration: none;
  background: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.gm-logo i {
  margin-right: 4px;
}

/* ===== Drawer overlay ===== */
.gm-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 399;
  display: none;
}
.gm-drawer-overlay.open {
  display: block;
}

/* ===== Bottom drawer ===== */
.gm-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1003;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding: 0;
  width: 50vw;
}
.gm-drawer.open {
  transform: translateY(0);
}
.gm-drawer-close-arrow {
  background: #012970;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  box-shadow: 0 2px 4px rgba(1, 41, 112, 0.3);
  transition: background 0.2s;
}
.gm-drawer-close-arrow:hover {
  background: #011d52;
}
.gm-drawer-close-arrow svg {
  fill: #fff;
}
.gm-drawer-content {
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
}
.gm-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.gm-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.gm-drawer-close:hover {
  opacity: 0.7;
}

/* ===== Drawer toggle button ===== */
.gm-drawer-toggle {
  background: #012970;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(1, 41, 112, 0.4);
  animation: drawer-pulse 3s ease-in-out infinite;
}
@keyframes drawer-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(1, 41, 112, 0.4); }
  50% { box-shadow: 0 2px 12px rgba(1, 41, 112, 0.7); }
}
.gm-drawer-toggle:hover {
  background: #011d52;
  box-shadow: 0 3px 10px rgba(1, 41, 112, 0.5);
}
.gm-drawer-toggle.open svg {
  transform: rotate(180deg);
}
.gm-drawer-toggle svg {
  transition: transform 0.3s ease;
  fill: #fff;
}

/* ===== SEO footer ===== */
.gm-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px calc(16px + env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  font-size: 11px;
  line-height: 1.4;
  border-top: 1px solid #e0e4ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gm-footer-seo {
  flex: 1;
  min-width: 0;
}
.gm-footer-seo h2 {
  font-size: 12px;
  font-weight: 600;
  color: #012970;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-footer-seo p {
  font-size: 11px;
  color: #666;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-footer-links {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.gm-footer-links a {
  color: #4154f1;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 10px;
}
.gm-footer-links a:hover {
  text-decoration: underline;
}
.gm-footer-links a + a {
  border-left: 1px solid #ccc;
}

/* ===== Directory floating panel ===== */
.gm-directory-panel {
  position: fixed;
  top: 16px;
  left: 28px;
  bottom: 16px;
  width: 50vw;
  max-width: calc(100vw - 56px);
  z-index: 500;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 24px;
  overflow-y: auto;
  margin-top: 64px;
}
.gm-directory-close {
  display: none;
  padding: 4px;
  line-height: 1;
}
.gm-directory-close:hover {
  opacity: 0.7;
}

/* ===== SEO content in panel ===== */
.gm-seo-content {
  padding: 16px 0;
}
.gm-seo-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: #012970;
  margin-bottom: 8px;
}
.gm-seo-content .lead {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

/* ===== Mobile breakpoints ===== */
@media (max-width: 768px) {
  .gm-search-bar {
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  }
  .gm-panel {
    width: 85vw;
    max-width: 360px;
  }
  .gm-toolbar {
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    justify-content: space-between;
  }
  .gm-legend {
    padding: 3px 6px;
    font-size: 0.65rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    text-align: center;
  }
  .gm-drawer-toggle {
    width: 36px;
    height: 36px;
  }
  .gm-share-wrapper .gm-share-btn {
    width: 36px;
    height: 36px;
  }
  .gm-logo {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    bottom: auto;
    right: auto;
    font-size: 12px;
    padding: 6px 14px;
  }
  .gm-content-summary {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .gm-drawer {
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 75vh;
    -webkit-overflow-scrolling: touch;
  }
  .gm-drawer-toggle.open svg {
    transform: rotate(180deg);
  }
  .gm-footer {
    flex-direction: column;
    align-items: center;
    padding: 4px calc(8px + env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
    gap: 2px;
  }
  .gm-footer-seo {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .gm-footer-links {
    justify-content: center;
    font-size: 10px;
  }
  .gm-footer-links a {
    padding: 0 5px;
  }
  .gm-footer-links a + a {
    border-left: 1px solid #ccc;
  }
  .gm-directory-panel {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    margin-top: 56px;
    padding: 16px;
  }
  .gm-directory-close {
    display: block;
  }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .gm-directory-panel {
    width: 460px;
  }
}

/* ===== Search bar hover/focus states ===== */
.gm-search-bar:focus-within {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.gm-hamburger:hover {
  background-color: #f1f3f4;
  border-radius: 50%;
}

.gm-search-btn:hover {
  color: #012970;
}

/* Panel transitions */
.gm-panel {
  scrollbar-width: thin;
  scrollbar-color: #dadce0 transparent;
}

.gm-panel::-webkit-scrollbar {
  width: 6px;
}

.gm-panel::-webkit-scrollbar-thumb {
  background: #dadce0;
  border-radius: 3px;
}

/* Bottom drawer scrollbar */
.gm-drawer {
  scrollbar-width: thin;
  scrollbar-color: #dadce0 transparent;
}

.gm-drawer::-webkit-scrollbar {
  width: 6px;
}

.gm-drawer::-webkit-scrollbar-thumb {
  background: #dadce0;
  border-radius: 3px;
}

/* ===== Drawer content typography ===== */

/* H2 section headings — bold accent with left border */
.gm-drawer-content h2.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #012970;
  padding: 0 0 0 12px;
  margin: 24px 0 12px;
  border-left: 4px solid #012970;
  line-height: 1.3;
}

/* H3 sub-headings — same accent style as H2 but smaller */
.gm-drawer-content h3 {
  font-size: 15px !important;
  font-weight: 700;
  color: #012970;
  padding: 0 0 0 12px;
  margin: 20px 0 10px;
  border-left: 4px solid #4154f1;
  line-height: 1.3;
}

/* Body paragraphs */
.gm-drawer-content p {
  font-size: 14px;
  line-height: 1.7;
  color: #555;
  margin-bottom: 12px;
}

/* Bold keywords pop against lighter body */
.gm-drawer-content p strong {
  color: #012970;
  font-weight: 600;
}

/* Lists with bullets */
.gm-drawer-content ul,
.gm-seo-content ul {
  list-style: disc;
  padding-left: 24px;
  margin: 8px 0 16px;
}

.gm-drawer-content ul li,
.gm-seo-content ul li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.gm-drawer-content ul li strong {
  color: #012970;
}

/* FAQ section spacing */
.gm-drawer-faq {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e0e4ea;
}

/* SEO content section spacing */
.gm-drawer-seo-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e0e4ea;
}

/* Panel SEO content styling (legacy) */
.gm-seo-content .card-title {
  font-size: 16px;
  padding: 12px 0 8px 0;
}

.gm-seo-content .card-text {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}

.gm-seo-content .card-subtitle {
  font-size: 14px;
  margin-top: 12px;
}

/* Statistics rows */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: #666;
}

.stat-value {
  font-weight: 600;
  color: #012970;
  text-align: right;
}

/* Stats card wrapper */
.gm-stats-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid #e0e4ea;
}

/* FAQ-style cards in drawer */
.gm-drawer-faq .gm-stats-card {
}

.gm-stats-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #012970;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px 4px;
  margin: 0;
}

/* ===== Floating share button ===== */
.gm-share-wrapper {
  position: relative;
}
.gm-share-btn {
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition:
    background 0.2s,
    box-shadow 0.2s;
  color: #5f6368;
}
.gm-share-btn:hover {
  background: #f1f3f4;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.gm-share-menu {
  position: absolute;
  bottom: 52px;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 8px 0;
  min-width: 180px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.gm-share-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.gm-share-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.gm-share-link:hover {
  background: #f1f3f4;
  color: #012970;
}
.gm-share-link svg {
  flex-shrink: 0;
}
.gm-share-divider {
  margin: 4px 12px;
  border: none;
  border-top: 1px solid #e0e4ea;
}
.gm-share-copied {
  color: #1b8a5a !important;
  font-weight: 600;
}

/* Logo hover */
.gm-logo:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Legend hover */
.gm-legend:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Smooth Leaflet map fill */
body.map-page .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* Hide Folium default styling that conflicts */
body.map-page .folium-map {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0;
  left: 0;
}

/* Hide Leaflet top-left controls - they conflict with our floating search bar */
body.map-page .leaflet-top.leaflet-left {
  display: none !important;
}

/* Ensure map controls don't conflict with our floating UI */
body.map-page .leaflet-top.leaflet-left {
  top: 76px;
  left: 16px;
}

body.map-page .leaflet-bottom.leaflet-left {
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

body.map-page .leaflet-bottom.leaflet-right {
  bottom: calc(4px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  body.map-page .leaflet-top.leaflet-left {
    top: 12px;
    left: auto;
    right: 8px;
  }

  body.map-page .leaflet-bottom.leaflet-left {
    bottom: 100px;
  }
}
