/*=============== GOOGLE FONTS ===============*/

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --black-color: #22407d;
  --black-color-light: #2f4f91;
  --white-color: #ffffff;
  --body-color: hsl(0, 0%, 100%);

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Poppins", sans-serif;
  --normal-font-size: 0.938rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-semi-bold: 600;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

/*========== Responsive typography ==========*/
@media screen and (min-width: 1024px) {
  :root {
    --normal-font-size: 14px;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
}

ul {
  list-style: none;
  /* Color highlighting when pressed on mobile devices */
  /*-webkit-tap-highlight-color: transparent;*/
}

a {
  text-decoration: none;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 95%;
  margin-inline: 1.5rem;
}

/*=============== HEADER ===============*/
.header {
  position: sticky;
  top: 0;
  background-color: #22407d;
  z-index: 1000;
}

/* ===== CONTADORES EN NAV ===== */
.nav__counters {
  display: flex;
  align-items: center;
  gap: 15px; /* espacio entre contadores */
  font-size: 14px;
  color: var(--white-color);
}

.nav__counters .counter {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav__counters i {
  font-size: 14px;
  color: var(--white-color);
}

.texto-contador {
  font-weight: 500;
}

/* RESPONSIVE: si la pantalla es muy pequeña, ponerlos en columna */
@media (max-width: 768px) {
  .nav__counters {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/*=============== NAV ===============*/
.nav {
  height: var(--header-height);
}

.nav__burger,
.nav__close {
  color: var(--white-color);
}

.nav__data {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__toggle {
  position: relative;
  width: 32px;
  height: 32px;
}

.nav__burger,
.nav__close {
  position: absolute;
  width: max-content;
  height: max-content;
  inset: 0;
  margin: auto;
  font-size: 1.25rem;
  cursor: pointer;
  transition:
    opacity 0.1s,
    transform 0.4s;
}

.nav__close {
  opacity: 0;
}

/* Navigation for mobile devices */
@media screen and (max-width: 1118px) {
  .nav__menu {
    position: absolute;
    left: 0;
    top: 2.5rem;
    width: 100%;
    height: calc(100vh - 3.5rem);
    overflow: auto;
    pointer-events: none;
    opacity: 0;
    transition:
      top 0.4s,
      opacity 0.3s;
  }
  .nav__menu::-webkit-scrollbar {
    width: 0;
  }
  .nav__list {
    background-color: #22407d;
    padding-top: 1rem;
  }

  /* NUEVO: Scroll para dropdown en móvil */
  .dropdown__menu {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  /* Scrollbar sutil para móvil */
  .dropdown__menu::-webkit-scrollbar {
    display: none;
  }

  .dropdown__menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 8px;
  }
}

.nav__link {
  color: var(--white-color);
  background-color: #22407d;
  font-weight: var(--font-semi-bold);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

.nav__link:hover {
  background-color: var(--black-color-light);
}

/* Show menu */
.show-menu {
  opacity: 1;
  top: 3.5rem;
  pointer-events: initial;
}

/* Show icon */
.show-icon .nav__burger {
  opacity: 0;
  transform: rotate(90deg);
}
.show-icon .nav__close {
  opacity: 1;
  transform: rotate(90deg);
}

/*=============== DROPDOWN ===============*/
.dropdown__item {
  cursor: pointer;
}

.dropdown__arrow {
  font-size: 1.25rem;
  font-weight: initial;
  transition: transform 0.4s;
}

.dropdown__link,
.dropdown__sublink {
  padding: 1.25rem 1.25rem 1.25rem 2.5rem;
  color: var(--white-color);
  background-color: var(--black-color-light);
  display: flex;
  align-items: center;
  column-gap: 0.5rem;
  font-weight: var(--font-semi-bold);
  transition: background-color 0.3s;
}

.dropdown__link i,
.dropdown__sublink i {
  font-size: 1.25rem;
  font-weight: initial;
}

.dropdown__link:hover,
.dropdown__sublink:hover {
  background-color: #22407d;
}

.dropdown__menu,
.dropdown__submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

/* Show dropdown menu & submenu */
.dropdown__item:hover .dropdown__menu,
.dropdown__subitem:hover > .dropdown__submenu {
  max-height: 1000px;
  transition: max-height 0.4s ease-in;
}

/* Rotate dropdown icon */
.dropdown__item:hover .dropdown__arrow {
  transform: rotate(180deg);
}

/*=============== DROPDOWN SUBMENU ===============*/
.dropdown__add {
  margin-left: auto;
}

.dropdown__sublink {
  background-color: var(--black-color-lighten);
}

/*=============== BREAKPOINTS ===============*/
/* For small devices */
@media screen and (max-width: 340px) {
  .container {
    margin-inline: 1rem;
  }

  .nav__link {
    padding-inline: 1rem;
  }
}

/* For large devices */
@media screen and (min-width: 1118px) {
  .container {
    margin-inline: auto;
  }

  .nav {
    height: calc(var(--header-height) + 2rem);
    display: flex;
    justify-content: space-between;
  }
  .nav__toggle {
    display: none;
  }
  .nav__list {
    height: 100%;
    width: 100%;
    display: flex;
    column-gap: 2.7rem;
  }
  .nav__link {
    height: 100%;
    white-space: nowrap;
    padding: 0;
    justify-content: initial;
    column-gap: 0.25rem;
  }
  .nav__link:hover {
    background-color: transparent;
  }

  .dropdown__item,
  .dropdown__subitem {
    position: relative;
  }

  .dropdown__menu,
  .dropdown__submenu {
    max-height: initial;
    overflow: initial;
    position: absolute;
    left: 0;
    top: 6rem;
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.3s,
      top 0.3s;
  }

  .dropdown__link,
  .dropdown__sublink {
    padding-inline: 1rem 3.5rem;
  }

  .dropdown__subitem .dropdown__link {
    padding-inline: 1rem;
  }

  .dropdown__submenu {
    position: absolute;
    left: 100%;
    top: 0.5rem;
  }

  /* Show dropdown menu */
  .dropdown__item:hover .dropdown__menu {
    opacity: 1;
    top: 5.5rem;
    pointer-events: initial;
    transition: top 0.3s;

    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  /* Scrollbar sutil para desktop */
  .dropdown__menu::-webkit-scrollbar {
    display: none;
  }

  .dropdown__menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 8px;
  }

  /* Show dropdown submenu */
  .dropdown__subitem:hover > .dropdown__submenu {
    opacity: 1;
    top: 0;
    pointer-events: initial;
    transition: top 0.3s;
  }
}

/* BANNER SECTION */

.banner {
  width: 100%;
  height: 210px;
  overflow: hidden;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ajuste para pantallas pequeñas (ej. móviles o tablets) */
@media (max-width: 1100px) {
  .banner {
    margin-top: 15px; /* en pantallas más chicas se reduce */
  }
}

/* CONTENIDO DINAMICO */
#contenido {
  padding-top: 20px;
}

/* ======== FOOTER ======== */
.footer {
  background: #22407d;
  color: #e5e7eb;
  text-align: center;
  padding: 1.5rem 1rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  margin-top: 2rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer__content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  margin: 0;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.footer p:hover {
  opacity: 1;
}

.footer span {
  color: #93c5fd; /* Azul suave */
  font-weight: 500;
}

@media (max-width: 600px) {
  .footer {
    font-size: 0.8rem;
    padding: 1rem;
  }
}

.buscador-global-header {
  padding: 1rem 0;
}

.buscador-content-horizontal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 2rem;
}

.buscador-titulo h2 {
  color: #54749c;
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 18px;
}

.buscador-derecha {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.buscador-derecha .search-container {
  min-width: 250px;
  display: flex;
  align-items: center;
}

.buscador-derecha .search-container input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  padding: 0.2rem;
}

.buscador-derecha .filtro-container select {
  min-width: 100px;
  cursor: pointer;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #667eea;
}

.loading i {
  animation: spin 1s linear infinite;
}

mark {
  background-color: #a2ddff;
  color: #042285;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/*lo que agregue*/
@media (max-width: 768px) {
  .buscador-content-horizontal {
    flex-wrap: wrap;
    justify-content: center;
  }

  .buscador-derecha {
    flex-wrap: wrap;
    justify-content: center;
  }

  .buscador-derecha .search-container {
    min-width: 0;
    width: 180px;
  }

  .buscador-derecha .filtro-container select {
    min-width: 90px;
  }
}

/* Botón Flotante */
.btn-ayuda-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #004a99; /* Ajusta al azul de la UTVM */
  color: white;
  border-radius: 50%;
  border: none;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}

.btn-ayuda-flotante:hover {
  transform: scale(1.1);
  background-color: #003366;
}

/* Modal de Ayuda */
.modal-ayuda {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-ayuda-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.modal-ayuda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.close-modal {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Ajuste específico para visualización de documentos */
.pdf-modal {
  max-width: 850px; /* Más ancho para que el PDF sea legible */
  width: 95%;
  margin: 5% auto;
}

.modal-ayuda-body {
  padding: 0; /* Quitamos padding para que el iframe llegue a los bordes si quieres */
  overflow: hidden;
}

iframe {
  border-radius: 0 0 8px 8px;
  display: block;
}
/* Contenedor principal del modal */
.modal-ayuda {
  display: none; /* Se cambia a 'flex' vía JS para abrirlo */
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);

  /* ESTO CENTRA EL MODAL */
  align-items: center;
  justify-content: center;
}

/* El cuadro blanco del modal */
.modal-ayuda-content {
  background-color: #fff;
  width: 90%;
  max-width: 900px;
  max-height: 90vh; /* No permite que el modal sea más alto que el 90% de la pantalla */
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column; /* Organiza header y body en vertical */
  overflow: hidden; /* Evita que el contenido se salga de los bordes redondeados */
}

/* El cuerpo donde está el PDF */
.modal-ayuda-body {
  flex-grow: 1; /* Hace que el cuerpo use todo el espacio disponible */
  overflow-y: auto; /* Permite scroll interno si el PDF fallara */
}

/* El iframe del PDF */
.modal-ayuda-body iframe {
  width: 100%;
  height: 75vh; /* Ajusta la altura del PDF relativa a la pantalla */
  border: none;
  display: block;
}
