/* ============================================================
   COMUNIDAD HUB — assets/css/comunidad-hub.css
   Vino Nuevo Radio PWA
   ============================================================ */

/* ── Contenedor principal ── */
#home-section.comunidad-hub {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 70px 0 160px;
    /* En desktop: padding-left para no quedar bajo el sidebar */
    padding-left: 250px;
    background: var(--body-color);
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease, padding-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Sidebar cerrado: el hub se expande */
.sidebar.close ~ #home-section.comunidad-hub,
.sidebar.close ~ * #home-section.comunidad-hub {
    padding-left: 88px;
}

#home-section.comunidad-hub.active-section { opacity: 1; }

/* ── 1. ZONA DE MEDIA ── */
.hub-media {
    padding: 0 16px 14px;
    width: 100%;
}

/* Banner destacado cuando NO hay vídeo */
.hub-banner {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg,
            rgba(182,25,67,0.95) 0%,
            rgba(100,10,40,0.98) 50%,
            rgba(30,5,20,1) 100%);
}

/* Patrón decorativo de fondo del banner */
.hub-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(149,117,206,0.15) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(182,25,67,0.2) 0%, transparent 40%);
    pointer-events: none;
}

/* Cruz decorativa tipo watermark */
.hub-banner::after {
    content: '✝';
    position: absolute;
    right: 24px;
    bottom: -10px;
    font-size: 7rem;
    color: rgba(255,255,255,0.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.hub-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.hub-banner-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.hub-banner-label i {
    font-size: 0.6rem;
    color: #f0c040;
}

.hub-versiculo-texto {
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
    margin: 0;
    max-width: 380px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hub-versiculo-ref {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 8px;
    width: 100%;
    text-align: center;
    max-width: 200px;
}

/* Cuando hay vídeo de YouTube */
.hub-video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.hub-video-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
    z-index: 1;
}

.hub-video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Etiqueta "Nuevo episodio" encima del vídeo */
.hub-video-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary);
    color: white;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(182,25,67,0.5);
}

.hub-video-badge i { font-size: 0.55rem; }

/* ── 2. TARJETAS DE ACCESO RÁPIDO ── */
.hub-accesos {
    display: flex;
    gap: 10px;
    padding: 0 16px 14px;
    justify-content: center;
}

.hub-card {
    position: relative;
    flex: 1;
    max-width: 115px;
    aspect-ratio: 1 / 1.05;
    border: none;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.hub-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

.hub-card:active { transform: scale(0.94); }

.hub-card--oracion {
    background: linear-gradient(145deg, #d4244f, #8a0f2e);
    box-shadow: 0 6px 20px rgba(182,25,67,0.5);
}
.hub-card--testimonio {
    background: linear-gradient(145deg, #b07d15, #6b4a08);
    box-shadow: 0 6px 20px rgba(176,125,21,0.5);
}
.hub-card--encuesta {
    background: linear-gradient(145deg, #1e5a9c, #0d2f52);
    box-shadow: 0 6px 20px rgba(30,90,156,0.5);
}

.hub-card-icon {
    font-size: 1.6rem;
    color: rgba(255,255,255,0.95);
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.hub-card-label {
    font-size: 0.67rem;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 1;
}

/* ── 3. MURO DE ORACIÓN (preview) ── */
.hub-muro {
    margin: 0 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    overflow: hidden;
}

body.light .hub-muro {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.hub-muro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px 10px;
    border-bottom: 1px solid var(--glass-border);
}

.hub-muro-titulo {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.hub-muro-titulo i { color: #e8622a; }

.hub-muro-ver-todo {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: 1px solid rgba(182,25,67,0.35);
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.hub-muro-ver-todo:active { background: rgba(182,25,67,0.12); }

.hub-muro-lista {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hub-muro-empty {
    text-align: center;
    padding: 22px 0 14px;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.hub-muro-empty i { font-size: 1.8rem; opacity: 0.4; }
.hub-muro-empty p { font-size: 0.78rem; line-height: 1.5; margin: 0; }

/* ── 4. TARJETA DE PETICIÓN ── */
.hub-peticion-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    animation: fadeInCard 0.3s ease;
}
body.light .hub-peticion-card { background: #f9f9f9; border-color: rgba(0,0,0,0.07); }

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

.hub-peticion-nombre {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 5px;
}
.hub-peticion-nombre i { color: var(--primary); font-size: 0.7rem; }

.hub-peticion-texto {
    font-size: 0.82rem;
    color: var(--text-color);
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hub-peticion-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
}

.hub-peticion-tiempo { font-size: 0.68rem; color: var(--text-sub); }

.hub-btn-unirse {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(182,25,67,0.08);
    border: 1px solid rgba(182,25,67,0.25);
    border-radius: 20px;
    padding: 3px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.hub-btn-unirse:active,
.hub-btn-unirse.joined { background: rgba(182,25,67,0.2); }
.hub-btn-unirse.joined { pointer-events: none; opacity: 0.7; }

/* ── 5. SKELETON ── */
.hub-skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: hub-shimmer 1.4s infinite;
    border-radius: 6px;
    height: 12px;
    margin-bottom: 6px;
}
body.light .hub-skeleton {
    background: linear-gradient(90deg,
        rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.09) 50%, rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
}
@keyframes hub-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 6. RESPONSIVE MÓVIL ── */
@media (max-width: 480px) {
    #home-section.comunidad-hub {
        padding: 65px 0 160px;
        padding-left: 0 !important;
    }
    .hub-banner { min-height: 170px; }
    .hub-versiculo-texto { font-size: 0.95rem; }
}

/* ── BANNER PODCAST EN EMISIÓN ── */
.hub-banner--podcast {
    background:
        linear-gradient(135deg,
            rgba(20,60,100,0.98) 0%,
            rgba(10,30,60,0.99) 50%,
            rgba(5,15,40,1) 100%);
    min-height: 200px;
}

.hub-banner--podcast::before {
    background-image:
        radial-gradient(circle at 15% 50%, rgba(100,180,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 20%, rgba(149,117,206,0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(30,90,180,0.15) 0%, transparent 40%);
}

.hub-banner--podcast::after {
    content: '🎙️';
    font-size: 5rem;
    right: 16px;
    bottom: -8px;
    filter: grayscale(1) opacity(0.08);
}

.hub-banner-label--live {
    background: rgba(255,68,68,0.2);
    border-color: rgba(255,68,68,0.4);
    color: rgba(255,200,200,0.9);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}