:root {
    --color-primary: #063970;
    --color-accent: #4a90e2;
    --color-bg: #f4f4f4;
    --color-header-bg: #ffffff;
    --color-footer-bg: #042a48;
    --color-text: #333333;
    --font-base: 'Lato', sans-serif;
  }
  
  /*------------------------------------
    1. Base / Mobile-First
  ------------------------------------*/
  * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.6;
  }
  
  a {
    color: var(--color-accent);
    text-decoration: none;
  }
  a:hover,
  a:focus {
    text-decoration: underline;
  }
  
  img,
  .img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-base);
    line-height: 1.2;
  }
  
  p {
    margin: 0 0 1rem;
    text-align: justify;
  }
  
  ul {
    margin: 0 0 1rem 1.5rem;
    padding: 0;
    list-style: disc;
  }
  
  li {
    margin-bottom: 0.5rem;
  }
  
  /*------------------------------------
    2. Layout: Header, Nav, Main, Footer
  ------------------------------------*/
  
  header {
    background-color: var(--color-header-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky; 
    top: 0; 
    z-index: 2000;
  }
  
  .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    gap: 1rem;
  }
  
  .header-content .logo {
    height: 40px;
    width: auto;
  }
  
  .header-content p {
    font-size: 2rem;
    color: var(--color-primary);
    line-height: 1.2;
  }
  
  .navbar {
    background-color: var(--color-header-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2000;
  }
  
  .navbar-nav .nav-link {
    color: var(--color-primary) !important;
    font-weight: 500;
    margin: 0 0.75rem;
  }
  
  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus {
    color: var(--color-accent) !important;
  }
  
  main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
  }
  
  footer {
    background-color: var(--color-footer-bg);
    color: #fff;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 1rem;
  }
  
  /*------------------------------------
    3. Components: Hero, Sections
  ------------------------------------*/
  .hero-banner {
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
  }
  /* pull out the picture to act like a bg-image */
  .hero-banner picture,
  .hero-banner picture img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;      /* cover the box, crop excess */
    z-index: -1;            /* sit behind your overlay/content */
  }
  .hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
  }
  .hero-banner .banner-content {
    position: relative;
    z-index: 1;
    padding: 2rem 1rem;
  }
  .hero-banner h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }
  .hero-banner p {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
    line-height: 1.5;
  }
  
  section {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-bottom: 2rem;
  }

  .modal-backdrop {
    z-index: 2040 !important;
  }
  .modal {
    z-index: 2050 !important;
  }
  
  /*------------------------------------
    4. Utilities & Widgets
  ------------------------------------*/
  .search-bar-container {
    max-width: 500px;
    margin: 1rem auto;
    position: relative;
  }
  .autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 150px;
    overflow-y: auto;
    background-color: #fff;
  }
  .autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #d4d4d4;
  }
  .autocomplete-items div:hover {
    background-color: #e9e9e9;
  }
  .autocomplete-items div strong {
    color: var(--color-accent);
    font-weight: bold;
  }
  
/* Base desktop sizing */
  #mapAreaPortugal, #mapArea, #safetyMapArea {
    position: relative;
  }
  .stats-map {
    width: 100%;
    height: 800px;       /* your original desktop height */
  }
  .inset-map-container {
    position: absolute;
    bottom: 30px;
    left: 10px;
    width: 250px;
    height: 200px;
    border: 2px solid #333;
    z-index: 1500;
  }
  .inset-map-container2 {
    position: absolute;
    bottom: 250px;
    left: 10px;
    width: 250px;
    height: 200px;
    border: 2px solid #333;
    z-index: 1500;
  }
  
/* ------------------------------------
   Map Legend Styling
   ------------------------------------ */
   .info.legend {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 8px;
    margin: 10px;
    font: 14px/18px var(--font-base);
    color: #555;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    /* make sure it sits above the map tiles */
    z-index: 500;
  }
  .info.legend h4 {
    margin: 0 0 5px;
    color: #777;
    font-weight: bold;
  }
  .info.legend i {
    /* each swatch box */
    width: 18px;
    height: 18px;
    margin-right: 8px;
    background: #000;    /* will be overridden inline by Leaflet */
    opacity: 0.7;
    display: inline-block;
  }
  .info.legend .clearfix {
    /* clear floats after the swatches/text */
    clear: both;
  }
  


  /*------------------------------------
    5. Responsive Breakpoints
  ------------------------------------*/
  @media (min-width: 577px) and (max-width: 768px) {
    .header-content .logo {
      height: 60px;
    }
    .header-content h1 {
      font-size: 2rem;
      line-height: 1.2;
    }
  }
  
  @media (min-width: 769px) {
    .header-content .logo {
      height: 80px;
    }
    .header-content h1 {
      font-size: 3rem;
      line-height: 1.2;
    }
  }
  
  @media (max-width: 768px) {
    /* Tablet */
    .stats-map {
      height: 480px;
    }
    .inset-map-container {
      width: 120px;
      height: 70px;
      bottom: 10px;
      left: 10px;
    }
    .inset-map-container2{
      width: 120px;
      height: 70px;
      bottom: 100px;
      left: 10px;
    }
  }
  
  @media (max-width: 480px) {
    .stats-map {
      height: 300px;
    }
  }

/* Default (desktop) legend styling already defined above */
@media (min-width: 576px) {
    .modal-dialog {
      margin-top: 100px;
    }
}

@media (max-width: 768px) {
  .info.legend {
    font-size: 11px;
    line-height: 16px;
    padding: 6px 6px;
    margin: 8px;
  }

  .info.legend h4 {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .info.legend i {
    width: 14px;
    height: 14px;
    margin-right: 6px;
  }
}

@media (max-width: 480px) {
  .info.legend {
    font-size: 10px;
    line-height: 14px;
    padding: 5px;
    margin: 6px;
  }

  .info.legend h4 {
    font-size: 11px;
  }

  .info.legend i {
    width: 12px;
    height: 12px;
    margin-right: 4px;
  }
}

 