@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #822f33; /* Old Settlers Burgundy */
  --primary-hover: #6a2428;
  --accent-cyan: #1fb2d0;
  --accent-amber: #f59e0b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #0b0f17;
}

.font-display {
  font-family: 'Outfit', sans-serif;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
}

/* Vertical Staging Division Badges */
.vertical-division-badge {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  letter-spacing: 0.14em;
  font-weight: 800;
  font-size: 11px;
  line-height: 1.1;
  padding: 8px 5px;
  border-radius: 6px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0,0,0,0.3);
  white-space: nowrap;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  pointer-events: auto !important;
  user-select: none;
}

.vertical-division-badge:hover {
  transform: rotate(180deg) scale(1.15);
  z-index: 60 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.8), 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Horizontal Zone Badges */
.custom-zone-badge {
  pointer-events: auto !important;
  user-select: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-zone-badge:hover {
  transform: scale(1.12);
  z-index: 55 !important;
}

/* Road Closure Barricade Indicator */
.closure-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #dc2626;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  cursor: pointer;
  pointer-events: auto !important;
  transition: transform 0.15s ease;
}

.closure-marker:hover {
  transform: scale(1.25);
  z-index: 50 !important;
}

/* Custom MapLibre Popups */
.maplibregl-popup-content {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  color: #f8fafc !important;
  border-radius: 1.25rem !important;
  padding: 1.1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.6), 0 10px 15px -6px rgba(0, 0, 0, 0.5) !important;
  min-width: 250px;
  max-width: 320px;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: rgba(15, 23, 42, 0.96) !important;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: rgba(15, 23, 42, 0.96) !important;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: rgba(15, 23, 42, 0.96) !important;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: rgba(15, 23, 42, 0.96) !important;
}

.maplibregl-popup-close-button {
  color: #94a3b8 !important;
  padding: 6px 10px !important;
  font-size: 18px !important;
  top: 8px !important;
  right: 8px !important;
  border-radius: 9999px !important;
  transition: all 0.15s ease !important;
}

.maplibregl-popup-close-button:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

/* Glassmorphism panel styles */
.glass-panel {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

/* Modal Animations */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* MapLibre Controls Dark Mode Override */
.maplibregl-ctrl-group {
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0.85rem !important;
  overflow: hidden;
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.5) !important;
}

.maplibregl-ctrl-group button {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.maplibregl-ctrl-group button:last-child {
  border-bottom: none !important;
}

.maplibregl-ctrl-group button:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

.maplibregl-ctrl-icon {
  filter: invert(0.95) brightness(1.2);
}

.maplibregl-ctrl-scale {
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

.maplibregl-ctrl-attrib {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(6px) !important;
  color: #94a3b8 !important;
  font-size: 10px !important;
}

.maplibregl-ctrl-attrib a {
  color: #38bdf8 !important;
}
