/* ========================================================= */
/* === COMPONENTS — MODALS GLOBALS (modals.css) ============ */
/* ========================================================= */

/* ========================================================= */
/* 1️⃣ OVERLAY I ESTRUCTURA BASE DEL MODAL */
/* ========================================================= */

.modal-overlay,
.modal {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}


/* ========================================================= */
/* 2️⃣ CONTINGUT DEL MODAL */
/* ========================================================= */

.modal-content {
  background: #ffffff;
  padding: 2rem 1.5rem;
  max-width: 500px;
  width: 90%;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem; /* corregit espai */
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 20px;
}


/* ========================================================= */
/* 3️⃣ BOTÓ DE TANCAR I TÍTOLS */
/* ========================================================= */

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

.titol-modal {
  display: inline-block;
  border-bottom: 3px solid #d4af37;
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
}


/* ========================================================= */
/* 4️⃣ CONTINGUT AMB SCROLL INTERN */
/* ========================================================= */

.descripcio-scrollable {
  max-height: 200px;
  overflow-y: auto;
  background-color: #fdf9f3;
  padding: 0.8rem;
  margin-top: 0.2rem;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 0.95rem;
  white-space: pre-line;
  scroll-behavior: smooth;

  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #f1f1f1;
}

/* Scroll personalitzat (WebKit: Chrome, Safari) */
.descripcio-scrollable::-webkit-scrollbar {
  width: 8px;
}

.descripcio-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 8px;
}

.descripcio-scrollable::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 8px;
}

.descripcio-scrollable::-webkit-scrollbar-thumb:hover {
  background: #c1992e;
}


/* ========================================================= */
/* 5️⃣ OPCIONS DE MODAL — (Pagament CV escoles) */
/* ========================================================= */

.modal-options {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ========================================================= */
/* 🔚 FI DE L'ARXIU MODALS.CSS — Components globals          */
/* ========================================================= */

/*Dark mode modals*/

/* ========================================================= */
/* 🌙 DARK MODE — MODALS GLOBALS                             */
/* ========================================================= */

/* ============================= */
/* 1️⃣ OVERLAY                   */
/* ============================= */

[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .modal {
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
}


/* ============================= */
/* 2️⃣ CONTINGUT PRINCIPAL       */
/* ============================= */

[data-theme="dark"] .modal-content {
  background: #111827; /* gris blau profund */
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}


/* ============================= */
/* 3️⃣ TÍTOL                     */
/* ============================= */

[data-theme="dark"] .modal-content h2 {
  color: #f1f5f9;
}

[data-theme="dark"] .titol-modal {
  border-bottom: 3px solid #d4af37;
  color: #d4af37; /* pots eliminar aquesta línia si el vols blanc */
}


/* ============================= */
/* 4️⃣ BOTÓ TANCAR               */
/* ============================= */

[data-theme="dark"] .modal-close {
  color: #94a3b8;
}

[data-theme="dark"] .modal-close:hover {
  color: #ffffff;
}


/* ============================= */
/* 5️⃣ DESCRIPCIÓ SCROLLABLE     */
/* ============================= */

[data-theme="dark"] .descripcio-scrollable {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  color: #d1d5db;
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #1f2937;
}

[data-theme="dark"] .descripcio-scrollable::-webkit-scrollbar {
  width: 8px;
}

[data-theme="dark"] .descripcio-scrollable::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 8px;
}

[data-theme="dark"] .descripcio-scrollable::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 8px;
}

[data-theme="dark"] .descripcio-scrollable::-webkit-scrollbar-thumb:hover {
  background: #b8932f;
}


/* ============================= */
/* 6️⃣ OPCIONS / BOTONS          */
/* ============================= */

[data-theme="dark"] .modal-options button {
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}


/* ============================= */
/* 7️⃣ ANIMACIÓ SUAU D'ENTRADA   */
/* ============================= */

[data-theme="dark"] .modal-content {
  animation: modalAppearDark .25s ease;
}

@keyframes modalAppearDark {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
