/*
 * Styles pour le plugin SG-Social
 * Version: 1.2 (Nettoyée et améliorée)
 */

/* ===================================================
   1. STYLES GÉNÉRAUX & NOTIFICATIONS
   =================================================== */

/* --- Badge de notification sur la cloche --- */
#wnmm-fab-bell .sg-social-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #d63638;
    color: #ffffff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    z-index: 2;
}

/* --- Notifications dans le panneau du menu mobile --- */
.sg-social-requests-container {
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 15px;
    padding-top: 15px;
}
.wnmm-fab-theme-dark .sg-social-requests-container {
    border-top-color: rgba(255,255,255,0.15);
}
.sg-social-requests-container h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
}
.sg-social-request-item {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: opacity 0.3s ease;
}
.wnmm-fab-theme-dark .sg-social-request-item {
     border-bottom-color: rgba(255,255,255,0.1);
}
.sg-social-request-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.sg-social-request-item p {
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* --- Boutons d'action dans les notifications (Accepter/Refuser) --- */
.sg-social-actions button {
    margin-right: 10px;
    padding: 6px 12px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f7f7f7;
    color: #333;
    border-radius: 3px;
    font-size: 13px;
}
.sg-social-actions button:hover {
    border-color: #999;
    background: #f0f0f0;
}
.sg-social-actions .sg-social-accept-btn {
    background-color: #e7f7e7;
    border-color: #5cb85c;
    color: #3c763d;
}
.sg-social-actions .sg-social-accept-btn:hover {
    background-color: #dff0d8;
    border-color: #4cae4c;
}
.sg-social-actions .sg-social-reject-btn {
    background-color: #fdeaea;
    border-color: #d9534f;
    color: #a94442;
}
.sg-social-actions .sg-social-reject-btn:hover {
    background-color: #f9d6d6;
    border-color: #d43f3a;
}


/* ===================================================
   2. STYLES DE LA PAGE PROFIL
   =================================================== */

.sg-social-profile-wrapper {
    background: #fff;
    border: 1px solid #e2e2e2;
    padding: 20px;
    border-radius: 4px;
}

/* --- En-tête du profil --- */
.sg-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e2e2;
}
.sg-profile-header img {
    border-radius: 50%;
}
.sg-profile-header-info h2 {
    margin: 0 0 5px 0;
}
.sg-profile-member-since {
    font-style: italic;
    color: #777;
    margin: 0;
}

/* --- Lien d'édition du profil (roue crantée) --- */
.sg-profile-title-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}
.sg-profile-title-bar h2 {
    margin-bottom: 0 !important;
}
.sg-profile-edit-link {
    font-size: 24px;
    text-decoration: none;
    color: #555;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    display: inline-block;
}
.sg-profile-edit-link:hover {
    color: #000;
    transform: rotate(45deg);
}

/* --- Corps du profil (Stats, Badges, Amis, Activité) --- */
.sg-profile-body {
    padding-top: 20px;
}
.sg-profile-stats-badges {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.sg-profile-stats, .sg-profile-badges-container {
    flex: 1;
    min-width: 250px;
}

/* --- Section des badges --- */
.sg-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.sg-badge-item {
    position: relative;
    transition: transform 0.2s ease;
}
.sg-badge-item:hover {
    transform: scale(1.1);
}
.sg-badge-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sg-badge-placeholder-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sg-badge-award-count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #E74C3C;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
}


/* ===================================================
   3. STYLES DES LISTES (AMIS, DEMANDES, RECHERCHE)
   =================================================== */

/* --- Styles communs aux listes détaillées (Amis & Demandes en attente) --- */
.sg-friends-list-detailed,
.sg-pending-requests-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #f0f0f0;
}
.sg-friends-list-detailed li,
.sg-pending-requests-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.3s ease;
}
.sg-friends-list-detailed li:last-child,
.sg-pending-requests-list li:last-child {
    border-bottom: none;
}
.sg-friends-list-detailed .sg-friend-info,
.sg-pending-requests-list .sg-pending-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}
.sg-friends-list-detailed img,
.sg-pending-requests-list img {
    border-radius: 50%;
}
.sg-friends-list-detailed .sg-friend-info:hover {
    color: #3ca569; /* Couleur au survol pour le lien du profil ami */
}
.sg-pending-title {
    margin-top: 30px;
}

/* --- Boutons d'action des listes (Retirer & Annuler) --- */
.sg-friends-list-detailed .sg-remove-friend-btn,
.sg-pending-requests-list .sg-cancel-request-btn {
    padding: 5px 12px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid #d9534f;
    background: #fdeaea;
    color: #a94442;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}
.sg-friends-list-detailed .sg-remove-friend-btn:hover:not(:disabled),
.sg-pending-requests-list .sg-cancel-request-btn:hover:not(:disabled) {
    background-color: #f9d6d6;
}

/* --- Styles de la recherche de membres --- */
.sg-user-search-form {
    position: relative;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.sg-user-search-form input[type="search"] {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.sg-user-search-form button {
    padding: 8px 16px;
    background-color: #3ca569;
    color: white;
    border: 1px solid #3ca569;
    border-radius: 3px;
    cursor: pointer;
}
.sg-user-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.sg-user-list-item:last-child {
    border-bottom: none;
}
.sg-user-list-avatar img {
    border-radius: 50%;
}
.sg-user-list-info {
    flex-grow: 1;
}
.sg-user-list-name {
    font-weight: bold;
}

/* --- Boutons d'action dans la recherche ou sur profil public --- */
.sg-user-list-actions button,
.sg-profile-actions button {
    padding: 5px 12px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f7f7f7;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}
.sg-user-list-actions button:hover:not(:disabled),
.sg-profile-actions button:hover:not(:disabled) {
    background-color: #e0e0e0;
}
.sg-user-list-actions button:disabled,
.sg-profile-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
.sg-user-list-actions button.is-pending,
.sg-profile-actions button.is-pending {
    background-color: #fff8e1;
    border-color: #ffeeba;
    color: #856404;
}
.sg-user-list-actions button.is-friend,
.sg-profile-actions button.is-friend {
    background-color: #e7f7e7;
    border-color: #c3e6cb;
}
.sg-profile-actions .sg-remove-friend-btn,
.sg-profile-actions .sg-cancel-request-btn {
    border-color: #d9534f;
    background: #fdeaea;
    color: #a94442;
}
.sg-profile-actions .sg-remove-friend-btn:hover:not(:disabled),
.sg-profile-actions .sg-cancel-request-btn:hover:not(:disabled) {
    background-color: #f9d6d6;
}


/* ===================================================
   4. OUTILS DES LISTES D'AMIS (RECHERCHE, VOIR PLUS...)
   =================================================== */

.sg-friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}
.sg-friends-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}
#sg-friend-search-input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    min-width: 200px;
}
.sg-friends-collapse-icon {
    cursor: pointer;
    color: #555;
    transition: color 0.2s ease;
}
.sg-friends-collapse-icon:hover {
    color: #000;
}

/* --- Style amélioré pour le bouton "Voir plus/moins" --- */
#sg-friends-toggle-view.sg-toggle-button {
    display: block;                 
    width: fit-content;              
    margin: 20px auto 0 auto;        
    padding: 8px 20px;             
    background-color: #DCDCDC;   
    color: #555;                   
    border: 1px solid #ddd;          
    border-radius: 10px;             
    cursor: pointer;
    font-weight: normal;            
    font-size: 0.9em;               
    transition: all 0.2s ease;     
}

#sg-friends-toggle-view.sg-toggle-button:hover {
    background-color: #f5f5f5;       /* Léger fond gris au survol */
    color: #000;                     /* Texte noir pour la lisibilité */
    border-color: #bbb;              /* Bordure un peu plus visible au survol */
}


/* ===================================================
   5. FIL D'ACTIVITÉ
   =================================================== */

.sg-activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sg-activity-feed li {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.sg-activity-feed li:last-child {
    border-bottom: none;
}
.sg-activity-feed img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover;
}
.sg-activity-content p {
    margin: 0 0 5px 0;
}
.sg-activity-time {
    font-size: 0.9em;
    color: #999;
}


/* ===================================================
   6. CLASSES UTILITAIRES
   =================================================== */

/* --- Bouton d'action sur le profil public --- */
.sg-profile-actions {
    margin-top: 15px;
}

/* --- Spinner, Messages de recherche --- */
.sg-user-search-form .spinner {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background-size: 16px 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s;
}
.sg-user-search-form .spinner.is-active {
    opacity: 1;
}
.sg-no-results-message,
.sg-search-prompt {
    padding: 15px;
    border-radius: 3px;
    text-align: center;
    background-color: #f8f9fa;
    color: #6c757d;
    font-style: italic;
    margin-top: 15px;
}