/* =================== GLOBAL STYLES =================== */
html, body {
    margin: 0;
    height: 100%;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f5f7fa;
  }
  
  header {
    padding: 1rem 2rem;
    background: linear-gradient(90deg, #eae5c7 0%, #6DC6CC 100%);
    color: #ffffff;
     /* center the logo + title block */
  display: flex;
  justify-content: center; /* horizontal centering */
  align-items: center;     /* vertical alignment */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  h1 {
    font-size: 1.5rem;
    margin: 10;
    display: flex;
    align-items: text-center;
    gap: 0.5rem;
    color: rgb(255, 0, 0);
  }
  
  /* Map container fills remaining viewport height */
  #map {
    height: calc(100% - 70px); /* subtract header height */
    width: 100%;
  }
  
  /* =================== LEGEND =================== */
  .legend {
    background: #ffffff;
    line-height: 1.3em;
    padding: 6px 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.8rem;
  }
  .legend i {
    width: 14px;
    height: 14px;
    float: left;
    margin-right: 5px;
    opacity: 0.8;
    border-radius: 2px;
  }
  



  .legend {
    background:#fff;
    line-height:1.3em;
    padding:6px 8px;
    box-shadow:0 0 15px rgba(0,0,0,.2);
    border-radius:4px;
    font-size:.8rem;
  }
  .legend i {
    width:14px;
    height:14px;
    float:left;
    margin-right:5px;
    opacity:.8;
    border-radius:2px;
  }

  



  /* ----------  THEME TOKENS  ---------- */
:root {
    --bg-header: linear-gradient(90deg,#8a2be2 0%,#00ffff 100%);
    --text-title: #ffffff;
    --legend-bg: #ffffff;
    --legend-text: #000000;
    --map-bg: #f5f7fa;
  }
  
  /* dark overrides */
  body.dark {
    --bg-header: linear-gradient(90deg,#0f172a 0%,#1e293b 100%);
    --text-title: #e2e8f0;
    --legend-bg: #1e293b;
    --legend-text: #e2e8f0;
    --map-bg: #0f172a;
  }
  
  /* use the variables */
  body         { background: var(--map-bg); }
  header       { background: var(--bg-header); }
  h1           { color: var(--text-title); }
  .legend      { background: var(--legend-bg); color: var(--legend-text); }
  #themeBtn    {
    margin-left: auto;       /* pushes button to right edge */
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-title);
  }
  