/* Park Vibes - Custom Styling */

:root {
  --primary-cyan: #06b6d4;
  --primary-indigo: #6366f1;
  --amber-fresh: #f59e0b;
  --purple-expiring: #8b5cf6;
}

/* Ensure map fills entire screen behind controls for map application */
html.map-app, body.map-app {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  background-color: #f8fafc;
}

/* Content pages (Privacy, Terms, Contact) are naturally scrollable */
html.content-page, body.content-page {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100% !important;
}

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

/* Glassmorphic floating panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.12);
}

.glass-modal {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Pulsing Beacon Markers */
.beacon-marker-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beacon-core {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 2px solid white;
  position: relative;
  z-index: 3;
  transition: transform 0.2s ease;
}

.beacon-core:hover {
  transform: scale(1.15);
}

/* Pulse rings */
.beacon-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  animation: beacon-pulse 2.2s infinite ease-out;
}

.beacon-ring-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  animation: beacon-pulse 2.2s infinite ease-out;
  animation-delay: 0.9s;
}

@keyframes beacon-pulse {
  0% {
    width: 36px;
    height: 36px;
    opacity: 0.85;
  }
  100% {
    width: 90px;
    height: 90px;
    opacity: 0;
  }
}

/* Freshness variations */
.beacon-fresh .beacon-core {
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  color: white;
}
.beacon-fresh .beacon-ring,
.beacon-fresh .beacon-ring-2 {
  border: 2px solid #06b6d4;
  background-color: rgba(6, 182, 212, 0.25);
}

.beacon-moderate .beacon-core {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}
.beacon-moderate .beacon-ring,
.beacon-moderate .beacon-ring-2 {
  border: 2px solid #f59e0b;
  background-color: rgba(245, 158, 11, 0.2);
}

.beacon-expiring .beacon-core {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
}
.beacon-expiring .beacon-ring,
.beacon-expiring .beacon-ring-2 {
  border: 2px solid #8b5cf6;
  background-color: rgba(139, 92, 246, 0.2);
}

/* Inactive / Empty Park Pin (Clean round drops) */
.empty-park-icon {
  background: transparent !important;
  border: none !important;
}

.park-empty-pin {
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #06b6d4;
  color: #0891b2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3), 0 1px 3px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
  z-index: 10;
}

.park-empty-pin:hover {
  transform: scale(1.25);
  border-color: #4f46e5;
  background: #ecfeff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45);
}

/* Leaflet Popup overrides */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.leaflet-popup-content {
  margin: 0;
  line-height: 1.4;
}

.leaflet-popup-tip-container {
  margin-top: -1px;
}

/* Leaflet bottom-right zoom control placement (Google Maps style) */
.leaflet-bottom.leaflet-right {
  bottom: 20px !important;
  right: 20px !important;
  z-index: 1000 !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  margin: 0 !important;
  pointer-events: auto !important;
}

.leaflet-control-zoom a {
  background-color: transparent !important;
  color: #334155 !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  transition: all 0.15s ease;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
}

.leaflet-control-zoom a:hover {
  background-color: #f1f5f9 !important;
  color: #0891b2 !important;
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Hide zoom controls on small mobile screens (< 640px) only */
@media (max-width: 639px) {
  .leaflet-control-zoom {
    display: none !important;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Centered Modal System (Always perfectly centered on both mobile and desktop) */
.modal-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 2001;
}

.modal-centered.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Quick Chip Active states */
.chip-active {
  background-color: #ecfeff !important;
  border-color: #06b6d4 !important;
  color: #0891b2 !important;
  font-weight: 600;
}

/* Park Search Results Dropdown */
#searchResultsDropdown {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  animation: searchDropdownSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchDropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#searchResultsDropdown::-webkit-scrollbar {
  width: 6px;
}

#searchResultsDropdown::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: rgba(236, 254, 255, 0.95);
}

.search-result-item.selected .search-result-name {
  color: #0891b2;
}

.search-highlight {
  background-color: #fef08a;
  color: #854d0e;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 1.5px;
}

/* Dilli Labs Branding Footer */
.powered-by-text {
  display: inline-block;
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.dilli-footer-logo {
  display: inline-block;
  vertical-align: middle;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.dilli-labs-footer-text {
  color: #b31d27;
  display: inline-block;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* Pull-to-Refresh Gesture Indicator (Mobile) */
#pullToRefreshIndicator {
  will-change: transform, opacity;
  box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

#pullToRefreshIndicator.pull-ready #pullToRefreshIcon {
  transform: rotate(180deg);
  color: #0891b2;
}

#pullToRefreshIndicator.refreshing #pullToRefreshIcon {
  animation: pullSpin 0.75s linear infinite;
  color: #06b6d4;
}

@keyframes pullSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Animated V-Pinwheel Logo & Beacon Pulse */
.logo-pinwheel-spin {
  animation: pinwheelRotate 4s linear infinite;
  transform-origin: 17px 7px;
  will-change: transform;
}

@keyframes pinwheelRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.logo-badge-container {
  position: relative;
}

.logo-badge-container::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.45) 0%, rgba(99, 102, 241, 0) 70%);
  animation: logoBeaconPulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes logoBeaconPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}
