

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* IMPORTANT */
}


/* Title */
.title {
    text-align: center;
    background: #4a4af5;
    padding: 15px;
    color: white;
    margin: 0;
    font-size: 22px;
    transition: background 0.3s ease, color 0.3s ease;
}

.leaflet-top.leaflet-right {
  margin-top: 60px; /* adjust to theme toggle height */
  margin-right: 10px;
}


/* Map */
#map {
    height: 100vh;
    width: 100%;
}

.population-toggle-container {
  position: fixed;
  top: 200px;
  right: 18px;
  z-index: 2000;
  margin-top: 5px;
}

.population-toggle-btn {
  padding: 4px 8px;
  background: transparent;
  color: rgb(56, 51, 163);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: large;
  transition: background 0.3s ease, color 0.3s ease;
}

.population-toggle-btn:hover {
  background: #9aedf4;
}

/* Theme Toggle Button */
.theme-toggle-container {
    position: fixed;
    top: 12px;
    right: 18px;
    z-index: 2000;
}

.theme-toggle-btn {
    padding: 4px 8px;
    background: transparent;
    color: rgb(251, 251, 129);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: large;
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle-btn:hover {
    background: #9aedf4;
}

/* ----------------------------- */
/*          DARK MODE            */
/* ----------------------------- */

body.dark-mode {
    background: #1e1e1e;
}

body.dark-mode .title {
    background: #222;
    color: #e6e6e6;
}

body.dark-mode .theme-toggle-btn {
   /* background: #ddd; */
    color: #e6e6e6;
    font-size: large;
}

body.dark-mode .theme-toggle-btn:hover {
    background: #2e2c2c;
}

body.dark-mode .population-toggle-btn {
  /* background: #ddd; */
   color: #e6e6e6;
   font-size: large;
}

body.dark-mode .population-toggle-btn:hover {
   background: #2e2c2c;
}

@keyframes glowPulse {
    0% {
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
    }
    70% {
      box-shadow: 0 0 0 18px rgba(255, 255, 255, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
  }
  
  .aqi-svg-marker {
    border-radius: 50%;
  }

  .glow {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
  }
  
  .aqi-glow {
    animation: glowPulse 1.2s ease-out;
  }

  /* SEARCH */
  .search-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 320px;
  }

  #searchInput {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  }


  .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #444;
  }
  
  .close-btn:hover {
    color: #000;
  }
  
  /* Dark mode */
  body.dark-mode .close-btn {
    color: #e6e6e6;
  }
  
  body.dark-mode .close-btn:hover {
    color: #fff;
  }
  

  .suggestions {
    display: none;
    background: #fff;
    margin-top: 6px;
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  }

  .suggestions li {
    padding: 10px;
    cursor: pointer;
  }

  .suggestions li:hover,
  .suggestions li.active {
    background: #f0f0f0;
  }

  /* SIDEBAR */
  .sidebar {
    position: fixed;              /* IMPORTANT */
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
  
    transform: translateX(-100%); /* FULLY off screen */
    transition: transform 0.3s ease;
  
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  }
  

  .sidebar.open {
    transform: translateX(0);
  }
 
  .sidebar h2 {
    margin-top: 0;
    font-size: 22px;
    font-weight: 600;
  }
  
  .sidebar p {
    font-size: 14px;
    margin: 8px 0;
  }

  #stationAqi {
    font-size: 22px;
    font-weight: bold;
  }

  body.dark-mode #stationAqi {
    color: #9aedf4;
  }
  



body.dark-mode .station-search input {
  background: #1f1f1f;
  color: #fff;
  border: 1px solid #444;
}

body.dark-mode .search-results {
  background: #1f1f1f;
  color: #fff;
}

body.dark-mode .search-results li:hover {
  background: #333;
}

body.dark-mode #clearSearch {
  color: #aaa;
}

.aqi-legend {
  background: transparent;
  padding: 10px 12px;
  /*border-radius: 8px;*/
  font-size: 13px;
  line-height: 18px;
  /*box-shadow: 0 2px 10px rgba(0,0,0,0.3);*/
}

.aqi-legend h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.aqi-legend i {
  width: 14px;
  height: 14px;
  float: left;
  margin-right: 8px;
  border-radius: 3px;
  opacity: 0.9;
}

/* Dark mode */
body.dark-mode .aqi-legend {
  background: transparent;
  color: #e6e6e6;
}
.aqi-chart-container {
  margin-top: 15px;
  height: 200px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
}
body.dark-mode .aqi-chart-container {
  background: rgba(255,255,255,0.05);
}


/* ============================= */
/*        SIDEBAR DARK MODE      */
/* ============================= */

body.dark-mode .sidebar {
  background: #121826;
  color: #e6e6e6;
}

body.dark-mode .sidebar p,
body.dark-mode .sidebar b,
body.dark-mode .sidebar h2 {
  color: #e6e6e6;
}

.sidebar {
  border-right: 1px solid rgba(0,0,0,0.08);
}

body.dark-mode .sidebar {
  border-right: 1px solid rgba(255,255,255,0.1);
}

.filter-box {

  flex-direction: column;
  position: absolute;
  top: 220px;
  right: 10px;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  /*box-shadow: 0 2px 6px rgba(0,0,0,0.15);*/
  font-size: 13px;
  z-index: 1000;
  margin-top: 30px;
}

.filter-box label{
 
}

body.dark-mode .filter-box{
 color: #e6e6e6;
}

.ds-toggle-container {
  position: absolute;
  top: 150px; /* slightly below GN toggle */
  right: 15px;
  z-index: 1000;
}

.ds-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e88e5; /* blue for DS */
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ds-toggle-btn:hover {
  background: #1565c0;
}

.layer-toggle-panel {
  position: absolute;
  top: 150px;
  right: 15px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  background: rgba(40, 40, 40, 0.85);
  color: #eee;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  transition: all 0.2s ease;
}

.layer-pill .icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

.layer-pill:hover {
  transform: translateX(2px);
  background: rgba(55, 55, 55, 0.9);
}

.layer-pill.active {
  background: rgba(30, 64, 175, 0.95);
}

.layer-pill.active .icon {
  background: #60a5fa;
}

/* Light mode adjustment */
body:not(.dark-mode) .layer-pill {
  background: rgba(255, 255, 255, 0.85);
  color: #222;
}

body:not(.dark-mode) .layer-pill .icon {
  background: #2563eb;
}

.refresh-btn {
  position: absolute;
  top: 10px;
  right: 70px;
  z-index: 1000;
  padding: 6px 10px;
  background: #6b46c1; /* purple */
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.refresh-btn:hover {
  background: #553c9a;
}