/* ===========================================
   MAP-SPECIFIC STYLES
   =========================================== */

/* ===========================================
   MAP CONTAINER
   =========================================== */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-base);
  background: var(--color-surface);
}

.map-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Leaflet overrides */
.leaflet-container {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  background: var(--color-surface);
  z-index: var(--z-base);
}

.leaflet-pane {
  z-index: var(--z-base);
}

.leaflet-tile-pane {
  z-index: var(--z-base);
}

.leaflet-marker-pane {
  z-index: var(--z-dropdown);
}

.leaflet-popup-pane {
  z-index: var(--z-fixed);
}

.leaflet-tooltip-pane {
  z-index: var(--z-tooltip);
}

/* ===========================================
   MAP CONTROLS (Right side floating)
   =========================================== */
.map-controls {
  position: fixed;
  top: 50%;
  right: var(--space-4);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-fixed);
  pointer-events: none;
}

.map-control-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--color-on-surface);
  box-shadow: var(--glass-shadow);
  transition: all var(--duration-base) var(--ease-spring);
}

.map-control-btn:hover {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-shadow-strong);
  transform: translateY(-1px) scale(1.05);
}

.map-control-btn:active {
  transform: translateY(0) scale(0.98);
}

.map-control-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary);
}

.map-control-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.map-control-btn .tooltip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-white);
  background: var(--color-on-surface);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.map-control-btn:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-4px);
}

/* Locate button active state */
.map-control-btn.locate-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(27, 94, 32, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(27, 94, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(27, 94, 32, 0); }
}

/* ===========================================
   CUSTOM MAP MARKERS
   =========================================== */
.park-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform var(--duration-fast) var(--ease-spring);
  cursor: pointer;
}

.park-marker:hover {
  transform: scale(1.2);
  z-index: 1000;
}

.park-marker-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border: 3px solid var(--color-white);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: var(--shadow-lg);
  transition: all var(--duration-base) var(--ease-spring);
}

.park-marker:hover .park-marker-icon {
  transform: rotate(-45deg) scale(1.15);
  box-shadow: var(--shadow-xl);
}

.park-marker-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-white);
  transform: rotate(45deg);
  stroke-width: 2.5;
}

.park-marker-icon.sponsored {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.park-marker-icon.adopted {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
}

.park-marker-icon.featured {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
}

.park-marker-label {
  margin-top: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-on-surface);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-full);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: all var(--duration-base) var(--ease-out);
}

.park-marker:hover .park-marker-label,
.park-marker.selected .park-marker-label {
  opacity: 1;
  transform: translateY(0);
}

.park-marker.selected .park-marker-icon {
  animation: marker-bounce 0.5s var(--ease-bounce);
}

@keyframes marker-bounce {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.3); }
}

/* Cluster markers */
.marker-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-weight: var(--font-bold);
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--color-white);
  transition: transform var(--duration-fast) var(--ease-spring);
}

.marker-cluster:hover {
  transform: scale(1.15);
}

.marker-cluster-small { width: 36px; height: 36px; font-size: var(--text-sm); }
.marker-cluster-medium { width: 48px; height: 48px; font-size: var(--text-base); }
.marker-cluster-large { width: 60px; height: 60px; font-size: var(--text-lg); }

.marker-cluster div {
  background: transparent !important;
}

/* Spiderfy */
.leaflet-marker-icon.leaflet-spiderfied {
  z-index: 2000 !important;
}

/* ===========================================
   MAP POPUP / INFO CARD
   =========================================== */
.park-info-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-2xl);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform var(--duration-slower) var(--ease-spring);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.park-info-card.open {
  transform: translateY(0);
}

.park-info-card.dragging {
  transition: none;
}

.park-info-card-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--color-outline);
  border-radius: var(--radius-full);
  cursor: grab;
}

.park-info-card-header {
  position: relative;
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-outline);
}

.park-info-card-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-on-surface-variant);
  transition: all var(--duration-fast);
}

.park-info-card-close:hover {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
}

.park-info-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.park-info-card-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.park-info-card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-on-surface);
  margin-bottom: var(--space-1);
}

.park-info-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-on-surface-variant);
  margin-bottom: var(--space-4);
}

.park-info-card-location svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.park-info-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-outline);
}

.park-info-stat {
  text-align: center;
}

.park-info-stat-value {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-on-surface);
  line-height: 1.2;
}

.park-info-stat-label {
  font-size: var(--text-xs);
  color: var(--color-on-surface-disabled);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.park-info-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.park-info-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
}

.park-info-tag.sponsored {
  background: var(--color-secondary-50);
  color: var(--color-secondary);
}

.park-info-tag.adopted {
  background: var(--color-primary-50);
  color: var(--color-primary);
}

.park-info-tag.featured {
  background: var(--color-accent-50);
  color: var(--color-accent);
}

.park-info-tag.available {
  background: var(--color-success-50);
  color: var(--color-success);
}

.park-info-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.park-info-card-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Mobile bottom sheet */
@media (max-width: 767px) {
  .park-info-card {
    max-height: 85vh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }

  .park-info-card-content {
    padding: var(--space-4);
  }

  .park-info-card-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  .park-info-card-actions {
    position: sticky;
    bottom: 0;
    padding: var(--space-4);
    background: var(--color-surface);
    border-top: 1px solid var(--color-outline);
    margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) 0;
    padding-top: var(--space-3);
  }
}

/* ===========================================
   MAP LAYER BAR - Bottom horizontal tiles
   =========================================== */
.map-layer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
  pointer-events: none;
}

.map-layer-bar.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.map-layer-bar-inner {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  overflow-x: auto;
  padding: var(--space-2) 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.map-layer-bar-inner::-webkit-scrollbar {
  display: none;
}

.map-layer-tile {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
}

.map-layer-tile:hover {
  transform: scale(1.05);
}

.map-layer-tile:active {
  transform: scale(0.95);
}

.map-layer-tile-preview {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.2);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
}

.map-layer-tile.active .map-layer-tile-preview {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary), 0 4px 12px rgba(27, 94, 32, 0.4);
}

.map-layer-tile-icon {
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,0.9);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.map-layer-tile-icon svg {
  width: 100%;
  height: 100%;
}

.map-layer-tile-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
}

.map-layer-tile.active .map-layer-tile-label {
  color: var(--color-primary-lighter);
  font-weight: 600;
}

/* Animation for tiles appearing */
@keyframes tile-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.map-layer-bar.open .map-layer-tile {
  animation: tile-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1) both;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .map-layer-bar {
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }

  .map-layer-tile-preview {
    width: 56px;
    height: 56px;
  }

  .map-layer-tile-icon {
    width: 24px;
    height: 24px;
  }

  .map-layer-tile-label {
    font-size: 10px;
  }
}

/* ===========================================
   SEARCH BAR (Top floating)
   =========================================== */
.search-bar {
  position: fixed;
  top: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: var(--z-fixed);
  pointer-events: none;
}

@media (min-width: 1024px) {
  .search-bar {
    left: calc(50% + 36px);
    max-width: 480px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.sidebar-expanded .search-bar {
    left: calc(50% + 130px);
  }
}

.search-bar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  transition: all var(--duration-base) var(--ease-out);
}

.search-bar-inner:focus-within {
  background: var(--glass-bg-strong);
  border-color: var(--color-primary);
  box-shadow: var(--glass-shadow-strong), 0 0 0 4px var(--color-primary-100);
}

[data-theme="dark"] .search-bar-inner:focus-within {
  box-shadow: var(--glass-shadow-strong), 0 0 0 4px var(--color-primary-900);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--color-on-surface-disabled);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: var(--space-2) 0;
  font-size: var(--text-base);
  color: var(--color-on-surface);
  background: transparent;
  border: none;
  outline: none;
}

.search-input::placeholder {
  color: var(--color-on-surface-disabled);
}

.search-filter-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-on-surface-variant);
  transition: all var(--duration-fast);
}

.search-filter-btn:hover {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
}

.search-filter-btn svg {
  width: 20px;
  height: 20px;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-2);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow-strong);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-base) var(--ease-out);
  pointer-events: none;
  max-height: 400px;
  overflow-y: auto;
}

.search-bar-inner:focus-within .search-results-dropdown,
.search-results-dropdown:not(:empty) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--color-on-surface);
  transition: background var(--duration-fast);
}

.search-result-item:hover,
.search-result-item.highlighted {
  background: var(--color-surface-container);
}

.search-result-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-100);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.search-result-icon svg {
  width: 20px;
  height: 20px;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-type {
  font-size: var(--text-xs);
  color: var(--color-on-surface-disabled);
}

.search-result-distance {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-primary);
  white-space: nowrap;
}

.search-result-divider {
  height: 1px;
  background: var(--color-outline);
  margin: var(--space-2) var(--space-4);
}

.search-result-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-on-surface-disabled);
}

/* ===========================================
   BOTTOM INFO CARD
   =========================================== */
.bottom-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-card-height-collapsed);
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: height var(--duration-slower) var(--ease-spring);
}

.bottom-card.expanded {
  height: var(--bottom-card-height-expanded);
}

.bottom-card-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--color-outline);
  border-radius: var(--radius-full);
  cursor: grab;
}

.bottom-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bottom-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-outline);
}

.bottom-card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-on-surface);
}

.bottom-card-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-on-surface-variant);
  transition: all var(--duration-fast);
}

.bottom-card-toggle:hover {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
}

.bottom-card-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-base) var(--ease-spring);
}

.bottom-card.expanded .bottom-card-toggle svg {
  transform: rotate(180deg);
}

.bottom-card-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.bottom-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.bottom-stat {
  text-align: center;
}

.bottom-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-on-surface);
  line-height: 1.2;
}

.bottom-stat-label {
  font-size: var(--text-xs);
  color: var(--color-on-surface-disabled);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-1);
}

.bottom-card-tabs {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-5);
  border-bottom: 1px solid var(--color-outline);
  padding-bottom: var(--space-3);
}

.bottom-card-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-on-surface-variant);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.bottom-card-tab:hover,
.bottom-card-tab.active {
  color: var(--color-primary);
  background: var(--color-primary-50);
}

.bottom-card-panel {
  display: none;
  padding-top: var(--space-5);
  animation: fade-in var(--duration-normal) var(--ease-out);
}

.bottom-card-panel.active {
  display: block;
}

.park-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-outline-variant);
}

.park-list-item:last-child {
  border-bottom: none;
}

.park-list-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.park-list-info {
  flex: 1;
  min-width: 0;
}

.park-list-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.park-list-location {
  font-size: var(--text-xs);
  color: var(--color-on-surface-disabled);
  margin-top: var(--space-1);
}

.park-list-distance {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-primary);
  white-space: nowrap;
}

/* Sidebar styles moved to sidebar.css */

/* ===========================================
   NAVBAR (Top transparent)
   =========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: transparent;
  z-index: var(--z-fixed);
  transition: all var(--duration-base) var(--ease-out);
}

.navbar.scrolled {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-primary);
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar-link {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-on-surface-variant);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.navbar-link:hover {
  color: var(--color-on-surface);
  background: var(--color-surface-container);
}

.navbar-link.active {
  color: var(--color-primary);
  background: var(--color-primary-50);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-on-surface);
}

@media (max-width: 1023px) {
  .navbar-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-6);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-base) var(--ease-out);
    gap: var(--space-2);
  }

  .navbar-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-link {
    justify-content: center;
    padding: var(--space-3);
  }

  .navbar-toggle {
    display: flex;
    z-index: var(--z-fixed + 1);
  }
}

/* ===========================================
   FIND NEARBY PARK POPUP
   =========================================== */
.nearby-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

.nearby-popup-overlay.open {
  opacity: 1;
  visibility: visible;
}

.nearby-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-strong);
  z-index: var(--z-modal);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-slower) var(--ease-spring);
}

.nearby-popup-overlay.open .nearby-popup {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.nearby-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--glass-border);
}

.nearby-popup-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-on-surface);
}

.nearby-popup-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-on-surface-variant);
  transition: all var(--duration-fast);
}

.nearby-popup-close:hover {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
}

.nearby-popup-body {
  padding: var(--space-5);
}

.nearby-popup-message {
  text-align: center;
  margin-bottom: var(--space-6);
}

.nearby-popup-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-100);
  color: var(--color-primary);
  border-radius: var(--radius-full);
}

.nearby-popup-icon svg {
  width: 40px;
  height: 40px;
}

.nearby-popup-message h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-on-surface);
  margin-bottom: var(--space-2);
}

.nearby-popup-message p {
  font-size: var(--text-sm);
  color: var(--color-on-surface-variant);
  line-height: var(--leading-relaxed);
}

.nearby-popup-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nearby-popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--ease-out);
}

.nearby-popup-btn svg {
  width: 20px;
  height: 20px;
}

.nearby-popup-btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.nearby-popup-btn-primary:hover {
  background: var(--color-primary-hover);
}

.nearby-popup-btn-secondary {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
  border: 1px solid var(--color-outline);
}

.nearby-popup-btn-secondary:hover {
  background: var(--color-surface-container-high);
}

.nearby-popup-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.nearby-popup-footer p {
  font-size: var(--text-xs);
  color: var(--color-on-surface-disabled);
}

.nearby-popup-footer a {
  color: var(--color-primary);
  font-weight: var(--font-medium);
}

.nearby-popup-footer a:hover {
  text-decoration: underline;
}

/* ===========================================
   LOADING STATES
   =========================================== */
.map-loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: var(--color-surface);
  z-index: var(--z-toast);
  transition: opacity var(--duration-slow), visibility var(--duration-slow);
}

.map-loading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.map-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-outline);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.map-loading-text {
  font-size: var(--text-sm);
  color: var(--color-on-surface-variant);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 767px) {
  .map-controls {
    top: auto;
    bottom: var(--space-4);
    right: var(--space-3);
    left: auto;
    transform: none;
    flex-direction: column;
    gap: var(--space-2);
  }

  .map-control-btn {
    width: 44px;
    height: 44px;
  }

  .map-control-btn .tooltip {
    display: none;
  }

  .search-bar {
    top: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    max-width: none;
  }

  .bottom-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 479px) {
  .park-info-card-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .bottom-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===========================================
   MAP PAGE ENTRANCE ANIMATIONS
   =========================================== */
body.map-page .sidebar {
  animation: slide-right 0.4s var(--ease-spring) forwards;
}

body.map-page .search-bar {
  animation: fade-in-down 0.5s var(--ease-out) 0.2s both;
}

body.map-page .map-controls {
  animation: fade-in-right 0.5s var(--ease-out) 0.3s both;
}

body.map-page .theme-toggle-floating {
  animation: scale-in 0.4s var(--ease-spring) 0.4s both;
}

/* ===========================================
   MAP PAGE - Hide redundant navbar menu
   Sidebar provides navigation on map page
   =========================================== */
body.map-page .navbar-menu {
  display: none !important;
}

body.map-page .navbar-actions {
  display: none !important;
}

body.map-page .navbar-toggle {
  display: none !important;
}

body.map-page .navbar {
  justify-content: flex-start;
  gap: var(--space-4);
  padding-left: 88px;
}

/* Hide bottom card on map page */
body.map-page .bottom-card {
  display: none !important;
}

/* Map controls - move up since no bottom card */
body.map-page .map-controls {
  bottom: var(--space-6) !important;
}

@media (max-width: 1023px) {
  body.map-page .navbar {
    padding-left: var(--space-4);
  }
}

/* Print styles for map */
@media print {
  .map-controls,
  .search-bar,
  .sidebar,
  .navbar,
  .bottom-card,
  .park-info-card,
  .nearby-popup-overlay {
    display: none !important;
  }

  #map {
    position: absolute !important;
    height: 100vh !important;
  }
}