/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: #fdfdfd;
  color: #333;
}

header {
  padding: 1rem;
  background: #70A074;
  color: white;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logo {
  height: 100px;
  width: auto;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
}

h2 {
  margin: 0.2rem 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 400;
}

nav {
  display: flex;
  flex-wrap: wrap;       /* permite que los enlaces se envuelvan en varias líneas */
  justify-content: center;
  gap: 0.5rem;           /* espacio horizontal entre enlaces */
}

nav a {
  position: relative;
  color: #fff;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.2s;
}

nav a:not(:last-child)::after {
  content: "|";           /* agrega el separador solo entre elementos */
  position: absolute;
  right: -0.5rem;         /* ajusta la separación */
  color: #fff;
}

nav a:hover {
  background-color: rgba(255,255,255,0.2);
}

nav a.active {
  background-color: rgba(255,255,255,0.3);
}

#controls {
  padding: 1rem;
  background: #e9f0e9; /* verde muy suave */
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  border-bottom: 1px solid #d0e0d0;
}

#controls label {
  font-size: 0.95rem;
}

#controls select {
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: 'Poppins', sans-serif;
}

#map {
  height: 80vh;
  width: 90%;
  max-width: 1200px;
  max-height: 680px;
  margin: 1rem auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin: 1rem auto 3rem auto; /* margen inferior de 3rem antes del footer */
}


main {
  padding: 1rem 2rem;
}

/* Párrafos centrados e con marxe lateral (solución rápida) */
main p {
  max-width: 900px;       /* ancho máximo cómodo en pantallas grandes */
  margin: 1.2rem auto;    /* centra horizontalmente e deixa espazo arriba/abaixo */
  padding: 0 1.25rem;     /* espazo interno á esquerda e dereita */
  box-sizing: border-box; /* para que padding non aumente o ancho total */
  line-height: 1.6;
  text-align: justify;    /* opcional: podes poñer 'left' se prefires */
}

/* Axuste para móbiles */
@media (max-width: 600px) {
  main p {
    max-width: 100%;
    margin: 0.8rem 1rem;
    padding: 0 0.75rem;
    text-align: left;
  }
}

#projectDetails {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  max-height: 50%;
  background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  overflow-y: auto;
  transition: bottom 0.3s ease;
  padding: 1rem;
  z-index: 1000;

  display: flex;
  flex-direction: column;
  gap: 1rem;

  border-radius: 16px; /* bordes redondeados */
}

#projectDetails.show {
  bottom: 0;
}

#projectDetails button#closeDetails {
  align-self: flex-end;
  font-size: 1.2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-right: 2.5rem;
  margin-top: 0.5rem;
}

/* Contenedor interno para texto e imagen */
#projectDetails .content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#projectDetails img#detailImage {
  max-width: 100%;
  height: auto;
  border-radius: 8px; /* redondear también la imagen */
}

/* Pantallas medianas y grandes */
@media (min-width: 768px) {
  #projectDetails {
    width: 90%;
  }

  #projectDetails .content {
    flex-direction: row;
    align-items: flex-start;
  }

  #projectDetails .textual {
    flex: 1;
  }

  #projectDetails img#detailImage {
    max-width: 35%;
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

/* Móviles: más margen a la izquierda */
@media (max-width: 767px) {
  #projectDetails {
    margin-left: 1rem;   /* margen extra a la izquierda */
    margin-right: 1rem;  /* margen extra a la derecha también */
  }
}


.stats-header {
    text-align: center;
    margin: 20px 0; /* espacio arriba y abajo */
}

.stats-header h3 {
    margin: 10px 0; /* separación entre los h3 */
}


.chart {
    max-width: 500px;   /* Ancho máximo */
    height: 250px;      /* Alto fijo */
    margin: 20px auto;  /* Centrarlos y separar un poco */
    display: block;
}

/* --------------------------- */
/* FOOTER RESPONSIVO GLOBAL */
/* --------------------------- */

footer {
  box-sizing: border-box; /* padding no aumenta el ancho */
  width: 100%;
  max-width: 100%;
  padding: 2rem 1rem; /* padding lateral adaptable */
  text-align: center;
  font-size: 0.85rem;
  background-color: #d0e0d0;
  overflow-x: hidden; /* evita scroll horizontal por contenido */
}

footer a {
  color: #2c5e2e;
  font-weight: bold;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

#footer-info {
  margin-bottom: 0.8rem;
}

.footer-main {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.footer-name {
  color: #2c5e2e;
}

.footer-desc {
  font-style: italic;
}

.footer-meta {
  font-size: 0.85rem;
  color: #444;
}

.footer-author,
.footer-version {
  margin: 0 0.5rem;
}

.footer-note {
  font-size: 0.75rem;
  color: #555;
  margin: 0;
}

/* Para móviles: ajustar padding y evitar overflow */
@media (max-width: 767px) {
  footer {
    padding: 1.5rem 1rem;
  }
}



/* --------------------------- */
/* AJUSTES MÓVILES PARA INDEX */
/* --------------------------- */
@media (max-width: 767px) {

  #projectDetails {
    width: 100%;
    max-width: 100%;
    bottom: -100%;
    left: 0;
    transform: none;
    border-radius: 0;
    padding: 1rem 1rem 1rem 1rem; /* padding uniforme para que respire */
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
    margin-left: 0;
    margin-right: 0;
    border-radius: 16px;
  }

  #projectDetails.show {
    bottom: 0;
  }

  #projectDetails .content {
    flex-direction: column;
    gap: 1rem;
  }

  #projectDetails .textual {
    margin-right: 2.5rem;
  }

  #projectDetails img#detailImage {
    max-width: 80%;        /* ancho moderado en móviles */
    height: auto;
    margin: 0 auto;        /* centrada horizontalmente */
    display: block;
    border-radius: 8px;
  }

  #projectDetails button#closeDetails {
    align-self: flex-end;
    margin-right: 1rem;
    margin-top: 0.5rem;
  }
}


/* --------------------------- */
/* AJUSTES MÓVILES PARA STATISTICS */
/* --------------------------- */
@media (max-width: 767px) {

  header .logo-title {
    flex-direction: row;
    gap: 0.5rem;
  }

  .logo {
    height: 90px;
  }

  h1#title {
    font-size: 1.8rem;
  }

  h2#subtitle {
    font-size: 1rem;
  }

    nav {
      display: flex;
      flex-wrap: wrap;       /* permite que los enlaces se envuelvan en varias líneas */
      justify-content: center;
      gap: 0.5rem;           /* espacio horizontal entre enlaces */
    }

    nav a {
      position: relative;
      color: #fff;
      text-decoration: none;
      padding: 0.3rem 0.6rem;
      font-weight: 500;
      border-radius: 6px;
      transition: background-color 0.2s;
    }

    nav a:not(:last-child)::after {
      content: "|";           /* agrega el separador solo entre elementos */
      position: absolute;
      right: -0.5rem;         /* ajusta la separación */
      color: #fff;
    }

    nav a:hover {
      background-color: rgba(255,255,255,0.2);
    }

    nav a.active {
      background-color: rgba(255,255,255,0.3);
    }


  #controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }

  #controls label {
    width: 100%;
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
  }

  #controls select {
    width: 100%;
    padding: 0.5rem;
  }

  .stats-header h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
    text-align: center;
  }

  .charts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }

  .chart {
    width: 100% !important;
    height: 300px !important; /* altura fija cómoda en móviles */
  }

  footer {
    padding: 2rem 1rem;
    font-size: 0.85rem;
    text-align: center;
  }
}




