/* On cible le conteneur de recherche pour aligner les avatars juste après */
.search-box {
    display: flex !important;
    align-items: center;
    float: left; /* Garde la recherche à gauche du bloc pagination */
}

.ca-participate-search-wrapper {
    display: flex !important;
    align-items: center;
    margin-left: 10px; /* Espace entre la loupe et les avatars */
    vertical-align: middle;
}

/* On s'assure que rien ne vient parasiter l'alignement */
.avatar-stack {
    display: flex;
    align-items: center;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.stack-item img {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    border: 2px solid #fff;
    margin-left: -10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.stack-item:first-child img {
    margin-left: 0;
}

.plus-btn {
    margin-left: 8px;
    font-size: 1.2em;
    color: #105289;
    text-decoration: none !important;
}

/* --- BARRE D'AVATARS DANS LE TITRE (A DROITE) --- */
.ca-participate-wrapper {
    float: right;
    margin-top: -5px;
    position: relative;
    z-index: 10;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

.stack-item img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: 2px solid #fff;
    margin-left: -10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    vertical-align: middle;
}

.stack-item:first-child img {
    margin-left: 0;
}

.plus-btn {
    margin-left: 8px;
    color: #105289;
    font-size: 1.3em;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1;
}

/* --- FENETRE MODALE (CENTRAGE ABSOLU) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Fond noir transparent */
    z-index: 99999;
    display: none; /* Piloté par le .show() du JS */
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* CENTRAGE MILIEU ECRAN BORDEL */
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}

.modal-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-text {
    font-weight: bold;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
}

.close-modal {
    cursor: pointer;
    font-size: 24px;
    color: #999;
    line-height: 1;
}

.close-modal:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* Centre les avatars dans la modale */
}

/* --- CARTES UTILISATEURS DANS LA MODALE --- */
.contributor-card {
    text-align: center;
    width: 70px;
}

.avatar-box {
    position: relative;
    display: inline-block;
}

.avatar-box img {
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    border: 1px solid #ddd;
    display: block;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c; /* ROUGE */
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #fff;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.name {
    font-size: 11px;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold;
}

.name a {
    text-decoration: none !important;
}

.name a:hover {
    text-decoration: underline !important;
}