/**
 * Styles pour les modals générés par ModalGenerator
 * Ces styles sont responsives et personnalisables
 */

/* Styles de base pour le modal */
.micromodal {
  display: none;
}

.micromodal.is-open {
  display: block;
}

.modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.not-overflow .modal__container{overflow-y: initial;}

.modal__container {
  background-color: #fff;
  padding: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 100vh;
  border-radius: 4px;
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Styles pour l'en-tête du modal */
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  /*padding-bottom: 10px;
  margin-bottom: 15px;*/
}
.header-border-none .modal__header {border-bottom: none;}
.modal__title_center .modal__title {text-align: center;}
.modal__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.modal__close {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  position: relative;
}

.modal__close::before,
.modal__close::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 24px;
  background-color: var(--theme-site-color);
  top: 0;
  left: 50%;
}

.modal__close::before {
  transform: rotate(45deg);
}

.modal__close::after {
  transform: rotate(-45deg);
}

.modal__close:hover::before,
.modal__close:hover::after {
  background-color: var(--hover-theme-color);
}

/* Styles pour le contenu du modal */
.modal__content {
  margin-bottom: 15px;
  color: #666;
  line-height: 1.5;
}

/* Styles pour le pied de page du modal et les boutons */
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.modal__btn {
  font-size: 0.875rem;
  padding: 8px 16px;
  background-color: #e9e9e9;
  color: #333;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal__btn:hover {
  background-color: #d4d4d4;
}

.modal__btn.modal-close {
  background-color: #f44336;
  color: white;
}

.modal__btn.modal-close:hover {
  background-color: #d32f2f;
}

.modal__btn.modal-primary {
  background-color: #2196f3;
  color: white;
}

.modal__btn.modal-primary:hover {
  background-color: #0b7dda;
}

.modal__btn.modal-success {
  background-color: #4caf50;
  color: white;
}

.modal__btn.modal-success:hover {
  background-color: #3e8e41;
}

/* Animations pour le modal */
.micromodal[aria-hidden="false"] .modal__overlay {
  animation: fadeIn 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal[aria-hidden="false"] .modal__container {
  animation: slideIn 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal[aria-hidden="true"] .modal__overlay {
  animation: fadeOut 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal[aria-hidden="true"] .modal__container {
  animation: slideOut 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideIn {
  from { transform: translateY(15%); }
  to { transform: translateY(0); }
}

@keyframes slideOut {
  from { transform: translateY(0); }
  to { transform: translateY(15%); }
}

/* Styles responsives */
@media (max-width: 768px) {
  .modal__container {
    width: 90%;
    padding: 15px;
  }
  
  .modal__title {
    font-size: 1.2rem;
  }
  
  .modal__footer {
    flex-direction: column;
  }
  
  .modal__btn {
    width: 100%;
    margin-bottom: 5px;
  }
}

/* Thèmes de couleurs personnalisables */
.micromodal.theme-dark .modal__container {
  background-color: #333;
  color: #fff;
}

.micromodal.theme-dark .modal__title {
  color: #fff;
}

.micromodal.theme-dark .modal__content {
  color: #ddd;
}

.micromodal.theme-dark .modal__header,
.micromodal.theme-dark .modal__footer {
  border-color: #555;
}

.micromodal.theme-dark .modal__close::before,
.micromodal.theme-dark .modal__close::after {
  background-color: #ddd;
}

.micromodal.theme-dark .modal__close:hover::before,
.micromodal.theme-dark .modal__close:hover::after {
  background-color: #fff;
}

.micromodal.theme-light .modal__container {
  background-color: #f8f9fa;
}

.micromodal.theme-primary .modal__container {
  border-top: 5px solid #2196f3;
}

.micromodal.theme-success .modal__container {
  border-top: 5px solid #4caf50;
}

.micromodal.theme-danger .modal__container {
  border-top: 5px solid #f44336;
}

.micromodal.theme-warning .modal__container {
  border-top: 5px solid #ff9800;
}

.modal__container header.modal__header { background: #ffff!important; }
