/* =========================================
   ALERTAS MODALES - SINERGIALATINA
   (showAlertModal / hideAlertModal)
   ========================================= */

/* Paleta propia (independiente de otros CSS) */
:root {
  /* Colores base de SinergiaLatina (puedes ajustar) */
  --primary-color: #bf52c8;
  --text-color: #0f172a;

  /* Paleta de estados */
  --alert-success: #16a34a;
  --alert-danger: #ef4444;
  --alert-warning: #f59e0b;
  --alert-info: #bf52c8; /* info = morado directo, sin var() anidado */
}

/* Backdrop */
.simple-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

/* Visible */
.simple-alert-modal.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Card */
.modal-content-alert {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
  text-align: center;
  /* Aseguramos que SIEMPRE haya borde sólido */
  border-top: 4px solid var(--alert-info);

  animation: alertScaleIn 0.22s ease-out;
}

/* Animación entrada */
@keyframes alertScaleIn {
  from {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Animación salida */
@keyframes alertScaleOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(10px) scale(0.94);
    opacity: 0;
  }
}

.modal-content-alert.closing {
  animation: alertScaleOut 0.2s ease-in forwards;
}

/* Texto del mensaje */
.modal-content-alert p#alert-message {
  margin: 0 0 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-color);
}

/* Icono superior (usa Font Awesome, ya cargado en tus vistas) */
.modal-content-alert::before {
  content: "\f05a"; /* info-circle por defecto */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: block;
  margin-bottom: 12px;
  font-size: 2.2rem;
  color: var(--alert-info);
}

/* Variantes por tipo */
.alert-success {
  border-top-color: var(--alert-success);
}
.alert-success::before {
  content: "\f058"; /* check-circle */
  color: var(--alert-success);
}

.alert-danger {
  border-top-color: var(--alert-danger);
}
.alert-danger::before {
  content: "\f057"; /* times-circle */
  color: var(--alert-danger);
}

.alert-warning {
  border-top-color: var(--alert-warning);
}
.alert-warning::before {
  content: "\f071"; /* exclamation-triangle */
  color: var(--alert-warning);
}

.alert-info {
  border-top-color: var(--alert-info);
}
.alert-info::before {
  content: "\f05a"; /* info-circle */
  color: var(--alert-info);
}

/* Botón de cerrar (X) */
.close-button-alert {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  color: #6b7280;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  transition: background-color 0.15s ease,
              color 0.15s ease,
              box-shadow 0.15s ease,
              transform 0.15s ease;
}

.close-button-alert:hover {
  background: #f3e8ff;
  color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.5);
  transform: translateY(-1px);
}

/* Botón principal */
.ok-button-alert {
  margin-top: 10px;
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;

  /* Usamos primary + success, ambas definidas aquí */
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--alert-success)
  );
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(191, 82, 200, 0.45);

  transition: transform 0.15s ease,
              box-shadow 0.15s ease,
              filter 0.15s ease;
}

/* Variantes según tipo – SOLO con variables definidas aquí */
.alert-success .ok-button-alert {
  background: linear-gradient(90deg, var(--alert-success), #16a34a);
}

.alert-danger .ok-button-alert {
  background: linear-gradient(90deg, var(--alert-danger), #b91c1c);
}

.alert-warning .ok-button-alert {
  background: linear-gradient(90deg, var(--alert-warning), #d97706);
}

.alert-info .ok-button-alert {
  background: linear-gradient(90deg, var(--primary-color), #3b82f6);
}

.ok-button-alert:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35);
}

.ok-button-alert:active {
  transform: translateY(0);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.25);
}

/* Focus accesible */
.ok-button-alert:focus,
.close-button-alert:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 480px) {
  .modal-content-alert {
    padding: 18px 16px 16px;
    border-radius: 14px;
  }

  .modal-content-alert::before {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }

  .modal-content-alert p#alert-message {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .ok-button-alert {
    width: 100%;
    padding: 9px 14px;
  }
}
