/* --- MODAL STYLES --- */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 20, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.modal-container {
  position: relative;
  z-index: 10000;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .modal-container {
  transform: scale(1);
}

.modal-content {
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(148, 163, 184, 0.2);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(56, 189, 248, 0.08), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-strong);
  transform: rotate(90deg);
}

.modal-body {
  padding: 40px 30px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  color: var(--text);
}

/* Scrollbar personnalisée pour la modale */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

/* Styles du contenu de la modale */
.modal-body h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: #f9fafb;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, var(--accent-strong), #a855f7);
  -webkit-background-clip: text;
  color: transparent;
  font-weight: 700;
}

.modal-body h3 {
  font-size: 1.25rem;
  color: var(--accent-strong);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.modal-body p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 1rem;
}

.modal-body p strong {
  color: #e5e7eb;
  font-weight: 600;
}

.modal-body ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.modal-body ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.modal-body ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-strong);
  font-weight: bold;
}

.modal-body a {
  color: var(--accent-strong);
  text-decoration: none;
  transition: color 0.2s ease;
}

.modal-body a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.modal-body em {
  display: block;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: rgba(156, 163, 175, 0.8);
  font-style: italic;
}

/* Responsive pour mobile */
@media (max-width: 640px) {
  .modal-container {
    width: 95%;
    max-height: 90vh;
  }

  .modal-body {
    padding: 30px 20px;
  }

  .modal-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }

  .modal-body h2 {
    font-size: 1.5rem;
  }

  .modal-body h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
  }

  .modal-body p {
    font-size: 0.9rem;
  }
}
