/* GENERAL */
html {
  scroll-behavior: smooth;
  height: 100%;
  font-size: clamp(11px, 1vw, 16px);
  overflow-x: hidden;
}

body {
  margin: 0px;
  width: 100%;
  min-height: 100vh;
  font-family: Poppins;
  background-color: white;
  color: black;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

ul {
  position: absolute;
  margin: 0;
  padding: 0;
  list-style-type: none;
}

::placeholder {
  color: rgb(160, 160, 160);
}
/* * * * * * * */

/* PANTALLA DE CARGA */
/* Overlay a pantalla completa */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;

  /* IMPORTANTE: bloquea clics/touch/scroll sobre lo que hay debajo */
  pointer-events: all;
  user-select: none;

  /* Para que se note que "no se puede tocar" */
  cursor: wait;
}

.loading-box {
  display: grid;
  gap: 12px;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 20px 26px;
  border-radius: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: spin 0.9s linear infinite;
}

/* Mientras carga, bloquea el scroll del body */
body.is-loading {
  overflow: hidden;
}
/* * * * * * * * * */

/* FONDO PARA PANELES */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;

  /* IMPORTANTE: bloquea clics/touch/scroll sobre lo que hay debajo */
  pointer-events: all;
  user-select: none;

  /* Para que se note que "no se puede tocar" */
  cursor: wait;
}
/* * * * * * * * * * */

/* MENU NAVEGACIÓN LATERAL */
nav {
  position: fixed;
  display: flex;
  width: 6rem;
  height: 100%;
  z-index: 99;
  flex-direction: column;
  gap: 1.5rem;
  align-content: center;
  padding: 1rem;
  justify-content: start;
  background-color: white;
  color: black;
  align-items: flex-start;
  transition: width 0.4s;
  overflow: hidden;
  box-sizing: border-box;
}

nav img {
  height: 2.5rem;
}

.nav-text {
  color: #26885a;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  max-width: 0;
  transform: translateX(-8px);
  transition:
    color 0.4s,
    opacity 0.2s ease,
    transform 0.2s ease,
    max-width 0.4s ease;
  pointer-events: none;
}

.nav-text:hover {
  color: #802fa0;
}

#nav-expand {
  height: 2rem !important;
  transform: translateX(0);
  transition:
    translate 0.4s,
    transform 0.4s;
}

#nav-home {
  padding-top: 2rem;
}

.nav-row {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
}

#nav-refers {
  display: none;
}

nav:hover,
nav.expanded {
  width: 15rem;
}

nav:hover .nav-text,
nav.expanded .nav-text {
  opacity: 1;
  max-width: 200px;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0.12s;
}

#nav-mobile {
  position: fixed;
  display: none;
  cursor: pointer;
  height: 2.5rem;
  left: 2rem;
  top: 1rem;
  z-index: 200;
  transform: translateX(0);
  transition: transform 0.4s ease-in-out;
}

#nav-mobile.shift {
  transform: translateX(10rem) rotate(180deg);
}
/* * * * * * * * * */

/* SECCION */
section {
  position: absolute;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem;
  padding-left: 8rem;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

section.content {
  justify-content: center;
  align-items: flex-start;
  padding-left: 8rem;
}

.section-panel {
  position: absolute;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 100;
}

.section-panel.hide {
  display: none;
}

.section-panel.row {
  flex-direction: row;
}

.section-list {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  flex-wrap: wrap;
  align-content: flex-start;
}

.section-list-element {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 14rem;
  box-sizing: border-box;
  cursor: pointer;
  background-color: #f6f6f6;
  color: black;
  align-items: center;
  will-change: transform;
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: center;
  gap: 1rem;
  padding: 1rem;
  text-align: center;
  border-radius: 0.5rem;
}

/*.section-list-element:hover {
  transform: scale(0.94);
}

.section-list-element:active {
  transform: scale(0.98);
}*/

.section-list-element-img {
  width: 11rem;
}

.section-list-element-img.medium {
  width: 6rem;
}

.section-list-element-img.small {
  width: 4rem;
}

.section-list-element-img.xsmall {
  width: 2rem;
}

.section-list-element-icon {
  position: absolute;
  cursor: pointer;
  height: 4rem;
  top: 0.5rem;
}

.section-list-element-icon.left {
  left: 0.5rem;
}

.section-list-element-icon.right {
  right: 0.5rem;
}

.section-list-element-icon.hide {
  display: none;
}

.section-content-panel {
  position: relative;
  display: flex;
  padding: 2.5rem;
  background-color: white;
  border-radius: 0.8rem;
  border-style: solid;
  border-color: #e5e7ed;
  border-width: 0.1rem;
}

.section-content-panel.hide {
  display: none;
}

.section-content-panel.row {
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.section-content-panel.col {
  flex-direction: column;
  gap: 0.5rem;
}

.section-content-panel.min-width {
  min-width: 22rem;
}

.section-content-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-content-col.min-width {
  min-width: 25rem;
}

.section-content-row {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.section-content-row.space {
  justify-content: space-between;
}

.section-content-row.hide {
  display: none;
}

.section-content-row.absolute {
  position: absolute;
}

.section-content-col.hide {
  display: none;
}

.section-input-container {
  display: flex;
  height: 3.5rem;
  align-items: center;
  flex-direction: row;
  background-color: white;
}

.section-input {
  color: rgb(80, 80, 80);
  background-color: #f2f8fa;
  padding: 1rem;
  border-radius: 0.3rem;
  border-style: solid;
  border-color: #e5e7ed;
  border-width: 0.05rem;
}

.section-input:focus {
  border-color: #32a757;
  outline: 0;
  background-color: white;
}

.section-input.opacity0 {
  opacity: 0;
}

.section-input.flex {
  flex: 1;
}

.spacer {
  flex: 1;
}

.filter-gray {
  filter: grayscale(100);
}

.background-gray {
  background-color: #a4a4a4;
}
/* * * * * * */

/* BOTON PERSONALIZADO */
.button {
  display: inline-block;
  padding: 0.5rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border-style: none;
  font-size: 1.2rem;
  box-sizing: border-box;
  border-radius: 0.8rem;
}

.button.wide {
  width: 100%;
}

.button.hide {
  display: none;
}

.button.green {
  color: white;
  background: #32a757;
}

.button.gradient-green {
  color: white;
  background: linear-gradient(90deg, #7cd85a 0%, #0499b1 100%);
}

.button.gradient-yellow {
  color: white;
  background: linear-gradient(90deg, #d4d85a 0%, #b19e04 100%);
}

.button.gradient-red {
  color: white;
  background: linear-gradient(90deg, #d8a15a 0%, #b10404 100%);
}

.button.gradient-blue {
  color: white;
  background: linear-gradient(90deg, #995ad8 0%, #0417b1 100%);
}

.button-img {
  cursor: pointer;
  height: 5rem;
}

.button-img.hide {
  opacity: 0;
  cursor: default;
}

.button-img.medium {
  height: 4rem;
}

.button-img.small {
  height: 3rem;
}

.button-img.xsmall {
  height: 2rem;
}

.button-toggle-pass {
  position: absolute;
  cursor: pointer;
  height: 2.5rem;
  z-index: 10;
  right: 3rem;
}
/* * * * * * * * */

/* ANIMACION VIBRAR ELIMINAR */
/* Aplica esta clase cuando entras en "modo borrar" */
.jiggle {
  transform-origin: 50% 50%;
  animation: jiggle 320ms infinite linear; /* más lenta y continua */
  will-change: transform;
}

@keyframes jiggle {
  0% {
    transform: rotate(-0.6deg) translate(-0.5px, 0) scale(1);
  }
  50% {
    transform: rotate(0.6deg) translate(0.5px, 0.3px) scale(1.003);
  }
  100% {
    transform: rotate(-0.6deg) translate(-0.5px, 0) scale(1);
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .jiggle {
    animation: none;
  }
}

/* Desfase (mejor en segundos para precisión consistente) */
.jiggle:nth-child(3n) {
  animation-delay: 0.02s;
}
.jiggle:nth-child(3n + 1) {
  animation-delay: 0.06s;
}
.jiggle:nth-child(3n + 2) {
  animation-delay: 0.1s;
}
/* * * * * * * * * */

/* MOVIL */
@media (max-width: 1024px) and (orientation: portrait) {
  html {
    overflow-y: auto;
    overflow-x: hidden;
  }

  section {
    flex-direction: column;
    padding-left: 2rem;
    padding-top: 5rem;
    gap: 1rem;
  }

  .section-list-element {
    width: 48%;
  }

  .section-panel {
    padding-left: 2rem;
  }

  .section-content-panel {
    flex-direction: column;
  }

  .section-content-col {
    width: 100%;
  }

  nav {
    width: 15rem;
    transform: translateX(-50vw);
    transition: transform 0.4s ease-in-out;
  }

  nav img {
    height: 3rem;
  }

  #nav-expand {
    display: none;
  }

  #nav-mobile {
    display: block;
  }

  nav.visible {
    transform: translateX(0);
  }

  .nav-text {
    opacity: 1;
    max-width: 200px;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0.12s;
  }
}
/* * * * * * */
