
/* Estilos base del modal */
.modal {
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  background-color: white;
  width: min(90%, 450px);
  max-width: 100%;
  padding: clamp(0.8rem, 3vw, 1.5rem);
  border-radius: var(--border-radius);
  position: relative;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.5s ease-out;
  animation: slideIn 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.modal.show .modal-content {
  transform: translateY(0);
  opacity: 1;
}

/* Título del modal */
.modal-content h2 {
  color: var(--primary-color);
  font-size: min(4vh, 1.8rem);
  margin-bottom: min(3vh, 1.5rem);
  font-weight: 700;
}

/* Contenido del mensaje */
.modal-content p {
  font-size: min(2.5vh, 1.1rem);
  color: #666;
  line-height: 1.5;
  margin-bottom: min(3vh, 1.5rem);
}

/* Botón de cerrar */
#modal-close {
  position: absolute;
  right: min(2vh, 1rem);
  top: min(2vh, 1rem);
  background: none;
  border: none;
  font-size: min(3vh, 1.4rem);
  color: #999;
  cursor: pointer;
  padding: min(1vh, 0.5rem);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(6vh, 2.5rem);
  height: min(6vh, 2.5rem);
  border-radius: 50%;
}

#modal-close:hover {
  color: var(--primary-color);
  background-color: rgba(74, 144, 226, 0.1);
}

/* Botones de acción */
.modal-actions {
  display: flex;
  gap: min(2vh, 1rem);
  justify-content: center;
  margin-top: min(4vh, 2rem);
}

.modal-button {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 49px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 100%;
}

.modal-button.primary {
  background-color: var(--primary-color);
  color: white;
}

.modal-button.primary:hover {
  background-color: #3a7bc8;
  transform: translateY(-2px);
}

.modal-button.secondary {
  background-color: #f0f0f0;
  color: #666;
}

.modal-button.secondary:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

/* Estilos para diferentes tipos de modales */
.modal.default .modal-content {
  border-top: 4px solid var(--primary-color);
}

.modal.success .modal-content {
  border-top: 4px solid var(--secondary-color);
}

.modal.error .modal-content {
  border-top: 4px solid var(--error-color);
}

/* Animación de entrada */
@keyframes slideIn {
  from {
    transform: translateY(-100px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Media queries para ajustes responsivos */
@media (max-height: 500px) {
  .modal-content {
    padding: min(2vh, 1rem);
  }

  .modal-actions {
    margin-top: min(2vh, 1rem);
  }
}

/* Prevenir scroll del body cuando el modal está abierto */
body.modal-open {
  overflow: hidden;
  touch-action: none;
}