/* Start general styles */
:root {
  --bg-color-principal: #ffff;
  --bg-color-resaltar: #ff8811;
  --bg-color-marcos: #fed625;
  --bg-color-secundario: #2ea0cd;
  --bg-color-bar-initial: lightgray;

  --color-letters: black;
  --color-stars: lightgray;
  --color-stars-checked: gold;
  --color-loading-bg: #eaecfa;
  --color-loading: #ce4233;
  --font-text: "Open-sans", sans-serif;
  --font-size-title: 1.9rem;
  --font-size-normal-text: 1.2rem;
  --font-size-small-text: 1.4rem;
  --font-size-stars: 3.5rem;
  --font-size-text: 1.2rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {  
  width: 100%;
  height: 100%;
}


h1,
h2,
h3,
summary,
legend {
  font-family: var(--font-text);
  color: var(--color-letters);
}

p,
li,
label,
legend {
  font-family: var(--font-text);
  font-size: var(--font-size-normal-text);
  line-height: 1.5;
}


/* img,
iframe,
picture,
source {
  width: 100%; 
  height: auto;
  aspect-ratio: 4/3;
  max-width: 100%;
  display: block;
  object-fit: cover;

} */

img, iframe, picture, source {
  width: 100%;
  height: auto;
  min-height: 100px; /* Ajusta según necesidad */
  max-width: 100%;
  display: block;
  object-fit: cover;
}

.titulo {
  font-size: var(--font-size-title);
  color: var(--bg-color-resaltar);
}
.highlighted-text{
  text-decoration: underline;
  font-weight:900;
  color:var(--bg-color-secundario);
}
/* End general styles */
/* Start Grid content */
body {

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas:
    "header header header"
    "section section section"
    "main main main"
    "footer footer footer";
  gap: 1.3rem;
  height: 100vh;
  scroll-behavior: smooth;
}

/* start Images styling */


.img-perfil {
  width: 100%;
}

/* end images styling */

/* Header */
.nav-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-color-marcos);
  min-width: 100%;
  
}

.nav-container ul {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  /* Columnar en dispositivos pequeños */
  gap: 0.5rem;
  position: absolute;
  /* Ajuste para menú desplegable */
  right: 0;
  background-color: var(--bg-color-marcos);
  /* Fondo del menú desplegable */
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1rem;


}
summary{
  font-size:var(--font-size-title);
}


.nav-container li {
  font-size: var(--font-size-normal-text);
  text-align: center;
  /* Centrar texto */
}

.options-nav a,
.options-nav button {
  text-decoration: none;
  color: var(--color-letters);
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  background-color: transparent;
  transition: background-color 0.3s;
}

.options-nav a:hover,
.options-nav button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Ajustes para el botón del menú */
summary.titulo {
  color: var(--color-letters);
  cursor: pointer;
  font-size: var(--font-size-title);

}

header {
  grid-area: header;
}

/* Fin header */
main {

  display: block;
  padding: 2rem;
  grid-area: main;
}

/* End grid content */
/* Start section presentation styling */
.presentation-section {
  grid-area: section;
  display: grid;
  place-items: center;
  padding: 0;
  gap: 4rem;
}

.text-wrapper {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.text-wrapper p {
  max-width: 40ch;
  text-align: justify;
}

/* .presentation-section * {
  text-align: center;
} */

.presentation-section>img {
  max-width: 30vw;
}

.img-perfil {
  width: 300px;
  max-width: 30vw;
  border-radius: 0.6rem;
  background-color: #eaecfa;

}

/* End section presentation styling */
/* Footer styling */
.icons-wrapper {
  padding: 1rem;
}

.icons-wrapper>ul {
  list-style: none;
}

.icons-wrapper li>a {
  text-decoration: none;
}

.icons-wrapper li>a:hover {
  text-decoration: underline;
}

footer {
  grid-area: footer;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: var(--bg-color-marcos);
  /* gap:3rem; */
}

/* end footer styling */

.form {
  /* display: grid;
  place-items: center; */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  gap: 3rem;
}

.respuestas-puntaje-container {
  position: relative;
  bottom: 0;
  max-width: fit-content;
  display: grid;
  place-items: center;
  gap: 3rem;
}

/* Questions Container styles */
.dimensions-container {
  padding: 1rem;
  max-width: fit-content;
  display: grid;
  place-items: center;
  gap: 3.5rem;
}

.dimension-titulo {
  color: rgb(16, 64, 235);
  font-style: italic;
  font-weight: 500;
}

.question-title {
  font-size: var(--font-size-title);
  text-wrap: balance;
  text-align: center;
  max-width: 40ch;
}

.questions-container {
  position: relative;
}

/* RATING CSS */
.rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  align-items: center;
  gap: 1em;
}

.rating input {
  opacity: 0;
  width: 0;
}

.rating label {
  color: var(--color-stars);
  cursor: pointer;
}

.rating input:checked~label {
  color: var(--color-stars-checked);
}

.rating input:checked~label~label {
  color: var(--color-stars-checked);
}

.rating label:hover,
.rating label:hover~label {
  color: var(--color-stars-checked);
}

.rating-text {
  font-size: var(--font-size-small-text);
}

.stars-text {
  font-size: var(--font-size-stars);
}

.question-warning {
  border: 2px solid red;
  /* Cambia el borde a rojo */
  background-color: #ffe5e5;
  /* Fondo rojo claro */
  border-radius: 5px;
  /* Esquinas redondeadas */
  padding: 0.5rem;
  /* Espaciado interno */
}

/* Boton del formulario */

#encuesta-economia {
  position: relative;
}

.sumbit-buttons {
  width: fit-content;
  max-width: 50ch;
  text-align: center;
  border-radius: 2rem;
  padding: .5em;
  background-color: var(--bg-color-marcos);
  color: var(--color-letters);
  font-size: var(--font-size-title);
  display: block;
  margin: 0 auto;
  cursor: pointer;
  font-family: var(--font-text);

  border: black 2px solid;
}

.mensaje-promocion-container {
  display: none;
}

.mensaje-promocion-container>p,
.mensaje-promocion-container>.img-full-width {
  width: clamp(30ch, 30vw, 60ch);
}

/* Texto de las respuestas a las preguntas */
.nivel {

  display: block;
  width: 100%;
  text-align: center;
  font-weight: bold;
  color: var(--bg-color-secundario);
  font-size: 1.4em;


}

.answers-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.respuesta-general {
  font-weight: 600;
  border: solid var(--bg-color-resaltar) 2px;
  padding: 1rem;
  font-size: calc(var(--font-size-small-text)*1.2);
  line-height: 2.1;
}

.answers-questions {
  max-width: 45ch;
  text-align: justify;
  text-wrap: pretty;
  font-size: var(--font-size-normal-text);
  font-size: calc(var(--font-size-small-text)*1.2);
  line-height: 2.1;
}

.list-answers-questions {
  font-size: var(--font-size-title);
  display: grid;
  gap: 2rem;
  padding: 2.5rem;
  border: solid var(--bg-color-resaltar) 2px;

}

/* Barra de carga durante las respuestas */
/* Estilo para centrar el diálogo */
.loading-wrapper[open] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 80vw;
  height: 150px;
  border-radius: 10px;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* Centrado absoluto en la pantalla */
dialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Estilo para el título del diálogo */
dialog[open] .titulo {
  text-align: center;
  margin-bottom: 20px;
}

.loader {
  /* line-height: 50px; */

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: helvetica, arial, sans-serif;
  /* text-transform: uppercase; */
  font-weight: 700;
  color: var(--color-loading);
  letter-spacing: 0.2em;

  &::before,
  &::after {
    content: "";
    display: block;
    width: 15px;
    height: 15px;
    background: var(--color-loading);
    position: absolute;
    animation: load 0.7s infinite alternate ease-in-out;
  }

  &::before {
    top: -15%;
    right: 50%;
  }

  &::after {
    bottom: -15%;
    right: 50%;
  }
}

@keyframes load {
  0% {
    left: 0;
    height: 30px;
    width: 15px;
  }

  50% {
    height: 8px;
    width: 40px;
  }

  100% {
    left: 100%;
    height: 30px;
    width: 15px;
  }
}

/* FIN de la barra de carga */
/* Media Querie */
@media (max-width: 1000px) {
  :root {
    --font-size-title: 1.5rem;
    --font-size-normal-text: 1rem;
    --font-size-small-text: 0.9rem;
    --font-size-stars: 1.3rem;
  }

  /* .nav-container {
      flex-direction: column;
  } */
  .stars-text {
    font-size: var(--font-size-stars);
  }

  .presentation-section {
    flex-direction: column;
    /* align-items: flex-start;
    justify-content: center; */
  }
}

@media screen and (max-width: 500px) {
  :root {
    --font-size-title: 2rem;
    --font-size-normal-text: 1.4rem;
    --font-size-small-text: 1.8rem;
    --font-size-stars: 3rem;

  }

  body {
    /* grid-template-columns: 1fr;
    grid-row: 1fr; */
    grid-template-columns: 100%;
    grid-template-rows: 1fr 1fr;
    /* place-items: center; */
    justify-items: center;
    grid-template-areas:
      "header header"
      "section section"
      "main main"
      "footer footer";
    gap: 1rem;
    zoom: 70%;
    /* overflow-block: x; */
  }

  .loading-wrapper[open] {
    width: 100%;
    height: 100%;
    padding: 2rem;

  }

  .respuestas-puntaje-container {
    padding: 3rem;
  }

  .start-text {
    max-width: 85ch;
    min-width: 45ch;
    padding: 2rem;

  }

  .nav-container ul {
    position: static;
    /* Cambiar a estático para alinear con el flujo del documento */
    width: 100%;
    /* Ocupa todo el ancho */
    padding: 1rem 0;
  }

  .nav-container {
    flex-direction: column;
    /* Cambiar a columna en dispositivos móviles */
  }

  .options-nav {
    font-size: var(--font-size-small-text);
    /* Texto más pequeño */
    padding: 1rem 0;
    /* Espaciado entre opciones */
  }

  summary.titulo {
    font-size: var(--font-size-normal-text);
    /* Ajustar tamaño del botón */
  }

  .text-wrapper {
    max-width: 35ch;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: auto 0;
  }

  .questions-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;

  }

  .rating-container {
    gap: 0.3em;
  }

  footer,
  header {
    min-width: 100%;
  }

  .icons-wrapper {
    padding: 1rem;
  }

  .icons-wrapper a {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: var(--font-size-small-text);
    gap: .2rem;
  }
}