/* /assets/css/components/chart-loading-modal.css */

.chart-loading-modal[hidden] {
  display: none !important;
}

.chart-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.chart-loading-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
}

.chart-loading-modal__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 42rem);
  transform: translate(-50%, -50%);
  padding: 2.4rem 2.2rem;
  border-radius: var(--radius-20);
  border: 1px solid var(--color-borde-1);
  background: var(--color-tarjeta);
  color: var(--color-texto-principal);
  box-shadow:
    0 24px 80px rgb(0 0 0 / 0.28),
    0 8px 24px rgb(0 0 0 / 0.12);
  text-align: center;
}

.chart-loading-modal__spinner {
  --spinner-color: var(--color-acento, #2e8b57);

  width: 6.4rem;
  height: 6.4rem;
  margin: 0 auto 1.8rem;
  border-radius: 50%;
  border: 0.55rem solid rgb(127 127 127 / 0.18);
  border-top-color: var(--spinner-color);
  border-right-color: var(--spinner-color);
  animation: chart-loading-spin 0.75s linear infinite;
  filter: drop-shadow(0 0 0.6rem rgb(0 0 0 / 0.12));
}

.chart-loading-modal__title {
  margin: 0 0 0.8rem;
  font-family: var(--fuente-principal);
  font-size: var(--texto-20);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-texto-principal);
}

.chart-loading-modal__text {
  margin: 0;
  max-width: 30rem;
  margin-inline: auto;
  font-family: var(--fuente-principal);
  font-size: var(--tamano-texto-base);
  line-height: 1.5;
  color: var(--color-texto-secundario);
}

@keyframes chart-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   TABLET
   ========================= */

@media (max-width: 768px) {
  .chart-loading-modal__card {
    width: min(92vw, 36rem);
    padding: 2rem 1.8rem;
    border-radius: var(--radius-12);
  }

  .chart-loading-modal__spinner {
    width: 5.6rem;
    height: 5.6rem;
    margin-bottom: 1.6rem;
    border-width: 0.5rem;
  }

  .chart-loading-modal__title {
    font-size: var(--texto-18);
  }

  .chart-loading-modal__text {
    font-size: var(--tamano-texto-base);
  }
}

/* =========================
   MÓVIL
   ========================= */

@media (max-width: 480px) {
  .chart-loading-modal__card {
    width: calc(100vw - 2.4rem);
    padding: 1.8rem 1.4rem;
    border-radius: var(--radius-12);
  }

  .chart-loading-modal__spinner {
    width: 5rem;
    height: 5rem;
    margin-bottom: 1.4rem;
    border-width: 0.45rem;
  }

  .chart-loading-modal__title {
    font-size: var(--texto-18);
    line-height: 1.2;
  }

  .chart-loading-modal__text {
    font-size: var(--texto-14);
    line-height: 1.45;
    max-width: 100%;
  }
}

/* =========================
   MÓVIL PEQUEÑO
   ========================= */

@media (max-width: 360px) {
  .chart-loading-modal__card {
    width: calc(100vw - 1.6rem);
    padding: 1.6rem 1.2rem;
  }

  .chart-loading-modal__spinner {
    width: 4.6rem;
    height: 4.6rem;
  }

  .chart-loading-modal__title {
    font-size: var(--texto-16);
  }

  .chart-loading-modal__text {
    font-size: var(--texto-14);
  }
}
