/* Módulo Comunidad EPOC — Estilos */

/* ——— Título con sensación de respiración ——— */
.page-title-comunidad {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #e8f4fc 0%, #d4ebf7 35%, #f0f9ff 60%, #e3f2fd 100%);
  background-size: 200% 200%;
  animation: comunidad-breath-bg 8s ease-in-out infinite;
}

.page-title-comunidad::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(33, 150, 243, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse 70% 50% at 80% 70%, rgba(3, 169, 244, 0.06) 0%, transparent 45%),
              radial-gradient(ellipse 60% 40% at 20% 60%, rgba(2, 119, 189, 0.05) 0%, transparent 40%);
  animation: comunidad-breath-glow 8s ease-in-out infinite;
  pointer-events: none;
}

.page-title-comunidad .title-wrapper {
  position: relative;
  z-index: 1;
}

@keyframes comunidad-breath-bg {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes comunidad-breath-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.comunidad-section {
  padding-top: 1rem;
  padding-bottom: 3rem;
}

.comunidad-block {
  margin-bottom: 2.5rem;
}

.comunidad-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.comunidad-card:hover {
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.comunidad-card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.comunidad-card-header h2 {
  color: var(--heading-color, #2c3e50);
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comunidad-card-header h2 i {
  color: var(--accent-color, #e91e63);
  font-size: 1.75rem;
}

.comunidad-card-body {
  padding-top: 0.25rem;
}

/* ——— Bienvenida ——— */
.comunidad-card-bienvenida {
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f0fb 100%);
  border-left: 4px solid var(--primary-color, #2196f3);
}

.bienvenida-icon {
  font-size: 2.5rem;
  color: var(--primary-color, #2196f3);
  margin-bottom: 0.75rem;
}

.bienvenida-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.75rem;
}

.bienvenida-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #495057;
  margin: 0;
}

/* ——— ¿Cómo te sientes hoy? ——— */
.sentimientos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sentimiento-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  background: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

/* Colores por tipo de sentimiento */
.sentimiento-positivo:hover {
  border-color: #28a745;
  background: #f8fff9;
}

.sentimiento-positivo.active {
  border-color: #28a745;
  background: #d4edda;
  color: #155724;
}

.sentimiento-neutro:hover {
  border-color: #6c757d;
  background: #f8f9fa;
}

.sentimiento-neutro.active {
  border-color: #6c757d;
  background: #e2e3e4;
  color: #383d41;
}

.sentimiento-apoyo:hover {
  border-color: #fd7e14;
  background: #fff3e0;
}

.sentimiento-apoyo.active {
  border-color: #fd7e14;
  background: #ffeaa7;
  color: #8b5a0a;
}

.sentimiento-alerta:hover {
  border-color: #dc3545;
  background: #fdf2f2;
}

.sentimiento-alerta.active {
  border-color: #dc3545;
  background: #f5c6cb;
  color: #721c24;
}

.sentimiento-option:hover {
  transform: translateY(-1px);
}

.sentimiento-option.active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sentimiento-option:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.sentimiento-option:focus-visible {
  outline: 2px solid var(--accent-color, #e91e63);
  outline-offset: 2px;
}

.sentimiento-emoji {
  font-size: 1.25rem;
}

.sentimiento-texto {
  font-weight: 500;
}

.sentimiento-respuesta .alert {
  border-radius: 12px;
}

/* ——— Historias de superación ——— */
/* Solo columna cuando NO es grid (row); si tiene .row, Bootstrap controla el layout */
.historias-list:not(.row) {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.historia-item {
  padding: 1.25rem;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #eee;
}

.historia-item:hover {
  background: #f5f5f5;
}

.historia-titulo {
  font-size: 1.15rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.historia-content p {
  margin: 0 0 1rem;
  line-height: 1.6;
  color: #495057;
}

.historia-accion .btn-identifico {
  border-radius: 50px;
}

.historia-accion .btn-identifico .contador-identifico {
  margin-left: 0.35rem;
}

.historia-accion .btn-identifico.active {
  background: var(--accent-color, #e91e63);
  border-color: var(--accent-color, #e91e63);
  color: #fff;
}

.historia-accion .btn-identifico:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.historia-item.identificado {
  background: #f8fff9;
  border-color: #28a745;
}

/* ——— Comparte tu experiencia ——— */
.form-experiencia .form-label {
  font-weight: 500;
}

/* Título de la sección experiencias compartidas en azul de la página */
.experiencias-listado-titulo {
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(33, 150, 243, 0.04) 100%);
  border-left: 4px solid var(--primary-color, #2196f3);
  border-radius: 0 12px 12px 0;
}

.experiencias-listado-titulo > i {
  display: block;
  font-size: 1.75rem;
  color: var(--primary-color, #2196f3);
  margin-bottom: 0.5rem;
}

.experiencias-listado-titulo-texto {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading-color, #1565c0);
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.experiencias-listado-titulo-sub {
  font-size: 0.95rem;
  color: #328bb8;
  margin: 0;
  font-weight: 500;
}

/* Experiencias e historias — estilo testimonial con avatar (imagen o icono) */
.lista-experiencias.testimonials .testimonial-avatar-icon,
.historias-list.testimonials .testimonial-avatar-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  margin-right: 15px;
  background: color-mix(in srgb, var(--accent-color, #e91e63), transparent 85%);
  color: var(--accent-color, #e91e63);
  font-size: 1.75rem;
  border: 3px solid color-mix(in srgb, var(--accent-color, #e91e63), transparent 80%);
}

/* Avatar como imagen: recorte circular y aspecto consistente */
.historias-list.testimonials img.testimonial-avatar-icon {
  object-fit: cover;
  background: transparent;
  border-color: color-mix(in srgb, var(--accent-color, #e91e63), transparent 70%);
}

.lista-experiencias.testimonials .experiencia-accion,
.historias-list.testimonials .historia-accion {
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Referencia de fuente en historias de superación */
.historia-referencia a {
  color: var(--accent-color, #e91e63);
  text-decoration: none;
}
.historia-referencia a:hover {
  text-decoration: underline;
}
.historia-referencia .bi-link-45deg {
  margin-right: 0.2rem;
}

.form-experiencia .text-warning {
  color: #fd7e14 !important;
}

.form-experiencia .text-danger {
  color: #dc3545 !important;
  font-weight: 600;
}

.experiencias-listado {
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* ——— Enlace FAQ ——— */
.comunidad-card-enlace {
  padding: 1.25rem 2rem;
}

/* Borde azul con pulso suave */
.comunidad-faq-pulse {
  border: 2px solid rgba(80, 150, 200, 0.6);
  background: linear-gradient(135deg, rgba(185, 218, 240, 0.35) 0%, rgba(255, 255, 255, 0.6) 100%);
  animation: faq-pulse-suave 3.5s ease-in-out infinite;
}

@keyframes faq-pulse-suave {
  0%, 100% {
    border-color: rgba(80, 150, 200, 0.6);
    box-shadow: 0 0 0 0 rgba(80, 150, 200, 0.12);
  }
  50% {
    border-color: rgba(80, 150, 200, 0.9);
    box-shadow: 0 0 0 8px rgba(80, 150, 200, 0.1);
  }
}

.comunidad-faq-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: #2c3e50;
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 0.2s;
}

.comunidad-faq-link:hover {
  color: var(--accent-color, #e91e63);
}

.comunidad-faq-link i:first-child {
  font-size: 1.5rem;
  color: var(--accent-color, #e91e63);
}

.comunidad-faq-link i:last-child {
  margin-left: auto;
  font-size: 1.25rem;
}

/* ——— Red de apoyo externa ——— */
.red-apoyo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.red-apoyo-grid .red-apoyo-categoria {
  flex: 0 0 calc(50% - 0.75rem);
  max-width: calc(50% - 0.75rem);
  box-sizing: border-box;
}

.red-apoyo-categoria {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.red-apoyo-categoria-titulo {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.red-apoyo-categoria-titulo i {
  color: var(--accent-color, #e91e63);
}

.red-apoyo-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.red-apoyo-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 12px;
  color: #2c3e50;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  position: relative;
  padding-right: 2.5rem;
}

.red-apoyo-card:hover {
  border-color: var(--accent-color, #e91e63);
  background: #fef5f8;
  color: #2c3e50;
  transform: translateY(-2px);
}

.red-apoyo-card i.bi-box-arrow-up-right {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
  opacity: 0.7;
}

.red-apoyo-card-titulo {
  font-weight: 600;
  font-size: 0.95rem;
}

.red-apoyo-card-desc {
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
}

.red-apoyo-card:focus-visible {
  outline: 2px solid var(--accent-color, #e91e63);
  outline-offset: 2px;
}

/* Animaciones */
@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.historia-item.identificado .btn-identifico {
  animation: pulseGreen 1.5s ease-out;
}

/* Mejoras de accesibilidad */
.sentimiento-option:focus-visible,
.red-apoyo-card:focus-visible,
.btn-identifico:focus-visible {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .lista-experiencias.testimonials .testimonial-avatar-icon,
  .historias-list.testimonials .testimonial-avatar-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    margin-right: 12px;
    font-size: 1.5rem;
  }

  .comunidad-card {
    padding: 1.5rem;
  }

  .sentimiento-option {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
  }

  .sentimientos-grid {
    gap: 0.5rem;
    justify-content: center;
  }

  .red-apoyo-grid .red-apoyo-categoria {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .bienvenida-title {
    font-size: 1.5rem;
  }

  .bienvenida-text {
    font-size: 1rem;
  }

  .comunidad-faq-link {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}

@media (max-width: 576px) {
  .sentimientos-grid {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }

  .sentimiento-option {
    justify-content: center;
    text-align: center;
  }
}
