:root {
  --bg-main: #f8f9fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f7;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Status Colors (Optimized for Light Mode) */
  --accent-danger: #df2c2c;
  --accent-warning: #d97706;
  --accent-success: #16a34a;
  --accent-info: #0284c7;
  --accent-primary: #4f46e5;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
}

/* Layout Architecture */
.dashboard-container {
  display: flex;
  height: calc(100vh - 60px);
  width: 100vw;
}

.sidebar-left {
  width: 45%;
  height: calc(100vh - 60px);
  overflow: auto;
  padding: 24px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

#viewDiv {
  height: 100%;
  width: 100%;
}

/* Custom Scrollbar for Sidebar */
.sidebar-left::-webkit-scrollbar {
  width: 6px;
}

.sidebar-left::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

.sidebar-left::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* Professional Card System */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.22s ease-in-out;
  height: 100%;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Icon Framework */
.icon-box {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Metric Styling */
.metric-title {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0;
  color: #0f172a;
}

/* Risk Level Section Header */
.risk-section-header {
  background: linear-gradient(90deg, #fee2e2 0%, #fca5a5 100%);
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #991b1b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Chart Wrapper */
.chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.chart-header-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.esri-ui-corner {
  width: 199px;
}


/* Expanded Floating Map Dropdown Filter Menu Custom Form Styling */
.custom-filter-dropdown {
  width: 240px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.custom-filter-dropdown .form-select-sm {
  font-size: 0.75rem;
  border-radius: 6px;
  color: #334155;
}


/* Custom Styling for Button Group Switcher */
.disease-switcher .btn-check:checked+.btn-switcher {
  background-color: #ffffff;
  color: #0d6efd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}

.btn-switcher {
  border: none;
  color: #6c757d;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem !important;
  transition: all 0.2s ease-in-out;
}

/* Interactive Card Switcher Styling */
.disease-card {
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.disease-card:hover {
  transform: translateY(-2px);
}

.disease-card.active {
  border-color: #0d6efd;
  background-color: #f8f9fa;
}

.fa-sm {
  font-size: 1.875em !important;
}



/* Facility Filter Widget Styling */

/* Positioned at Bottom-Left */
.facility-filter-widget {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Hidden Toggle Checkbox */
.ffw-toggle-input {
  display: none;
}

.ffw-card {
  display: flex;
  align-items: flex-end;
  /* Aligns list neatly with the hub at the bottom */
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Interactive Total Hub */
.ffw-hub {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #ffffff;
  border: 7px solid #58a4a4;
  box-shadow: 0 0 0 4px rgba(88, 164, 164, 0.25), 0 8px 18px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  z-index: 2;
}

.ffw-hub:hover {
  transform: scale(1.04);
}

.ffw-hub .ffw-total-num {
  font-size: 19px;
  font-weight: 700;
  color: #3b7b7b;
  line-height: 1.1;
}

.ffw-hub .ffw-total-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

/* Collapsible Panel */
.ffw-collapsible-content {
  display: flex;
  align-items: center;
  max-width: 0;
  opacity: 0;
  transform: translateX(-15px);
  pointer-events: none;
  margin-left: 0;
  transition: max-width 0.4s ease, opacity 0.3s ease, transform 0.3s ease, margin-left 0.3s ease;
}

.ffw-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ffw-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 210px;
  height: 38px;
  padding: 0 16px 0 42px;
  background: linear-gradient(135deg, #6bb8b8 0%, #4a9999 100%);
  border-radius: 30px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ffw-item:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 14px rgba(74, 153, 153, 0.4);
}

/* White Knob */
.ffw-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Connector Branch Line */
.ffw-item::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 28px;
  height: 1.5px;
  background: #58a4a4;
  opacity: 0.75;
}

.ffw-name {
  font-size: 13px;
  font-weight: 600;
}

.ffw-count {
  font-size: 13px;
  font-weight: 700;
}

/* Expanded State */
.ffw-toggle-input:checked~.ffw-card .ffw-collapsible-content {
  max-width: 280px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  margin-left: 28px;
}

/* Position the icon perfectly inside the white knob */
.ffw-item .ffw-icon {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a9999;
  font-size: 13px;
  z-index: 3;
  /* Places icon on top of the knob */
  pointer-events: none;
}



/* chart on map  */
.ffw-hub {
  position: relative;
  border-radius: 50%;

  /* Keep your existing colors */
  /* background: ...; */
  /* color: ...; */

  animation: facilityPulse 1.8s ease-in-out infinite;
}

/* Pulsing glow using the same color */
.ffw-hub::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.35;
  animation: facilityRing 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes facilityPulse {

  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.08);
    filter: brightness(1.12);
  }
}

@keyframes facilityRing {
  0% {
    transform: scale(0.95);
    opacity: 0.45;
  }

  70% {
    transform: scale(1.25);
    opacity: 0;
  }

  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}


.ffw-hub {
  animation: facilityPulse 1.5s ease-in-out infinite;
}

@keyframes facilityPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/*  */

/* overide bootstrap */
.apexcharts-toolbar,
.alert-dismissible .btn-close {
  z-index: 0 !important;
}




/* Compass button container with modern glassmorphism effect */
.hud-compass-btn {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37),
              inset 0 0 12px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  outline: none;
  padding: 0;
}

.hud-compass-btn:hover {
  transform: scale(1.06);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(56, 189, 248, 0.2);
}

.hud-compass-btn:active {
  transform: scale(0.96);
}

/* Rotating dial that mirrors map bearing / orientation */
.compass-dial {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s linear;
}

/* Tactical SVG compass needle */
.compass-needle-svg {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Luminous outer bearing ring */
.outer-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  pointer-events: none;
}