 <?= $this->extend('layouts/master') ?>

 <?= $this->section('title') ?>
 Comunicaciones
 <?= $this->endSection() ?>

 <?= $this->section('css') ?><?= $this->endSection() ?>

 <?= $this->section('pageContent') ?>

 <div class="card">
     <div class="card-body">

         <div class="d-flex justify-content-between align-items-center mb-4">
             <h5 class="card-title fw-semibold m-0">
                Comunicaciones
             </h5>
         </div>



         <div class="row">
             <div class="col-md-12 mb-3">
                 <?php
                    if (empty(session()->get('usuario')["organizacion_id"])) {
                    ?>
                     <div
                         class="alert alert-warning"
                         role="alert">
                         <strong>Atención</strong> Tu usuario no pertenece a ninguna organización, contacta al administrador
                     </div>

                 <?php
                    } else { ?>
                    <!-- Sección de foro -->
                    <div class="mb-5">
                        <div class="d-flex justify-content-between align-items-center mb-3">
                            <h5 class="fw-semibold mb-0">
                                <i class="ti ti-message-circle me-2"></i>Foro de Discusión
                            </h5>
                            <button class="btn btn-primary btn-sm">
                                <i class="ti ti-plus"></i> Nuevo Tema
                            </button>
                        </div>

                        <div class="card shadow-sm">
                            <div class="card-body p-0">
                                <!-- Tema del foro 1 -->
                                <div class="p-3 border-bottom hover-bg-light-primary">
                                    <div class="row align-items-center">
                                        <div class="col-lg-6 col-md-12 mb-2 mb-lg-0">
                                            <h6 class="mb-1 fw-semibold">
                                                <a href="#" class="text-dark text-decoration-none">
                                                    ¿Cómo organizar mejor las reuniones vecinales?
                                                </a>
                                            </h6>
                                            <div class="d-flex flex-wrap gap-2 align-items-center">
                                                <span class="badge bg-light-info text-info">General</span>
                                                <small class="text-muted">
                                                    <i class="ti ti-user fs-4"></i> Juan Pérez
                                                </small>
                                            </div>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 mb-2 mb-lg-0">
                                            <small class="text-muted d-block">
                                                <i class="ti ti-calendar"></i> 14 Dic 2025
                                            </small>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 text-lg-end">
                                            <span class="badge bg-light-success text-success rounded-pill">
                                                <i class="ti ti-message-dots"></i> 12 respuestas
                                            </span>
                                        </div>
                                    </div>
                                </div>

                                <!-- Tema del foro 2 -->
                                <div class="p-3 border-bottom hover-bg-light-primary">
                                    <div class="row align-items-center">
                                        <div class="col-lg-6 col-md-12 mb-2 mb-lg-0">
                                            <h6 class="mb-1 fw-semibold">
                                                <a href="#" class="text-dark text-decoration-none">
                                                    Propuesta de mejoras en áreas comunes
                                                </a>
                                            </h6>
                                            <div class="d-flex flex-wrap gap-2 align-items-center">
                                                <span class="badge bg-light-warning text-warning">Propuestas</span>
                                                <small class="text-muted">
                                                    <i class="ti ti-user fs-4"></i> María González
                                                </small>
                                            </div>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 mb-2 mb-lg-0">
                                            <small class="text-muted d-block">
                                                <i class="ti ti-calendar"></i> 13 Dic 2025
                                            </small>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 text-lg-end">
                                            <span class="badge bg-light-success text-success rounded-pill">
                                                <i class="ti ti-message-dots"></i> 8 respuestas
                                            </span>
                                        </div>
                                    </div>
                                </div>

                                <!-- Tema del foro 3 -->
                                <div class="p-3 border-bottom hover-bg-light-primary">
                                    <div class="row align-items-center">
                                        <div class="col-lg-6 col-md-12 mb-2 mb-lg-0">
                                            <h6 class="mb-1 fw-semibold">
                                                <a href="#" class="text-dark text-decoration-none">
                                                    Dudas sobre el reglamento de convivencia
                                                </a>
                                            </h6>
                                            <div class="d-flex flex-wrap gap-2 align-items-center">
                                                <span class="badge bg-light-primary text-primary">Consultas</span>
                                                <small class="text-muted">
                                                    <i class="ti ti-user fs-4"></i> Carlos Ruiz
                                                </small>
                                            </div>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 mb-2 mb-lg-0">
                                            <small class="text-muted d-block">
                                                <i class="ti ti-calendar"></i> 12 Dic 2025
                                            </small>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 text-lg-end">
                                            <span class="badge bg-light-success text-success rounded-pill">
                                                <i class="ti ti-message-dots"></i> 15 respuestas
                                            </span>
                                        </div>
                                    </div>
                                </div>

                                <!-- Tema del foro 4 -->
                                <div class="p-3 hover-bg-light-primary">
                                    <div class="row align-items-center">
                                        <div class="col-lg-6 col-md-12 mb-2 mb-lg-0">
                                            <h6 class="mb-1 fw-semibold">
                                                <a href="#" class="text-dark text-decoration-none">
                                                    Horarios de uso de espacios recreativos
                                                </a>
                                            </h6>
                                            <div class="d-flex flex-wrap gap-2 align-items-center">
                                                <span class="badge bg-light-danger text-danger">Importante</span>
                                                <small class="text-muted">
                                                    <i class="ti ti-user fs-4"></i> Ana Martínez
                                                </small>
                                            </div>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 mb-2 mb-lg-0">
                                            <small class="text-muted d-block">
                                                <i class="ti ti-calendar"></i> 11 Dic 2025
                                            </small>
                                        </div>
                                        <div class="col-lg-3 col-md-6 col-6 text-lg-end">
                                            <span class="badge bg-light-success text-success rounded-pill">
                                                <i class="ti ti-message-dots"></i> 23 respuestas
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="text-center mt-3">
                            <a href="#" class="btn btn-outline-primary btn-sm">
                                Ver todos los temas <i class="ti ti-arrow-right ms-1"></i>
                            </a>
                        </div>
                    </div>

                    <!-- Sección de encuestas -->
                    <div class="mb-4">
                        <div class="d-flex justify-content-between align-items-center mb-3">
                            <h5 class="fw-semibold mb-0">
                                <i class="ti ti-chart-bar me-2"></i>Encuestas Activas
                            </h5>
                            <button class="btn btn-primary btn-sm">
                                <i class="ti ti-plus"></i> Nueva Encuesta
                            </button>
                        </div>

                        <div class="row">
                            <!-- Encuesta 1 -->
                            <div class="col-lg-6 col-md-12 mb-4">
                                <div class="card shadow-sm h-100">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="flex-grow-1">
                                                <h6 class="fw-semibold mb-1">¿Qué mejora prioritaria debemos realizar?</h6>
                                                <small class="text-muted">Elige la opción que consideres más importante</small>
                                            </div>
                                            <span class="badge bg-light-success text-success">Activa</span>
                                        </div>

                                        <div class="mb-3">
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Pintar áreas comunes</small>
                                                    <small class="text-muted">45%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-primary" role="progressbar" style="width: 45%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Reparar juegos infantiles</small>
                                                    <small class="text-muted">30%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-info" role="progressbar" style="width: 30%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Mejorar iluminación</small>
                                                    <small class="text-muted">25%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-warning" role="progressbar" style="width: 25%"></div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="d-flex justify-content-between align-items-center border-top pt-3">
                                            <div>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-user"></i> Pedro López
                                                </small>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-users"></i> 67 votos
                                                </small>
                                            </div>
                                            <div class="text-end">
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-calendar"></i> 10 Dic 2025
                                                </small>
                                                <small class="text-danger d-block">
                                                    <i class="ti ti-clock"></i> Cierra: 20 Dic 2025
                                                </small>
                                            </div>
                                        </div>

                                        <button class="btn btn-primary w-100 mt-3">
                                            <i class="ti ti-check"></i> Votar
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <!-- Encuesta 2 -->
                            <div class="col-lg-6 col-md-12 mb-4">
                                <div class="card shadow-sm h-100">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="flex-grow-1">
                                                <h6 class="fw-semibold mb-1">Horario preferido para reuniones</h6>
                                                <small class="text-muted">Selecciona el horario que mejor te acomode</small>
                                            </div>
                                            <span class="badge bg-light-success text-success">Activa</span>
                                        </div>

                                        <div class="mb-3">
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Sábados 10:00 AM</small>
                                                    <small class="text-muted">55%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-success" role="progressbar" style="width: 55%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Domingos 5:00 PM</small>
                                                    <small class="text-muted">25%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-info" role="progressbar" style="width: 25%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Viernes 7:00 PM</small>
                                                    <small class="text-muted">20%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-warning" role="progressbar" style="width: 20%"></div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="d-flex justify-content-between align-items-center border-top pt-3">
                                            <div>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-user"></i> Laura Fernández
                                                </small>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-users"></i> 42 votos
                                                </small>
                                            </div>
                                            <div class="text-end">
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-calendar"></i> 08 Dic 2025
                                                </small>
                                                <small class="text-danger d-block">
                                                    <i class="ti ti-clock"></i> Cierra: 18 Dic 2025
                                                </small>
                                            </div>
                                        </div>

                                        <button class="btn btn-primary w-100 mt-3">
                                            <i class="ti ti-check"></i> Votar
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <!-- Encuesta 3 -->
                            <div class="col-lg-6 col-md-12 mb-4">
                                <div class="card shadow-sm h-100">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="flex-grow-1">
                                                <h6 class="fw-semibold mb-1">¿Implementar sistema de cámaras?</h6>
                                                <small class="text-muted">Decisión sobre seguridad del conjunto</small>
                                            </div>
                                            <span class="badge bg-light-success text-success">Activa</span>
                                        </div>

                                        <div class="mb-3">
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Sí, es necesario</small>
                                                    <small class="text-muted">70%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-success" role="progressbar" style="width: 70%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>No, no es prioridad</small>
                                                    <small class="text-muted">18%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-danger" role="progressbar" style="width: 18%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Necesito más información</small>
                                                    <small class="text-muted">12%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-secondary" role="progressbar" style="width: 12%"></div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="d-flex justify-content-between align-items-center border-top pt-3">
                                            <div>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-user"></i> Roberto Silva
                                                </small>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-users"></i> 89 votos
                                                </small>
                                            </div>
                                            <div class="text-end">
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-calendar"></i> 05 Dic 2025
                                                </small>
                                                <small class="text-danger d-block">
                                                    <i class="ti ti-clock"></i> Cierra: 25 Dic 2025
                                                </small>
                                            </div>
                                        </div>

                                        <button class="btn btn-primary w-100 mt-3">
                                            <i class="ti ti-check"></i> Votar
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <!-- Encuesta 4 -->
                            <div class="col-lg-6 col-md-12 mb-4">
                                <div class="card shadow-sm h-100">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="flex-grow-1">
                                                <h6 class="fw-semibold mb-1">Actividades recreativas favoritas</h6>
                                                <small class="text-muted">Ayúdanos a planificar eventos comunitarios</small>
                                            </div>
                                            <span class="badge bg-light-success text-success">Activa</span>
                                        </div>

                                        <div class="mb-3">
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Clases de yoga</small>
                                                    <small class="text-muted">35%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-primary" role="progressbar" style="width: 35%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Torneos deportivos</small>
                                                    <small class="text-muted">40%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-success" role="progressbar" style="width: 40%"></div>
                                                </div>
                                            </div>
                                            <div class="mb-2">
                                                <div class="d-flex justify-content-between align-items-center mb-1">
                                                    <small>Cine al aire libre</small>
                                                    <small class="text-muted">25%</small>
                                                </div>
                                                <div class="progress" style="height: 8px;">
                                                    <div class="progress-bar bg-info" role="progressbar" style="width: 25%"></div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="d-flex justify-content-between align-items-center border-top pt-3">
                                            <div>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-user"></i> Elena Torres
                                                </small>
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-users"></i> 54 votos
                                                </small>
                                            </div>
                                            <div class="text-end">
                                                <small class="text-muted d-block">
                                                    <i class="ti ti-calendar"></i> 12 Dic 2025
                                                </small>
                                                <small class="text-danger d-block">
                                                    <i class="ti ti-clock"></i> Cierra: 22 Dic 2025
                                                </small>
                                            </div>
                                        </div>

                                        <button class="btn btn-primary w-100 mt-3">
                                            <i class="ti ti-check"></i> Votar
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="text-center mt-2">
                            <a href="#" class="btn btn-outline-primary btn-sm">
                                Ver todas las encuestas <i class="ti ti-arrow-right ms-1"></i>
                            </a>
                        </div>
                    </div>
                 <?php } ?>
             </div>
         </div>

     </div>
 </div>

 <?= $this->endSection() ?>