/* ========================================
   Système de Modales - Festivals Ruraux
   ======================================== */

/* Empêcher le scroll du body quand une modale est ouverte */
body.modal-open {
  overflow: hidden;
}

/* ========================================
   Backdrop (fond sombre)
   ======================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  background-color: rgba(0, 0, 0, 0);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: background-color 0.3s ease;
}

.modal.show {
  background-color: rgba(0, 0, 0, 0.6);
}

/* ========================================
   Boîte de dialogue (conteneur)
   ======================================== */
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  margin: 0 auto;
  transform: translateY(-30px) scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animation d'entrée */
.modal-dialog.modal-animate-in {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Animation de sortie */
.modal-dialog.modal-animate-out {
  transform: translateY(-30px) scale(0.95);
  opacity: 0;
}

/* Variante large */
.modal-dialog.modal-lg {
  max-width: 800px;
}

/* Variante petite */
.modal-dialog.modal-sm {
  max-width: 400px;
}

/* ========================================
   Contenu de la modale
   ======================================== */
.modal-content {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* ========================================
   En-tête
   ======================================== */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.modal-header .modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0;
  font-family: 'Playfair Display', serif;
}

/* Bouton de fermeture (croix) */
.modal-header .btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-header .btn-close:hover {
  color: #dc2626;
  transform: rotate(90deg);
  background-color: #fee2e2;
}

/* ========================================
   Corps de la modale
   ======================================== */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-family: 'Playfair Display', serif;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 0.75rem;
}

.modal-body ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.modal-body ul li {
  margin-bottom: 0.35rem;
}

.modal-body a {
  color: #dc2626;
  text-decoration: underline;
}

.modal-body a:hover {
  color: #b91c1c;
}

/* ========================================
   Pied de page
   ======================================== */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.modal-footer .btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.modal-footer .btn:active {
  transform: scale(0.97);
}

.modal-footer .btn-primary {
  background-color: #1e3a5f;
  color: #ffffff;
}

.modal-footer .btn-primary:hover {
  background-color: #162d4a;
}

.modal-footer .btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.modal-footer .btn-danger:hover {
  background-color: #b91c1c;
}

.modal-footer .btn-secondary {
  background-color: #e5e7eb;
  color: #374151;
}

.modal-footer .btn-secondary:hover {
  background-color: #d1d5db;
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 640px) {
  .modal {
    padding: 0.5rem;
  }

  .modal-dialog {
    max-width: 100%;
  }

  .modal-dialog.modal-lg,
  .modal-dialog.modal-sm {
    max-width: 100%;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
    text-align: center;
  }
}
