/* ECDC Vibrio Viewer - Color Variables */
:root {
  /* Primary Colors */
  --color-primary-green: #67b00a;
  --color-primary-green-dark: #3d6806;
  --color-primary-green-light: #aad58c;

  --color-primary-teal: #7cbdc1;
  --color-primary-teal-dark: #5e8f94;
  --color-primary-teal-light: #a7d3d7;

  /* Grayscale */
  --color-black: #06070a;
  --color-gray-dark: #4d4d4d;
  --color-gray-medium: #808080;
  --color-gray-light: #cdcccc;

  /* Secondary Colors */
  --color-sec-green: #65B32E;
  --color-sec-teal: #7CBDC4;
  --color-sec-lime: #C0D236;
  --color-sec-blue: #3E5B84;
  --color-sec-emerald: #008C75;
}


html, body {
  height: 100%;
}


body {
  font-family: 'Roboto', sans-serif;
  font-style: normal;
  color: var(--color-text, #333);
}


#map {
  flex-grow: 1;
  height: 100%;        /* ✅ REQUIRED */
  min-height: 400px;   /* optional safety */
}


header {
  background-color: white;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header .logo {
  display: flex;
  align-items: center;
}

header .logo img {
  height: 50px;
  margin-right: 30px;
}

header nav {
  display: flex;
  gap: 15px;
}

header nav a {
  color: #333333;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

header nav a:hover {
  color: var(--color-primary-green-light);
}

.leaflet-control {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid var(--color-border, #cdcccc);
  
}

.leaflet-control-custom {
  border: 2px solid var(--color-border, #cdcccc);
  
}

.leaflet-control-custom select,
.leaflet-control-custom input[type="range"],
.leaflet-control-custom button {
  font-family: 'Roboto', sans-serif;
}

.leaflet-control-custom button {
  background-color: white;
  border: 2px solid var(--color-primary-green, #67b00a);
  color: var(--color-primary-green-dark, #3d6806);
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.leaflet-control-custom button:hover:not(:disabled) {
  background-color: var(--color-primary-green, #67b00a);
  color: white;
}

.leaflet-control-custom button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--color-gray-light, #cdcccc);
  color: var(--color-gray-medium, #808080);
}

.leaflet-control-custom input[type="range"] {
  accent-color: var(--color-primary-green, #67b00a);
}

.leaflet-control-custom input[type="date"] {
  padding: 6px;
  border: 2px solid var(--color-border, #cdcccc);
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Roboto', sans-serif;
  transition: border-color 0.2s ease;
  background: white;
  cursor: pointer;
}

.leaflet-control-custom input[type="date"]:focus {
  outline: none;
  border-color: var(--color-primary-green, #67b00a);
}

.leaflet-control-custom input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  color: var(--color-primary-green, #67b00a);
}

.leaflet-control-custom select {
  padding: 8px 12px;
  border: 2px solid var(--color-border, #cdcccc);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  background: white;
}

.leaflet-control-custom select:focus {
  outline: none;
  border-color: var(--color-primary-green, #67b00a);
}

.leaflet-popup {
  max-width: 250px;
}

/* Leaflet popup styles */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(6, 7, 10, 0.15);
  border: 1px solid var(--color-border, #cdcccc);
}

.leaflet-popup-content {
  margin: 0;
  padding-right: 30px;
  line-height: 1.6;
  min-width: 200px;
  font-family: 'Roboto', sans-serif;
}

.leaflet-popup-content strong {
  color: var(--color-primary-green-dark, #3d6806);
  font-size: 16px;
}

.leaflet-popup-close-button {
  font-size: 24px !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  text-align: center !important;
  right: 8px !important;
  top: 8px !important;
  color: var(--color-gray-dark, #4d4d4d) !important;
}

/* Leaflet tooltip styles */
.leaflet-tooltip {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-border, #cdcccc);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(6, 7, 10, 0.1);
  padding: 6px 10px;
  font-family: 'Roboto', sans-serif;
}

/* About Popup styling */
#aboutPopup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--color-border, #cdcccc);
  z-index: 1000;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  font-family: 'Roboto', sans-serif;
}

#aboutPopup h2 {
  margin-top: 0;
  color: var(--color-primary-green-dark, #3d6806);
  border-bottom: 2px solid var(--color-primary-teal, #7cbdc1);
  padding-bottom: 8px;
}

#aboutPopup a {
  color: var(--color-primary-green, #67b00a);
  text-decoration: none;
  font-weight: 600;
}

#aboutPopup a:hover {
  color: var(--color-primary-green-dark, #3d6806);
  text-decoration: underline;
}

#aboutPopup .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-gray-dark, #4d4d4d);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

#aboutPopup .close-btn:hover {
  background-color: var(--color-gray-light, #cdcccc);
}

#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Leaflet zoom control styling */
.leaflet-control-zoom a {
  background-color: white;
  color: var(--color-primary-green-dark, #3d6806);
  border: 2px solid var(--color-border, #cdcccc);
}

.leaflet-control-zoom a:hover {
  background-color: var(--color-primary-green, #67b00a);
  color: white;
  border-color: var(--color-primary-green, #67b00a);
}


/* Layer control styling */
.leaflet-control-layers {
  border: 2px solid var(--color-border, #cdcccc);
  background-color: white;
  
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: 100%;
  margin-top: 10px;
  box-shadow: none;
  border: none;
  background: transparent; 
}

/* optional: make it match your card style */
.leaflet-control-layers-list {
  font-size: 14px;
}

/* optional: spacing between checkboxes */
.leaflet-control-layers label {
  margin-bottom: 5px;
  display: block;
}



/* Hide selection outline on map features */
.leaflet-interactive {
  outline: none !important;
}

.leaflet-interactive:focus {
  outline: none !important;
}

path.leaflet-interactive:focus {
  outline: none !important;
}

/* Center the slider control at the bottom */
.leaflet-bottom.leaflet-left {
  left: 50% !important;
  transform: translateX(-50%);
  width: auto;
}

.leaflet-bottom.leaflet-left .leaflet-control {
  margin-bottom: 10px;
}

/* Leaflet radio buttons */
.leaflet-control-layers input[type="radio"] {
  accent-color: #4f841a;
}

/* Leaflet checkboxes */
.leaflet-control-layers input[type="checkbox"] {
  accent-color: #4f841a;
}

/* align design*/
/* Calendar background */
.flatpickr-calendar {
    background: #f2f2f2;
}

/* Selected day (remove blue) */
.flatpickr-day.selected {
    background: #d9d9d9 !important;
    color: #000;
}

/* Hover */
.flatpickr-day:hover {
    background: #e6e6e6;
}

/* Container already correct but refine it */
.leaflet-control-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
}

/* Buttons like Leaflet zoom */
.leaflet-control-custom button {
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.leaflet-control-custom button:hover {
  background: #f4f4f4;
}

/* Slider track */
.leaflet-control-custom input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
  outline: none;
}

/* Slider thumb */
.leaflet-control-custom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #3388ff; /* Leaflet blue */
  border-radius: 50%;
  cursor: pointer;
}

.leaflet-control-custom input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #3388ff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Optional: date label styling */
.leaflet-control-custom .date-label {
  font-size: 12px;
  color: #222;
  margin-left: 6px;
}
/* Buttons look like Leaflet */
.control-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.control-btn:hover {
  background: #f4f4f4;
}

/* Date picker cleaner */
.date-picker {
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}

/* Slider block */
.slider-wrapper {
  display: flex;
  flex-direction: column;
}

/* Label */
.slider-label {
  font-size: 12px;
  margin-bottom: 2px;
  color: #222;
}

/* Slider styling */
/* FORCE reset */
.time-slider {
  -webkit-appearance: none !important;
  appearance: none !important;

  width: 250px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
  outline: none;
}

/* Chrome / Edge */
.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #3388ff;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -5px; /* ✅ aligns thumb with track */
}

/* Firefox */
.time-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #3388ff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* ✅ CRITICAL RESET */
.leaflet-control-custom input[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  width: 220px;
}


/* ✅ THIS IS THE MISSING PART (TRACK) */
.leaflet-control-custom input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
}

/* ✅ THUMB (you already have it, but keep it) */
.leaflet-control-custom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 14px;
  height: 14px;
  background: #3388ff;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -5px;
}

/* Firefox track */
.leaflet-control-custom input[type="range"]::-moz-range-track {
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
}

/* Firefox thumb */
.leaflet-control-custom input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #3388ff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}



.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 40px;
  width: auto;
}


.logo-text {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* Force layers control to behave like a fixed TOC panel */
.leaflet-control-layers {
  position: absolute !important;
  top: 120px;           /* adjust to fit your layout */
  left: 20px;
  width: 250px;
  max-height: 400px;
  overflow-y: auto;

  background: #fff;
  border-radius: 10px;
  padding: 10px;

  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  font-family: Roboto, sans-serif;
}


/* Always show content */
.leaflet-control-layers-expanded {
  display: block !important;
}

/* Improve styling */
.leaflet-control-layers-list {
  margin-top: 0;
}

.leaflet-control-layers label {
  display: block;
  padding: 4px 0;
  cursor: pointer;
}

/* Optional heading style */
.leaflet-control-layers-overlays::before {
  content: "Layers";
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}
/* =========================
   ROOT DESIGN TOKENS
========================= */
:root {
  --bg: #f5f7f9;
  --panel: #ffffff;
  --panel-soft: #f9fafb;

  --text: #1f2933;
  --text-light: #6b7280;

  --primary: #2f7d32;
  --primary-soft: #e6f4ea;
  --accent: #4caf50;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.08);

  --radius: 12px;
  --radius-sm: 8px;
}

/* =========================
   GLOBAL
========================= */
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

/* =========================
   SIDEBAR / PANELS
========================= */
.sidebar,
.panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
}










/*.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 16px 12px 16px;
  width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #2b2b2b;
}*/



.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  overflow: visible !important;
  height: auto;
 

}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Titles */
.card h3,
.card h4 {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

/* Section headers */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}

/* =========================
   LEGEND (Gradient bar)
========================= */
.legend-gradient {
  height: 90px;
  width: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(to top, #ffeb3b, #ff9800, #e60000);
  margin: 8px 0;
  box-shadow: inset 0 0 0 1px var(--border);
}

.legend-label {
  font-size: 12px;
  color: var(--text-light);
}

/* =========================
   SLIDERS (SAFE SCOPED)
========================= */

/* ONLY style custom sliders (not Leaflet or others) */
.opacity-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #d1d5db;
  outline: none;
}

/* fill effect handled separately */
.opacity-slider.fill {
  background: linear-gradient(to right, var(--primary) 40%, #d1d5db 40%);
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* Remove Leaflet "floating box" */
#layers-control-container .leaflet-control {
  position: static !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
  width: 100%;
}

/* Remove toggle button */
#layers-control-container .leaflet-control-layers-toggle {
  display: none;
}

/* Make list clean */
#layers-control-container .leaflet-control-layers-list {
  padding: 0;
  margin: 0;
}

/* Align items nicely */
#layers-control-container .leaflet-control-layers label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  cursor: pointer;
}



/* === FIX: make slider expand === */
.leaflet-control-custom {
  width: 80vw;
  max-width: 900px;
}

.slider-wrapper {
  flex: 1;
}



.control-btn,
.date-picker,
.date-label {
  flex: 0 0 auto;
}


/* Make the slider longer */
/* Force the time slider to be wide and override all other rules */
.leaflet-control-custom .time-slider {
  width: 1200px !important;
  min-width: 1200px !important;
  max-width: 98vw;
  flex: 1 1 1200px;
}



.card:has(> h4:first-child) {
  display: none;
}


.leaflet-control-layers-list {
  display: flex;
  flex-direction: column;
}

/* TOC */

/* THEMATIC */
.leaflet-control-layers-overlays::before {
  content: "Thematic Layers";
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin: 10px 0 6px;
  color: #666;
}

/* BASEMAPS */
.leaflet-control-layers-base::before {
  content: "Base Maps";
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin: 10px 0 6px;
  color: #666;
}


.leaflet-control-layers-base {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
}


/* Remove description text under "Layers" */
.card p,
.card .description {
  display: none;
}


/* Section titles */
.leaflet-control-layers-base::before,
.leaflet-control-layers-overlays::before {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 10px 0 6px;
  display: block;
}

/* Divider between groups */
.leaflet-control-layers-base {
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.leaflet-control-layers label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.leaflet-control-layers label:hover {
  background: #f3f4f6;
}

.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] {
  transform: scale(1.1);
  accent-color: var(--color-primary-green);
}

.historical-btn {
  width: 100%;
  padding: 5px 8px;
  margin-bottom: 8px;

  border-radius: 6px;
  border: 1px solid #d1d5db;

  background: #f9fafb;
  font-size: 12px;
  font-weight: 500;
  text-align: left;

  cursor: pointer;
}

.historical-btn:hover {
  background: #f3f4f6;
}

#layers-control-container .leaflet-control {
  padding: 6px 4px !important;
}

.leaflet-control-layers input:checked + span {
  font-weight: 600;
  color: #111827;
}

.leaflet-control-layers-overlays label {
  padding-left: 4px;
}


/* Remove card style ONLY for layers card */
.card:has(#layers-control-container) {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}


#legend-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.legend-service-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.legend-service-image {
  width: 24px;
  height: 160px;
  border: 1px solid #ddd;
  border-radius: 2px;
  object-fit: fill;
  display: block;
}

.legend-service-label {
  font-size: 11px;
  color: #333;
  line-height: 1;
}

.legend-service-label-top {
  font-weight: 600;
}

/* Opacity title */
#opacitySidebar-label {
  display: block;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
}

/* Center slider */
#opacitySidebar {
  width: 100%;
  max-width: 160px;
  display: block;
  margin: 0 auto;
}












