/* ==========================================================================
   CPEI - BuddyPress Custom Design (Members & Groups)
   ========================================================================== */

/* 0. REMOVE THEME DEFAULT SPACING ON BUDDYPRESS PAGES */
body.buddypress .content-area,
body.buddypress .site-main,
body.buddypress .content-container,
body.buddypress .entry-content-wrap {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.buddypress #primary.content-area {
    padding-top: 30px !important; /* Un léger espace propre */
}

/* 0.5 FLATTEN THEME CONTAINERS (Remove box-in-box effect) */
body.buddypress .content-bg,
body.buddypress article.entry {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#buddypress div.pagination .pag-count,
#buddypress .dir-list-tabs,
#buddypress .groups-dir-count,
#buddypress .members-dir-count,
#buddypress .pag-count {
    display: none !important;
}

/* 1. LAYOUT & CONTAINERS */
#buddypress {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #374151;
}

/* 2. NAVIGATION TABS (All Members, My Friends, etc.) */
#buddypress .dir-navs,
#buddypress div.item-list-tabs:not(#subnav):not(.action) {
    display: none !important; /* Le client a demandé la suppression de l'onglet "Tous les groupes" */
}

/* On garde les règles pour les sous-onglets s'ils existent */
#buddypress div.item-list-tabs#subnav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border: none;
    padding: 0;
    margin-bottom: 24px;
}

#buddypress div.item-list-tabs ul li {
    list-style: none;
    margin: 0;
}

#buddypress div.item-list-tabs ul li a {
    display: inline-block;
    padding: 10px 20px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

#buddypress div.item-list-tabs ul li.selected a,
#buddypress div.item-list-tabs ul li.current a {
    background: #0B3D91 !important; /* Bleu Afrique */
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(11, 61, 145, 0.3) !important;
    border-color: #0B3D91 !important;
}

#buddypress div.item-list-tabs ul li a span {
    background: rgba(255,255,255,0.2) !important;
    color: inherit !important;
    border-radius: 12px;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 12px;
}

/* 3. DIRECTORY FILTER & SEARCH */
#buddypress div.dir-search, 
#buddypress div.item-list-tabs#subnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 0;
    margin-bottom: 12px !important;
    border: none;
    box-shadow: none;
}

#buddypress div.dir-list,
#buddypress ul.item-list:not(#topic-post-list) {
    margin-top: 0 !important;
}

#buddypress div.item-list-tabs#subnav ul {
    margin: 0;
    padding: 0;
}

#buddypress div.dir-search form,
#buddypress div.subnav-search form,
#buddypress .activity-search form,
#buddypress [role="search"] form,
.bp-search form {
    display: flex;
    align-items: center;
    background: #ffffff !important;
    border: 1px solid #a3aab5 !important; /* Bordure exacte du mockup */
    border-radius: 50px !important; /* Forme de pilule */
    padding: 4px 16px !important; /* Hauteur réduite */
    width: 100%; /* S'adapte à l'écran */
    max-width: 350px; /* Pas trop large sur grand écran */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important; /* Ombre douce */
    margin: 0;
    transition: all 0.3s ease;
}

#buddypress div.dir-search form:focus-within,
#buddypress div.subnav-search form:focus-within,
#buddypress .activity-search form:focus-within,
#buddypress [role="search"] form:focus-within,
.bp-search form:focus-within {
    border-color: #0B3D91 !important;
}

#buddypress div.dir-search form input[type="text"],
#buddypress div.dir-search form input[type="search"],
#buddypress div.subnav-search form input[type="text"],
#buddypress div.subnav-search form input[type="search"],
#buddypress .activity-search form input[type="text"],
#buddypress .activity-search form input[type="search"],
#buddypress [role="search"] form input[type="text"],
#buddypress [role="search"] form input[type="search"],
.bp-search form input[type="text"],
.bp-search form input[type="search"],
#buddypress .dir-search input[type="text"],
#buddypress .dir-search input[type="search"] {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 4px 0 !important; /* Ajustement du padding interne pour réduire la hauteur */
    font-size: 15px !important; /* Texte légèrement plus petit pour correspondre */
    min-width: auto !important;
    flex-grow: 1;
    box-shadow: none !important;
    outline: none !important;
    color: #111827 !important; /* Texte bien noir/foncé */
    font-weight: 500;
}

#buddypress div.dir-search form input[type="text"]::placeholder,
#buddypress div.dir-search form input[type="search"]::placeholder,
#buddypress div.subnav-search form input[type="text"]::placeholder,
#buddypress div.subnav-search form input[type="search"]::placeholder,
#buddypress .activity-search form input[type="text"]::placeholder,
#buddypress .activity-search form input[type="search"]::placeholder,
#buddypress [role="search"] form input[type="text"]::placeholder,
#buddypress [role="search"] form input[type="search"]::placeholder,
.bp-search form input[type="text"]::placeholder,
.bp-search form input[type="search"]::placeholder,
#buddypress .dir-search input[type="text"]::placeholder,
#buddypress .dir-search input[type="search"]::placeholder {
    color: #4b5563 !important; /* Placeholder plus contrasté */
    font-weight: 500;
}

#buddypress div.dir-search form input[type="submit"],
#buddypress div.dir-search form button[type="submit"],
#buddypress div.subnav-search form input[type="submit"],
#buddypress div.subnav-search form button[type="submit"],
#buddypress .activity-search form input[type="submit"],
#buddypress .activity-search form button[type="submit"],
#buddypress [role="search"] form input[type="submit"],
#buddypress [role="search"] form button[type="submit"],
.bp-search form input[type="submit"],
.bp-search form button[type="submit"],
#buddypress .dir-search button {
    background: transparent !important;
    color: #6b7280 !important;
    border: none !important;
    padding: 10px !important;
    margin: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    width: auto !important;
    min-width: auto !important;
}

#buddypress div.dir-search form input[type="submit"]:hover,
#buddypress div.dir-search form button[type="submit"]:hover,
#buddypress div.subnav-search form input[type="submit"]:hover,
#buddypress div.subnav-search form button[type="submit"]:hover,
#buddypress .activity-search form input[type="submit"]:hover,
#buddypress .activity-search form button[type="submit"]:hover,
#buddypress [role="search"] form input[type="submit"]:hover,
#buddypress [role="search"] form button[type="submit"]:hover,
.bp-search form input[type="submit"]:hover,
.bp-search form button[type="submit"]:hover,
#buddypress .dir-search button:hover {
    color: #0B3D91 !important;
    background: transparent !important;
}

#buddypress .filter select {
    border: 1px solid #d1d5db !important;
    border-radius: 50px !important;
    padding: 10px 36px 10px 16px !important;
    font-size: 14px !important;
    background-color: #fff !important;
    color: #4b5563 !important;
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03) !important;
    transition: all 0.3s ease;
}

#buddypress .filter select:hover,
#buddypress .filter select:focus {
    border-color: #0B3D91 !important;
    outline: none !important;
}

/* 4. LIST LAYOUT FOR MEMBERS & GROUPS (Individual Cards Style) */
#buddypress ul.item-list:not(#topic-post-list) {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Espace entre les cartes */
    border: none;
    padding: 0;
    background: transparent;
}

#buddypress ul.item-list:not(#topic-post-list) li {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
    margin: 0 !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
}

#buddypress ul.item-list:not(#topic-post-list) li:hover {
    background: #ffffff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
    border-color: #d1d5db !important;
}

#buddypress ul.item-list:not(#topic-post-list) li .list-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 5. AVATARS (WhatsApp Style) */
#buddypress ul.item-list li .item-avatar {
    margin-bottom: 0;
    margin-right: 16px;
    flex-shrink: 0;
    order: -1 !important;
}

#buddypress ul.item-list li .item-avatar img.avatar {
    width: 56px;
    height: 56px;
    border-radius: 25%; /* Rounded square like the screenshot */
    border: none;
    object-fit: cover;
}

/* 6. CARD CONTENT */
#buddypress ul.item-list li .item {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: center !important;
    min-width: 0; /* Ensures text-overflow works */
}

#buddypress ul.item-list li .item-block {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 4px;
}

#buddypress ul.item-list li .item-title,
#buddypress ul.item-list li .list-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
    text-align: left !important;
    flex-grow: 1;
}

#buddypress ul.item-list li .item-title a,
#buddypress ul.item-list li .list-title a {
    color: #111827 !important;
    text-decoration: none !important;
    text-align: left !important;
}

#buddypress ul.item-list li .item-title a:hover {
    color: #0B3D91;
}

#buddypress ul.item-list li .item-meta,
#buddypress ul.item-list li .meta {
    font-size: 13px !important;
    color: #059669 !important; /* Vert émeraude un peu plus foncé et lisible */
    font-weight: 600 !important;
    margin: 0 !important;
    width: auto;
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

#buddypress ul.item-list li .item-meta span,
#buddypress ul.item-list li .meta span {
    display: inline-block;
    margin-left: 4px;
}

#buddypress ul.item-list li .item-desc,
#buddypress ul.item-list li .group-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 !important;
    line-height: 1.4;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 7. ACTION BUTTONS (Tiny pill style to fit the row) */
#buddypress ul.item-list li .action {
    margin-top: 0;
    margin-left: 16px;
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#buddypress ul.item-list li .action .generic-button a,
#buddypress ul.item-list li .action .group-button a {
    display: inline-block;
    text-align: center;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Primary Action Buttons */
#buddypress ul.item-list li .action .generic-button a.add,
#buddypress ul.item-list li .action .group-button a.join-group {
    background: #0B3D91;
    color: #ffffff;
    border: 1px solid #0B3D91;
}

#buddypress ul.item-list li .action .generic-button a.add:hover,
#buddypress ul.item-list li .action .group-button a.join-group:hover {
    background: #082d6e;
}

/* Secondary Action Buttons (Pending, Remove, Leave) */
#buddypress ul.item-list li .action .generic-button a.remove,
#buddypress ul.item-list li .action .generic-button a.requested,
#buddypress ul.item-list li .action .group-button a.leave-group {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

#buddypress ul.item-list li .action .generic-button a.remove:hover,
#buddypress ul.item-list li .action .generic-button a.requested:hover,
#buddypress ul.item-list li .action .group-button a.leave-group:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Messages Button */
#buddypress ul.item-list li .action .generic-button a.send-message {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

#buddypress ul.item-list li .action .generic-button a.send-message:hover {
    background: #e5e7eb;
}

/* Hide extra metadata / make it cleaner */
#buddypress ul.item-list li .update {
    display: none;
}

/* Responsive */
@media screen and (max-width: 768px) {
    #buddypress div.dir-search, 
    #buddypress div.item-list-tabs#subnav {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    #buddypress div.dir-search form input[type="text"] {
        width: 100%;
        margin-bottom: 8px;
    }
    
    #buddypress ul.item-list:not(#topic-post-list) {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   8. SINGLE GROUP / USER HEADER (Facebook Style Cover & Avatar)
   ========================================================================== */
#buddypress #item-header {
    background: #ffffff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-top: none;
}

#buddypress #item-header-cover-image {
    display: none !important; /* Masqué pour enlever le grand espace gris */
}

#buddypress #item-header-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#buddypress #item-header-avatar {
    position: static;
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

#buddypress #item-header-avatar img.avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid #ffffff; /* Bordure épaisse blanche façon Facebook */
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

#buddypress #item-header-content {
    margin-top: 16px; /* Plus besoin de 70px car l'avatar n'est plus absolu */
    padding: 0 24px;
    display: flex;
    flex-direction: column;
}

#buddypress #item-header-content h2.user-nicename,
#buddypress #item-header-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
}

#buddypress #item-header-content .highlight {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

#buddypress #item-header-content .group-meta,
#buddypress #item-header-content .activity {
    font-size: 14px;
    color: #4b5563;
}

#buddypress #item-header-content #item-buttons {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   9. SINGLE GROUP / USER NAVIGATION (Instagram/Facebook Style Tabs)
   ========================================================================== */
#buddypress #item-nav {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    padding: 0 20px;
}

#buddypress #item-nav div.item-list-tabs ul {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0;
    padding: 0;
    border: none;
    scrollbar-width: none; /* Cache la scrollbar sur Firefox */
}
#buddypress #item-nav div.item-list-tabs ul::-webkit-scrollbar {
    display: none; /* Cache la scrollbar sur Chrome/Safari */
}

#buddypress #item-nav div.item-list-tabs ul li {
    margin: 0;
    padding: 0;
}

#buddypress #item-nav div.item-list-tabs ul li a {
    display: inline-block;
    padding: 20px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#buddypress #item-nav div.item-list-tabs ul li.current a,
#buddypress #item-nav div.item-list-tabs ul li.selected a {
    color: #0B3D91;
    background: transparent;
    border-bottom: 3px solid #0B3D91; /* Ligne bleue façon FB/Insta */
    box-shadow: none;
}

#buddypress #item-nav div.item-list-tabs ul li a:hover {
    color: #111827;
    background: rgba(0,0,0,0.02);
}

/* ==========================================================================
   10. ACTIVITY FEED (Facebook/Instagram Post Style)
   ========================================================================== */
#buddypress ul.activity-list {
    list-style: none;
    margin: 0;
    padding: 24px;
    display: flex;
    flex-direction: column-reverse; /* Inverse l'ordre : plus récents en bas */
    gap: 16px;
    background: #efeae2; /* Fond de chat WhatsApp */
    border-radius: 12px;
    padding-bottom: 100px; /* Espace pour le formulaire fixe */
}

#buddypress ul.activity-list > li {
    background: #ffffff; /* Bulle blanche (autres) */
    border: none;
    border-radius: 0 16px 16px 16px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-self: flex-start;
    max-width: 85%;
    position: relative;
}

/* Bulle verte pour l'utilisateur courant */
#buddypress ul.activity-list > li.is-current-user {
    background: #dcf8c6 !important;
    border-radius: 16px 0 16px 16px;
    align-self: flex-end;
}

#buddypress ul.activity-list > li .activity-avatar {
    float: none;
    margin-right: 12px;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

#buddypress ul.activity-list > li.is-current-user .activity-avatar {
    display: none; /* Cacher l'avatar pour ses propres messages comme sur WhatsApp */
}

#buddypress ul.activity-list > li .activity-avatar img.avatar {
    width: 36px !important;
    height: 36px !important;
    max-width: none;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f3f4f6;
}

#buddypress ul.activity-list > li .activity-content {
    margin-left: 0;
    flex: 1 1 0%;
}

#buddypress ul.activity-list > li .activity-comments {
    flex: 0 0 100%;
    margin-top: 8px;
}

#buddypress ul.activity-list > li .activity-header {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 4px;
}

#buddypress ul.activity-list > li .activity-header a {
    color: #000000;
    font-weight: 700;
    text-decoration: none;
}

#buddypress ul.activity-list > li .activity-header a:hover {
    color: #0B3D91;
    text-decoration: underline;
}

#buddypress ul.activity-list > li .activity-header .time-since {
    display: inline-block;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 6px;
}

#buddypress ul.activity-list > li .activity-inner {
    font-size: 15px;
    color: #111827;
    line-height: 1.5;
    margin: 0;
    background: transparent;
    padding: 0;
}

#buddypress ul.activity-list > li .activity-inner p {
    margin: 0;
}

/* Action Buttons (Like, Comment) - Masqués pour le style WhatsApp */
#buddypress ul.activity-list > li .activity-meta {
    display: none !important;
}

#buddypress ul.activity-list > li .activity-meta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

#buddypress ul.activity-list > li .activity-meta a:hover {
    background: #f3f4f6;
    color: #374151;
}

#buddypress ul.activity-list > li .activity-meta a.button-active {
    color: #0B3D91;
}

/* Comments Section (WhatsApp/Messenger bubble style) */
#buddypress ul.activity-list > li .activity-comments {
    margin-top: 8px;
    margin-left: 0;
    padding-top: 8px;
}

/* Cacher le champ de réponse pour chaque bulle (Style WhatsApp = 1 seul champ en bas) */
#buddypress ul.activity-list > li .activity-comments form.ac-form {
    display: none !important;
}

#buddypress ul.activity-list > li .activity-comments ul li {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    margin-bottom: 12px;
    display: flex;
}

#buddypress ul.activity-list > li .activity-comments ul li .acomment-avatar img.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
}

#buddypress ul.activity-list > li .activity-comments ul li .acomment-meta {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

#buddypress ul.activity-list > li .activity-comments ul li .acomment-content {
    background: #f3f4f6; /* Bulle grise façon Messenger */
    padding: 10px 14px;
    border-radius: 16px;
    border-top-left-radius: 4px; /* Effet bulle de chat */
    color: #1f2937;
    font-size: 14px;
    display: inline-block;
    max-width: 100%;
}

#buddypress ul.activity-list > li .activity-comments form.ac-form {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 12px;
}

#buddypress ul.activity-list > li .activity-comments form.ac-form textarea {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    height: 42px;
    transition: all 0.2s ease;
}

#buddypress ul.activity-list > li .activity-comments form.ac-form textarea:focus {
    background: #ffffff;
    border-color: #0B3D91;
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
    outline: none;
}

#buddypress ul.activity-list > li .activity-comments form.ac-form input[type="submit"] {
    background: #0B3D91;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#buddypress ul.activity-list > li .activity-comments form.ac-form input[type="submit"]:hover {
    background: #082d6e;
}

/* Masquer le pied de page (footer) sur les pages communautaires pour un look "App" */
body.buddypress footer.site-footer,
body.buddypress #colophon {
    display: none !important;
}

/* Post update form (What's new) - WhatsApp Input Style */
form#whats-new-form {
    background: #ffffff; /* Fond clair */
    border: none;
    border-radius: 12px; /* Petits coins arrondis pour l'effet flottant */
    padding: 10px 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin: 0;
    position: fixed !important;
    bottom: 50px !important; /* Plus haut que le bas de l'écran */
    left: 50%;
    transform: translateX(-50%); /* Centrage horizontal */
    width: 95%; /* Légère marge sur les côtés */
    max-width: 840px; /* Limite pour ne pas être trop large sur PC */
    z-index: 999999 !important;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    gap: 12px;
}

form#whats-new-form #whats-new-avatar {
    display: none;
}

form#whats-new-form #whats-new-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    width: auto;
    margin: 0;
    box-sizing: border-box;
}

form#whats-new-form #whats-new-textarea {
    flex-grow: 1;
    background: #f0f2f5; /* Intérieur gris clair WhatsApp */
    border: 1px solid #ced4da; /* Bordure pour bien le délimiter */
    border-radius: 24px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

form#whats-new-form textarea#whats-new {
    border: none;
    padding: 12px 0;
    font-size: 15px;
    color: #111827; /* Texte sombre sur fond clair */
    width: 100%;
    resize: none;
    height: 44px !important;
    min-height: 44px !important;
    background: transparent;
    line-height: 20px;
    overflow: hidden;
    box-sizing: border-box;
}
form#whats-new-form textarea#whats-new::placeholder {
    color: #495057; /* Gris plus foncé et contrasté */
    font-weight: 500;
}

form#whats-new-form textarea#whats-new:focus {
    outline: none;
    box-shadow: none;
}

form#whats-new-form #whats-new-options {
    padding: 0;
    margin: 0;
    display: flex !important;
    align-items: center;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    gap: 15px; /* Espacement entre la zone de texte et les boutons */
}

form#whats-new-form #whats-new-post-in-box {
    display: none !important; /* Masquer la sélection "Poster dans Profil" */
}

form#whats-new-form #whats-new-submit {
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

form#whats-new-form #aw-whats-new-submit {
    background: #00a884;
    color: #fff;
    border: none;
    border-radius: 50px !important; /* Arrondi parfait */
    padding: 0 20px;
    height: 44px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

/* Style de tous les autres boutons dans la zone d'options (comme Annuler) */
form#whats-new-form #whats-new-options button,
form#whats-new-form #whats-new-options input[type="button"],
form#whats-new-form #whats-new-options input[type="reset"],
form#whats-new-form #whats-new-options a.button {
    border-radius: 50px !important; /* Arrondi parfait */
}

/* Rendre les boutons inactifs tant que rien n'est écrit ! */
form#whats-new-form:has(textarea#whats-new:placeholder-shown) #whats-new-options button,
form#whats-new-form:has(textarea#whats-new:placeholder-shown) #whats-new-options input[type="submit"],
form#whats-new-form:has(textarea#whats-new:placeholder-shown) #whats-new-options input[type="button"],
form#whats-new-form:has(textarea#whats-new:placeholder-shown) #whats-new-options input[type="reset"],
form#whats-new-form:has(textarea#whats-new:placeholder-shown) #whats-new-options a.button {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* On s'assure de ne pas cacher Annuler puisqu'il a été demandé */

/* Masquer la boîte vide laissée à l'endroit d'origine du formulaire */
#bp-nouveau-activity-form {
    display: none !important;
}

/* ==========================================================================
   SKELETON LOADING SHIMMER (Replaces yellow loading box)
   ========================================================================== */

.is-loading-shimmer {
    height: 332px !important; /* Espace pour 3 cartes squelettes */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: transparent !important;
    position: relative !important;
    overflow: hidden !important;
}

.is-loading-shimmer * {
    display: none !important;
}

/* Dessin des cartes squelettes via des dégradés */
.is-loading-shimmer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    
    background-image: 
        radial-gradient(circle 28px at 48px 50px, #cbd5e1 99%, transparent 100%),
        linear-gradient(to bottom, #cbd5e1 0, #cbd5e1 16px, transparent 16px),
        linear-gradient(to bottom, #cbd5e1 0, #cbd5e1 12px, transparent 12px),
        linear-gradient(to bottom, #cbd5e1 0, #cbd5e1 20px, transparent 20px),
        linear-gradient(to bottom, #ffffff 0, #ffffff 98px, transparent 98px),
        linear-gradient(to bottom, #e5e7eb 0, #e5e7eb 100px, transparent 100px);
        
    background-repeat: repeat-y;
        
    background-size: 
        100% 116px, 
        150px 116px, 
        100px 116px, 
        80px 116px,  
        calc(100% - 2px) 116px, 
        100% 116px;
        
    background-position:
        left 0 top 0,             
        left 104px top 30px,      
        left 104px top 58px,      
        right 20px top 40px, 
        left 1px top 1px,         
        left 0 top 0;             
}

/* Animation de la vague lumineuse (shimmer) */
@keyframes bpSkeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Animation du reflet */
.is-loading-shimmer::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
    animation: bpSkeletonShimmer 1.5s infinite linear;
    pointer-events: none;
    z-index: 10;
}

/* ==========================================================================
   EMPTY STATE (Remplacement du message info par défaut)
   ========================================================================== */

#buddypress .bp-feedback.info,
#buddypress .bp-messages.info {
    background-color: #f8fafc !important;
    border: 2px dashed #cbd5e1 !important;
    border-radius: 24px !important;
    padding: 60px 20px !important;
    text-align: center !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px 0 !important;
}

#buddypress .bp-feedback.info p,
#buddypress .bp-feedback.info span,
#buddypress .bp-messages.info p,
#buddypress .bp-messages.info span {
    display: none !important;
}

/* Icone (Loupe minimaliste) */
#buddypress .bp-feedback.info::before,
#buddypress .bp-messages.info::before {
    content: "";
    display: block;
    width: 64px;
    height: 64px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 20px;
    opacity: 0.8;
}

/* Texte */
#buddypress .bp-feedback.info::after,
#buddypress .bp-messages.info::after {
    content: "C'est bien calme par ici...\A Il n'y a rien à afficher pour le moment avec ces filtres.";
    white-space: pre-wrap;
    line-height: 1.6;
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
}

/* ==========================================================================
   HIDE RSS ICON
   ========================================================================== */
#buddypress a.bp-rss-link,
#buddypress div.feed,
#buddypress li.feed,
#buddypress #activity-rss-feed,
#buddypress .bp-icon-rss,
#buddypress a[title*="RSS"],
#buddypress .activity-rss-link {
    display: none !important;
}

/* ==========================================================================
   HIDE BREADCRUMBS (Fil d'ariane)
   ========================================================================== */
.learn-press-breadcrumb,
.kadence-breadcrumbs,
.woocommerce-breadcrumb,
nav.learn-press-breadcrumb,
.lp-breadcrumb {
    display: none !important;
}

/* ==========================================================================
   CARTES ENTIEREMENT CLIQUABLES (Groupes, Membres)
   ========================================================================== */

#buddypress #groups-list > li,
#buddypress #members-list > li {
    position: relative;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Effet au survol */
#buddypress #groups-list > li:hover,
#buddypress #members-list > li:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

/* Le lien du titre s'etend sur toute la carte */
#buddypress #groups-list > li .list-title a::after,
#buddypress #groups-list > li .item-title a::after,
#buddypress #members-list > li .list-title a::after,
#buddypress #members-list > li .item-title a::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
}

/* On s'assure que les boutons d'action (Rejoindre, Ajouter, etc.) sont au-dessus */
#buddypress #groups-list > li .action,
#buddypress #members-list > li .action {
    position: relative;
    z-index: 20;
}

/* ==========================================================================
   INVERSER L'ORDRE DES MESSAGES (Plus recents en bas, style chat)
   ========================================================================== */

#buddypress ul.activity-list,
.buddypress-wrap ul.activity-list,
ul.activity-list {
    display: flex !important;
    flex-direction: column-reverse !important;
}

/* Masquer complètement l'en-tête BuddyPress (boîte grise, description, conteneurs vides) */
#buddypress #item-header,
#buddypress #header-cover-image,
#buddypress #item-header-cover-image,
#buddypress .desc-wrap,
#buddypress .group-description {
    display: none !important;
}
