/* ==================================================
   BBPRESS – ESTILO COMPLETO Y FUNCIONAL
   ================================================== */

/* Reset general */
#bbpress-forums {
    font-size: 14px;
}

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==================================================
   CATEGORÍAS (bbp-forum-status-category)
   Las categorías son los títulos principales como "Ansiedad y Estrés"
   ================================================== */

#bbpress-forums li.bbp-forum-status-category {
    margin-bottom: 20px;
}

#bbpress-forums li.bbp-forum-status-category > div.bbp-forum-content {
    background: linear-gradient(135deg, #2c3e50, #34495e) !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
}

#bbpress-forums li.bbp-forum-status-category .bbp-forum-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

#bbpress-forums li.bbp-forum-status-category .bbp-forum-title a {
    color: #ffffff !important;
    text-decoration: none !important;
}

#bbpress-forums li.bbp-forum-status-category .bbp-forum-title a:hover {
    color: #3498db !important;
}

#bbpress-forums li.bbp-forum-status-category .bbp-forum-topic-count,
#bbpress-forums li.bbp-forum-status-category .bbp-forum-reply-count {
    color: #ecf0f1 !important;
    font-weight: 600 !important;
}

#bbpress-forums li.bbp-forum-status-category .bbp-forum-freshness {
    color: #ecf0f1 !important;
}

#bbpress-forums li.bbp-forum-status-category .bbp-forum-freshness a {
    color: #3498db !important;
    font-weight: 600 !important;
}

/* ==================================================
   FOROS NORMALES (dentro de categorías)
   Los foros son los items individuales como "Ataques de pánico"
   ================================================== */

#bbpress-forums li.bbp-body:not(.bbp-forum-status-category) > div.bbp-forum-content {
    background: #ffffff !important;
    padding: 15px 20px !important;
    border-left: 4px solid #3498db !important;
    border-bottom: 1px solid #ecf0f1 !important;
    transition: all 0.3s ease !important;
}

#bbpress-forums li.bbp-body:not(.bbp-forum-status-category) > div.bbp-forum-content:hover {
    background: #f8f9fa !important;
    border-left-color: #2ecc71 !important;
}

#bbpress-forums li.bbp-body:not(.bbp-forum-status-category) .bbp-forum-title {
    font-size: 16px !important;
    font-weight: 600 !important;
}

#bbpress-forums li.bbp-body:not(.bbp-forum-status-category) .bbp-forum-title a {
    color: #2c3e50 !important;
}

#bbpress-forums li.bbp-body:not(.bbp-forum-status-category) .bbp-forum-title a:hover {
    color: #3498db !important;
}

/* Iconos de foros */
#bbpress-forums .bbp-forum-info::before {
    content: "💬";
    font-size: 24px;
    margin-right: 12px;
    display: inline-block;
    vertical-align: middle;
}

/* ==================================================
   AVATARES EN ÚLTIMA PUBLICACIÓN
   ================================================== */

#bbpress-forums .bbp-forum-freshness {
    text-align: left;
}

#bbpress-forums .bbp-forum-freshness-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

#bbpress-forums .bbp-author-avatar {
    flex-shrink: 0;
}

#bbpress-forums .bbp-author-avatar img.avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 2px solid #3498db !important;
    display: block !important;
}

#bbpress-forums .bbp-forum-freshness-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#bbpress-forums .bbp-forum-freshness-meta {
    font-size: 12px;
    color: #7f8c8d;
}

#bbpress-forums .bbp-forum-freshness-time {
    font-weight: 600;
    color: #2c3e50;
}

#bbpress-forums .bbp-forum-freshness-author {
    color: #3498db;
    font-weight: 600;
}

/* ==================================================
   TOPICS (TEMAS)
   ================================================== */

#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-footer {
    background: #ecf0f1;
    padding: 12px 20px;
    font-weight: 600;
    color: #2c3e50;
}

#bbpress-forums li.bbp-body.bbp-topic-status {
    background: #ffffff;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
}

#bbpress-forums li.bbp-body.bbp-topic-status:hover {
    background: #f8f9fa;
}

/* ==================================================
   DISEÑO MÓVIL - AVATAR ENCIMA DEL MENSAJE
   ================================================== */

@media (max-width: 768px) {
    /* Contenedor de reply/topic en móviles */
    #bbpress-forums div.bbp-reply-author,
    #bbpress-forums div.bbp-topic-author {
        width: 100% !important;
        float: none !important;
        margin: 0 0 15px 0 !important;
        padding: 15px !important;
        background: #f8f9fa !important;
        border-radius: 8px 8px 0 0 !important;
        text-align: center !important;
        border-bottom: 3px solid #0066cc !important;
    }
    
    /* Avatar centrado y más grande en móviles */
    #bbpress-forums div.bbp-reply-author img.avatar,
    #bbpress-forums div.bbp-topic-author img.avatar {
        width: 64px !important;
        height: 64px !important;
        border-radius: 50% !important;
        margin: 0 auto 10px !important;
        display: block !important;
        border: 3px solid #fff !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }
    
    /* Nombre del usuario centrado */
    #bbpress-forums div.bbp-reply-author .bbp-author-name,
    #bbpress-forums div.bbp-topic-author .bbp-author-name {
        display: block !important;
        text-align: center !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        color: #2c3e50 !important;
        margin-bottom: 5px !important;
    }
    
    /* Rol del usuario */
    #bbpress-forums div.bbp-reply-author .bbp-author-role,
    #bbpress-forums div.bbp-topic-author .bbp-author-role {
        display: block !important;
        text-align: center !important;
        font-size: 12px !important;
        color: #7f8c8d !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    /* Contenido del mensaje ocupa todo el ancho */
    #bbpress-forums div.bbp-reply-content,
    #bbpress-forums div.bbp-topic-content {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 15px !important;
        background: #fff !important;
        border-radius: 0 0 8px 8px !important;
    }
    
    /* Ocultar estadísticas en móviles para más espacio */
    #bbpress-forums .bbp-author-stats {
        display: none !important;
    }
    
    /* Espaciado entre mensajes */
    #bbpress-forums li.bbp-body ul.reply,
    #bbpress-forums li.bbp-body ul.topic {
        margin-bottom: 20px !important;
    }
}

/* ==================================================
   DISEÑO ESCRITORIO - AVATAR A LA IZQUIERDA
   ================================================== */

@media (min-width: 769px) {
    #bbpress-forums div.bbp-reply-author,
    #bbpress-forums div.bbp-topic-author {
        width: 140px !important;
        float: left !important;
        text-align: center !important;
        padding: 15px 10px !important;
        background: #f8f9fa !important;
        border-right: 1px solid #e1e8ed !important;
    }
    
    #bbpress-forums div.bbp-reply-author img.avatar,
    #bbpress-forums div.bbp-topic-author img.avatar {
        width: 80px !important;
        height: 80px !important;
        border-radius: 50% !important;
        margin: 0 auto 10px !important;
        display: block !important;
        border: 3px solid #fff !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }
    
    #bbpress-forums div.bbp-reply-content,
    #bbpress-forums div.bbp-topic-content {
        margin-left: 160px !important;
        padding: 15px 20px !important;
    }
}
