/* ============================================================
   modal.css — Ampara
   Modal de contacto e información (overlay, contenido,
   secciones internas, donate, scrollbar, responsive).

   ✂  Eliminar de styles.css: líneas 1004–1500
   🐛 FIX: dark mode unificado a body.dark-mode (antes .dark-mode)
   ============================================================ */


/* ============================================================
   OVERLAY Y ANIMACIONES
   ============================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

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

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

body.dark-mode .modal {
  background: rgba(0, 0, 0, 0.8);
}


/* ============================================================
   CONTENIDO DEL MODAL
   ============================================================ */

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-content {
  background: #1f2937;
  color: #f3f4f6;
}


/* ============================================================
   HEADER DEL MODAL
   ============================================================ */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

body.dark-mode .modal-header {
  border-bottom-color: #374151;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #dc2626;
}

body.dark-mode .modal-title {
  color: #f87171;
}

.close-button {
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.close-button:hover {
  background: #e5e7eb;
  transform: rotate(90deg);
  color: #dc2626;
}

body.dark-mode .close-button {
  background: #374151;
  color: #9ca3af;
}

body.dark-mode .close-button:hover {
  background: #4b5563;
  color: #f87171;
}


/* ============================================================
   SECCIÓN DE CONTACTO
   ============================================================ */

.contact-section {
  margin-bottom: 2rem;
}

.section-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

body.dark-mode .section-subtitle {
  color: #e5e7eb;
}

.contact-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-item {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.contact-item:hover {
  background: #f3f4f6;
  transform: translateX(4px);
}

body.dark-mode .contact-item       { background: #374151; }
body.dark-mode .contact-item:hover { background: #4b5563; }

.contact-item-title {
  font-weight: 600;
  color: #dc2626;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

body.dark-mode .contact-item-title { color: #f87171; }

.contact-item-content {
  color: #4b5563;
  font-size: 0.95rem;
}

body.dark-mode .contact-item-content { color: #d1d5db; }

.contact-link {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

body.dark-mode .contact-link       { color: #60a5fa; }
body.dark-mode .contact-link:hover { color: #93c5fd; }


/* ============================================================
   REDES SOCIALES
   ============================================================ */

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.social-button {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social-button:hover {
  border-color: #dc2626;
  color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

body.dark-mode .social-button {
  background: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}

body.dark-mode .social-button:hover {
  border-color: #f87171;
  color: #f87171;
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}


/* ============================================================
   INSTITUCIONES
   ============================================================ */

.institutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.institution-item {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.institution-item:hover { background: #f3f4f6; }

body.dark-mode .institution-item       { background: #374151; }
body.dark-mode .institution-item:hover { background: #4b5563; }

.institution-item strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #dc2626;
}

body.dark-mode .institution-item strong { color: #f87171; }

.institution-item p {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

body.dark-mode .institution-item p { color: #9ca3af; }


/* ============================================================
   RECURSOS
   ============================================================ */

.resources-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resource-link {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: #374151;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resource-link:hover {
  background: #f3f4f6;
  transform: translateX(4px);
  color: #dc2626;
}

body.dark-mode .resource-link       { background: #374151; color: #d1d5db; }
body.dark-mode .resource-link:hover { background: #4b5563; color: #f87171; }


/* ============================================================
   SECCIÓN DONACIONES
   ============================================================ */

.donate-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

body.dark-mode .donate-section {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
}

.donate-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.75rem;
}

body.dark-mode .donate-title { color: #fef3c7; }

.donate-text {
  color: #78350f;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

body.dark-mode .donate-text { color: #fde68a; }

.donate-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.donate-button {
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.donate-button:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
}

body.dark-mode .donate-button       { background: #fbbf24; color: #78350f; }
body.dark-mode .donate-button:hover {
  background: #fcd34d;
  box-shadow: 0 6px 12px rgba(251, 191, 36, 0.4);
}


/* ============================================================
   ACERCA DE
   ============================================================ */

.about-text {
  color: #4b5563;
  line-height: 1.8;
  font-size: 0.95rem;
}

body.dark-mode .about-text { color: #d1d5db; }


/* ============================================================
   BOTÓN FLOTANTE DE CONTACTO (home screen)
   ============================================================ */

.home-container .contact-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.home-container .contact-button:hover {
  background: #b91c1c;
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

body.dark-mode .home-container .contact-button {
  background: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

body.dark-mode .home-container .contact-button:hover {
  background: #dc2626;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}


/* ============================================================
   SCROLLBAR PERSONALIZADO (modal)
   ============================================================ */

.modal-content::-webkit-scrollbar        { width: 8px; }
.modal-content::-webkit-scrollbar-track  { background: #f1f1f1; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb  { background: #888; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: #555; }

body.dark-mode .modal-content::-webkit-scrollbar-track { background: #1f2937; }
body.dark-mode .modal-content::-webkit-scrollbar-thumb { background: #4b5563; }
body.dark-mode .modal-content::-webkit-scrollbar-thumb:hover { background: #6b7280; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .home-container .contact-button {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .institutions-grid {
    grid-template-columns: 1fr;
  }

  .donate-methods {
    flex-direction: column;
  }

  .donate-button {
    width: 100%;
    justify-content: center;
  }
}
