:root { 
    --fb-blue: #1877f2; --fb-bg: #f0f2f5; --fb-gray: #65676b; 
    --fb-divider: #ced0d4; --fb-green: #31a24c; 
}
body { font-family: 'Segoe UI', Helvetica, Arial, sans-serif; background-color: var(--fb-bg); margin: 0; color: #1c1e21; overflow-y: scroll; overflow-x: hidden; }

/* --- GLOBAL & AUTH --- */
.online-dot { position: absolute; background-color: var(--fb-green); border-radius: 50%; border: 2px solid white; z-index: 10; }
.header-user-pill .online-dot { width: 10px; height: 10px; bottom: 2px; right: 2px; }
.profile-avatar-container .online-dot { width: 24px; height: 24px; bottom: 15px; right: 15px; border: 4px solid white; }
#auth-screen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #f0f2f5; 
    z-index: 10000; 
    
    /* Gestion du scroll */
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; /* Fluidité sur mobile */
    
    /* Flexbox pour centrer */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    
    /* ESPACEMENT */
    padding-top: 50px; 
    /* On force une très grande marge en bas pour être tranquille */
    padding-bottom: 150px !important; 
    
    /* Astuce pour que le padding-bottom soit pris en compte dans le scroll flexbox */
    box-sizing: border-box;
}
.auth-logo-text { font-size: 2.5rem; font-weight: bold; color: #1877f2; margin-bottom: 20px; letter-spacing: -1px; }
.auth-card { 
    background: white; 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    width: 450px; 
    max-width: 95%; 
    text-align: center; 
    
    /* On ajoute une marge sous la carte elle-même */
    margin-bottom: 50px;
    flex-shrink: 0; /* Empêche la carte de s'écraser si l'écran est petit */
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.full-width { grid-column: span 2; }
label { font-size: 0.8rem; color: #65676b; font-weight: 600; margin-bottom: 2px; display: block; }
.auth-input { width: 100%; padding: 12px 14px; margin-bottom: 0; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; box-sizing: border-box; }
#form-login .auth-input { margin-bottom: 12px; }
.auth-btn { width: 100%; padding: 12px; background: var(--fb-blue); color: white; border: none; border-radius: 6px; font-size: 1.2rem; font-weight: bold; cursor: pointer; transition: 0.2s; }
.auth-btn:hover { background: #1569d8; }
.auth-switch { margin-top: 20px; font-size: 0.95rem; color: var(--fb-blue); cursor: pointer; text-decoration: none; }
.auth-switch:hover { text-decoration: underline; }

/* --- HEADER --- */
#app-screen { display: none; } 
header { 
    background: white; 
    color: #1c1e21; 
    padding: 0 16px; 
    height: 56px; /* Hauteur standard FB */
    display: flex; 
    align-items: center; 
    justify-content: space-between; /* Sépare Gauche / Centre / Droite */
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
}
.header-left { display: flex; align-items: center; gap: 10px; width: 300px; }
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Prend toute la place disponible au centre */
    height: 100%;
    gap: 5px;
}
/* NOUVEAU STYLE DES BOUTONS DU CENTRE */
.nav-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90%; /* Presque toute la hauteur */
    width: 100px; /* Largeur fixe pour faire des rectangles */
    max-width: 120px;
    cursor: pointer;
    border-radius: 8px; /* Coins arrondis légers */
    background: transparent; /* Pas de fond */
    color: #65676b; /* Gris par défaut */
    font-size: 1.6rem; /* Icône assez grande */
    position: relative;
    transition: 0.2s;
}

.nav-tab:hover {
    background-color: #f0f2f5; /* Gris clair au survol */
}

/* L'onglet actif (Bleu) */
.nav-tab.active-tab {
    color: var(--fb-blue);
    border-bottom: 3px solid var(--fb-blue); /* Ligne bleue en bas */
    border-radius: 0; /* Pas d'arrondi quand actif (style FB) */
}
.nav-tab.active-tab:hover {
    background-color: transparent;
}

/* DROITE : Profil, etc. */
.header-right { 
    display: flex; 
    align-items: center; 
    justify-content: flex-end; 
    gap: 10px; 
    width: 300px; 
}

/* --- SIDEBAR GAUCHE (PC / DESKTOP) --- */
.sidebar-left {
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    
    /* Hauteur : Toute la hauteur - la hauteur du header */
    height: calc(100vh - 56px); 
    
    background: #f0f2f5;
    
    /* Marge intérieure (Bas = 100px pour l'espace du footer) */
    padding: 20px 10px 100px 10px;
    
    /* --- C'EST ICI LA CORRECTION --- */
    /* 1. Force la barre de défilement verticale */
    overflow-y: auto; 
    
    /* 2. OBLIGATOIRE : Fait en sorte que le padding ne dépasse pas des 100% de hauteur */
    box-sizing: border-box; 
    
    display: none; /* Caché par défaut, affiché par le media query plus bas */
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
    color: #050505;
}

.sidebar-item:hover {
    background-color: #e4e6eb; /* Gris plus foncé au survol */
}

.sidebar-icon {
    font-size: 1.5rem;
    width: 36px; /* Pour aligner le texte */
    text-align: center;
    margin-right: 10px;
}

.sidebar-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.sidebar-divider {
    border-bottom: 1px solid #ced0d4;
    margin: 10px 8px;
}
.header-logo {
    /* 1. DIMENSIONS STRICTES (Cercle parfait pour le menu) */
    width: 40px;
    height: 40px;
    min-width: 40px; 
    min-height: 40px;
    padding: 0;
    
    /* 2. FORME */
    border-radius: 50%; 
    
    /* 3. CENTRAGE */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 4. COULEURS (Les mêmes que le Splash) */
    background-color: #1877f2;
    color: white;
    
    /* 5. TEXTE */
    font-size: 2rem; /* Taille adaptée au cercle de 40px */
    font-weight: 900;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1; 
    
    /* 6. AJUSTEMENT DU "g" */
    /* Comme le cercle est plus petit (40px vs 60px), le padding doit être plus petit aussi */
    padding-bottom: 15px; 
    box-sizing: border-box;

    /* 7. AUTRES */
    margin-right: 10px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(24, 119, 242, 0.3); /* Légère ombre pour le relief */
}
.search-box { position: relative; display: flex; align-items: center; background: #f0f2f5; padding: 0 10px 0 12px; border-radius: 20px; height: 40px; width: 240px; transition: width 0.2s; }
.search-box:focus-within { width: 300px; }
.search-box i { color: #65676b; font-size: 1rem; margin-right: 8px; }
.search-input { border: none; background: transparent; outline: none; font-size: 0.95rem; width: 100%; color: #050505; }
.search-dropdown { position: absolute; top: 50px; left: 0; width: 100%; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 1px solid #ddd; display: none; z-index: 1001; max-height: 400px; overflow-y: auto; padding: 8px 0; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; transition: 0.2s; }
.search-item:hover { background: #f2f2f2; }
.search-item img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; }
.search-info { display: flex; flex-direction: column; }
.search-name { font-weight: 600; font-size: 0.95rem; }
.search-sub { font-size: 0.8rem; color: #65676b; }
.header-user-pill { position: relative; display: flex; align-items: center; cursor: pointer; padding: 5px; border-radius: 50%; transition: 0.2s; margin-right: 5px; }
.header-user-pill:hover { background: #f2f2f2; }
.header-user-pill img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #ddd; object-fit: cover; }
.container { max-width: 580px; margin: 20px auto; padding: 0 10px; padding-bottom: 50px; }
.container.profile-mode { max-width: 580px; } 
.nav-back-btn { display: none; align-items: center; gap: 5px; cursor: pointer; font-weight: 600; color: #65676b; margin-right: 15px; font-size: 1.2rem; }
.nav-back-btn:hover { color: #1c1e21; }
.nav-icon-btn { position: relative; background: #e4e6eb; color: #050505; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.nav-icon-btn:hover { background: #d8dadf; }
.nav-badge { position: absolute; top: -5px; right: -5px; background: #e41e3f; color: white; font-size: 0.75rem; padding: 2px 6px; border-radius: 10px; border: 2px solid white; font-weight: bold; display: none; }
.notif-dropdown { position: absolute; top: 55px; right: 10px; width: 360px; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); border: 1px solid #ddd; z-index: 2000; display: none; max-height: 500px; overflow-y: auto; }
.notif-header { padding: 15px; font-weight: bold; font-size: 1.2rem; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; color: #1c1e21; }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 10px 15px; cursor: pointer; transition: 0.2s; position: relative; color: #1c1e21; }
.notif-item:hover { background: #f0f2f5; }
.notif-item.unread { background: #e7f3ff; }
.notif-dot { width: 8px; height: 8px; background: var(--fb-blue); border-radius: 50%; position: absolute; right: 15px; }
.notif-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.notif-text { font-size: 0.95rem; line-height: 1.3; flex: 1; }
.notif-time { font-size: 0.8rem; color: var(--fb-blue); font-weight: 600; margin-top: 3px; }
.notif-see-more { text-align: center; padding: 10px; color: var(--fb-blue); font-weight: bold; cursor: pointer; border-top: 1px solid #eee; }
.notif-see-more:hover { background: #f0f2f5; text-decoration: underline; }

/* --- PROFIL & POSTS --- */
.profile-header { background: white; border-radius: 0 0 8px 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin-bottom: 16px; position: relative; }
.cover-container { position: relative; width: 100%; height: 200px; background: #ddd; overflow: hidden; border-radius: 0 0 8px 8px; cursor: pointer; }
.cover-photo { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-container { position: relative; width: 130px; height: 130px; margin: -65px auto 10px; }
.profile-avatar-large { width: 130px; height: 130px; border-radius: 50%; border: 4px solid white; object-fit: cover; background: white; cursor: pointer; position: relative; z-index: 2; }
.camera-hint { position: absolute; bottom: 15px; right: 15px; background: #e4e6eb; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; z-index: 10; border: 2px solid white; opacity: 0; transition: all 0.2s; cursor: pointer; }
.cover-container:hover .camera-hint, .profile-avatar-container:hover .camera-hint { opacity: 1; }
.camera-hint:hover { background: #d8dadf; transform: scale(1.1); }
.profile-details { padding: 0 16px 16px; position: relative; text-align: center; }
.profile-name { font-size: 2rem; font-weight: bold; margin-top: 5px; color: #1c1e21; }
.profile-info-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin: 5px 0; color: #65676b; font-size: 0.95rem; }
.p-badge { display: flex; align-items: center; gap: 6px; }
.profile-bio { color: #65676b; margin: 10px 0 15px; max-width: 400px; margin-left: auto; margin-right: auto; font-size: 1rem; }
.profile-stats { display: flex; justify-content: center; gap: 20px; border-top: 1px solid #eee; padding-top: 15px; margin-top: 10px; font-weight: 600; color: #65676b; }
.profile-actions { margin-top: 15px; display: flex; justify-content: center; gap: 10px; }
.btn-edit-profile, .btn-friend { background: #e4e6eb; color: black; padding: 8px 12px; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.btn-edit-profile:hover, .btn-friend:hover { background: #d8dadf; }
.btn-friend-blue { background: var(--fb-blue); color: white; }
.btn-friend-blue:hover { background: #166fe5; }
#profile-feed-container { max-width: 580px; margin: 0 auto; } 
.card { background: white; border-radius: 8px; padding: 0; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); overflow: visible; position: relative; }
.p-header { padding: 12px 16px 0; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eee; flex-shrink: 0; }
.post-info { flex-grow: 1; }
.post-author { font-weight: 600; font-size: 1rem; color: #050505; }
.mood-display { font-weight: normal; color: #65676b; font-size: 0.95rem; }
.post-time { font-size: 0.8rem; color: var(--fb-gray); display: flex; align-items: center; gap: 4px; }
.post-content { padding: 4px 16px 16px; font-size: 0.95rem; line-height: 1.4; }
.post-media { width: 100%; display: block; max-height: 600px; object-fit: cover; }
.plyr { border-radius: 0; width: 100%; }
.shared-post-box { border: 1px solid #ddd; border-radius: 8px; margin: 0 16px 16px; overflow: hidden; }
.shared-header { padding: 10px; background: #f7f8fa; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #eee; }
.shared-content { padding: 10px; font-size: 0.9rem; }
.see-more-link { color: var(--fb-gray); font-weight: 600; cursor: pointer; font-size: 0.9rem; }

/* ======================================================= */
/*      ZONE INTERACTIONS & BOUTONS (CORRIGÉE)             */
/* ======================================================= */

/* 1. Barre de statistiques (Haut du footer) */
.stats-bar {
    display: flex;
    justify-content: space-between; /* Sépare gauche (bulles) et droite (texte) */
    align-items: center;
    padding: 10px 16px; /* Espace confortable */
    padding-bottom: 4px; /* Un peu moins en bas pour coller aux boutons */
    font-size: 0.9rem;
    color: #65676b;
    border-bottom: none; /* Pas de ligne ici, la ligne est sur les boutons */
}
/* Partie Droite (Compteurs) */
.stats-right {
    display: flex;
    gap: 12px;
    
    /* --- AJOUTEZ CECI --- */
    flex-shrink: 0;    /* Interdit de rétrécir cette partie */
    margin-left: 10px; /* Petit espace de sécurité */
}

.stats-right span {
    cursor: pointer;
}
.stats-right span:hover {
    text-decoration: underline;
}

/* Partie Gauche (Noms) */
.react-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
	padding-left: 6px; 
    
    /* --- AJOUTEZ CECI --- */
    flex: 1;                 /* Prend toute la place dispo */
    min-width: 0;            /* Autorise à rétrécir si besoin */
    white-space: nowrap;     /* Interdit le retour à la ligne */
    overflow: hidden;        /* Coupe ce qui dépasse */
    text-overflow: ellipsis; /* Ajoute les "..." */
}
.react-summary:hover {
    text-decoration: underline;
}

/* Mode Sombre */
[data-theme="dark"] .stats-bar { color: #b0b3b8; }
.react-bubble-stack { display: flex; flex-direction: row-reverse; align-items: center; cursor: pointer; }
.react-bubble { 
    width: 18px; height: 18px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 10px; color: white; border: 2px solid white; 
    margin-left: -6px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); 
}
/* Support Emoji Natif (Fond blanc) */
.react-bubble.native { background: #fff; border: none; font-size: 14px; }


/* 2. Barre des Boutons (Style Pilules Grises) */
.interaction-bar {
    display: flex;
    align-items: center;
    gap: 8px; /* Espace entre les boutons */
    padding: 8px 10px;
    border-top: 1px solid #f0f2f5;
    width: 100%;
    box-sizing: border-box;
}

/* Le conteneur du bouton J'aime (Sert de repère pour centrer le menu) */
.reaction-container {
    flex: 1; 
    display: flex; 
    justify-content: center; 
    position: relative; 
}

/* --- BOUTONS D'ACTION (LOOK ÉPURÉ) --- */
.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; 
    
    /* --- COULEUR DE FOND PLUS FONCÉE --- */
    /* #e4e6eb est le gris officiel des boutons secondaires FB */
    background-color: #e4e6eb !important; 
    
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    
    /* --- FORME PLUS ARRONDIE --- */
    padding: 8px 0;
    border-radius: 20px; /* 8px donne l'effet rectangle doux moderne */
    
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    
    /* Texte */
    color: #4b4c4f; /* Texte noir/gris foncé pour le contraste */
    font-weight: 600;
	
	/* --- AJOUT CRUCIAL POUR LE CLIC --- */
    position: relative; 
    z-index: 1 !important; /* On passe de 5001 à 1. Suffisant pour être cliquable, mais reste sous les modales. */
}

/* --- CORRECTIF CLIC J'AIME (COMMENTAIRES) --- */
.reaction-trigger {
    position: relative;
    z-index: 1 !important; /* Idem pour les commentaires : 1 au lieu de 5001 */
}

/* Effet au survol (Encore un peu plus foncé) */
.action-btn:hover {
    background-color: #d8dadf !important; 
}

/* Effet au clic */
.action-btn:active {
    transform: scale(0.97);
    background-color: #ced0d4 !important;
}



/* 1. GROSSIR LES ICÔNES GRISES (Like, Comment, Share) */
.action-btn i {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    color: inherit; 
}

/* 2. STYLE DU CHIFFRE (COMPTE) */
.action-btn span {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    /* IMPORTANT : On force la couleur ici pour qu'elle ne change jamais */
    color: #4b4c4f !important; 
}

/* 3. AJUSTEMENT EMOJI NATIF (Quand on a liké) */
.react-icon-native {
    font-size: 1.5rem !important; /* Même taille que les icônes grises */
    line-height: 1;
    vertical-align: middle;
}

/* --- MODE SOMBRE (DARK MODE) --- */
[data-theme="dark"] .interaction-bar {
    border-top-color: #3e4042;
}

/* Fond des boutons en gris moyen pour le mode sombre */
[data-theme="dark"] .action-btn {
    background-color: #3a3b3c !important; 
    color: #b0b3b8; /* Texte/Icone gris clair par défaut */
}

[data-theme="dark"] .action-btn:hover {
    background-color: #4e4f50 !important;
}

/* Active Like en mode sombre */
[data-theme="dark"] .action-btn.active-like {
    background-color: rgba(45, 136, 255, 0.25) !important;
}
/* Important : L'icône devient bleue en mode sombre */
[data-theme="dark"] .action-btn.active-like i {
    color: #2d88ff !important;
}
/* Important : Le chiffre reste gris en mode sombre */
[data-theme="dark"] .action-btn span {
    color: #b0b3b8 !important;
}

/* --- MODE CLAIR (ACTIVE LIKE) --- */
/* On garde un fond teinté mais plus visible */
.action-btn.active-like { 
    background-color: #e7f3ff !important; /* Fond bleu pâle */
}
/* On cible l'icône I pour la mettre en BLEU */
.action-btn.active-like i {
    color: #1877f2 !important; 
}
/* Le chiffre reste gris foncé (Force la couleur pour ne pas devenir bleu) */
.action-btn span {
    color: #4b4c4f !important;
}
.action-btn.active-love { background-color: #fadbe0 !important; }
.action-btn.active-care { background-color: #fcf1ce !important; }
.action-btn.active-haha { background-color: #fcf1ce !important; }
.action-btn.active-wow  { background-color: #fcf1ce !important; }
.action-btn.active-sad  { background-color: #fcf1ce !important; }
.action-btn.active-angry{ background-color: #fcebd9 !important; }


/* 3. Menu Réactions (Caché & Centré) */

/* 1. LA BOÎTE PRINCIPALE */
/* BOÎTE DE RÉACTIONS UNIFIÉE (Post + Commentaires) */
.reactions-box {
    display: none; /* Caché par défaut */
    position: absolute;
    
    /* Style Visuel */
    background: white;
    border-radius: 20px;
    padding: 8px 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid #ddd;
    z-index: 1500;
    
    /* Dimensions et Grille (2 Lignes) */
    width: 220px;
    grid-template-columns: repeat(12, 1fr);
    row-gap: 8px;
}

/* --- GESTION INTELLIGENTE DU MENU RÉACTION --- */

/* 1. Sur PC (Souris) : On ouvre au survol */
@media (hover: hover) {
    .reaction-container:hover .reactions-box { 
        display: grid !important; 
        animation: popInCentered 0.2s ease-out forwards; 
    }
}

/* 2. Sur Mobile : On n'ouvre QUE si la classe .show est ajoutée par le JS (Appui long) */
.reactions-box.show {
    display: grid !important;
    animation: popInCentered 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Par défaut, c'est caché */
.reactions-box {
    display: none;
}

/* CLASSE ACTIVE (Ajoutée par le JS pour afficher) */
.reactions-box.show {
    display: grid !important; /* Devient une grille quand affiché */
    animation: popInCentered 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 2. LE PONT INVISIBLE (Zone de survol) */
.reactions-box::after {
    content: '';
    position: absolute;
    top: 100%; 
    left: 0; 
    width: 100%;
    height: 25px; /* Suffisamment haut pour toucher le bouton */
    background: transparent;
    /* On a ENLEVÉ 'pointer-events: none' pour que le menu reste ouvert */
}

/* 3. LES ITEMS (COLONNES) */
.reaction-option-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    
    /* Par défaut (Ligne du bas) : prend 3 colonnes sur 12 (donc 4 items par ligne) */
    grid-column: span 3; 
}

/* ASTUCE : Les 3 premiers items (Ligne du haut) prennent 4 colonnes sur 12 (donc 3 items par ligne) */
.reaction-option-col:nth-child(-n+3) {
    grid-column: span 4;
}

.reaction-option-col:hover {
    transform: scale(1.3) translateY(-5px); /* Gros zoom au survol */
}

/* 4. L'EMOJI */
.reaction-option-col .react-icon-anim {
    font-size: 1.8rem !important;
    line-height: 1;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

/* 5. LE PETIT TEXTE */
.react-label-text {
    font-size: 0.6rem; /* Très petit */
    color: #65676b;
    font-weight: 700;
    line-height: 1;
    
    /* Rapproche le texte de l'emoji */
    margin-top: -2px; 
    
    /* Sécurité pour que le texte ne casse pas la ligne */
    white-space: nowrap;
}

    /* GESTION SURVOL PC (Souris) */
/* Important : on met display: grid pour respecter la mise en page 3 haut / 4 bas */
@media (hover: hover) {
    .reaction-container:hover .reactions-box { 
        display: grid; 
        animation: popInCentered 0.2s ease-out forwards; 
    }
}

/* DÉFINITION DE L'ANIMATION (Indispensable) */
@keyframes popInCentered {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.8); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}


/* 4. Styles pour la Modale "Qui a liké" (Conservés) */
.react-tabs { display: flex; border-bottom: 1px solid #eee; margin-bottom: 10px; overflow-x: auto; }
.react-tab { padding: 10px 15px; cursor: pointer; font-weight: 600; color: #65676b; border-bottom: 3px solid transparent; white-space: nowrap; }
.react-tab.active { color: var(--fb-blue); border-bottom-color: var(--fb-blue); }
.react-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.react-item { font-size: 32px; cursor: pointer; transition: transform 0.2s ease; display: inline-block; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2)); }
.react-item:hover { transform: scale(1.35) translateY(-5px); }

/* Mode Sombre spécifique pour ces éléments */
[data-theme="dark"] .interaction-bar, 
[data-theme="dark"] .reactions-box { background-color: var(--fb-card-bg); border-color: var(--fb-border); }
[data-theme="dark"] .action-btn { background-color: #3a3b3c; color: #b0b3b8; }
[data-theme="dark"] .action-btn:hover { background-color: #4e4f50; }
[data-theme="dark"] .action-btn.active-like { background: rgba(24, 119, 242, 0.2); }

.comments-section { padding: 8px 16px; }
.bubble-container { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 0; }
.bubble { background: #f0f2f5; border-radius: 18px; padding: 8px 12px; font-size: 0.9rem; width: fit-content; max-width: 85%; line-height: 1.3; }
.bubble b { color: #050505; font-weight: 600; cursor: pointer; }
.c-actions { font-size: 0.75rem; color: var(--fb-gray); margin-left: 12px; margin-top: 6px; display: flex; gap: 12px; font-weight: bold; }
.c-actions span { cursor: pointer; user-select: none; }
.c-actions span:hover { text-decoration: underline; }
.c-time { font-weight: normal; color: #65676b; cursor: default !important; text-decoration: none !important; margin-right: 2px; }
.c-react-pill { display: flex; align-items: center; gap: 2px; background: white; border-radius: 10px; padding: 2px 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); border: 1px solid #eee; margin-left: auto; cursor: pointer; }
.replies-wrapper { margin-left: 48px; border-left: 2px solid #ddd; padding-left: 8px; margin-top: 5px; }
.view-more-comments, .view-replies-btn { margin-left: 48px; color: var(--fb-gray); font-weight: 600; font-size: 0.85rem; cursor: pointer; margin-bottom: 8px; }
.comment-filter-container { padding: 0 16px 8px; display: flex; justify-content: flex-end; position: relative; }
.filter-btn { background: none; border: none; font-weight: 600; color: var(--fb-gray); cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 5px; }
.filter-menu { position: absolute; right: 16px; top: 30px; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: none; z-index: 1500; width: 200px; border: 1px solid #ddd; overflow: hidden; text-align: left; }
.filter-menu button { width: 100%; text-align: left; background: none; border: none; padding: 10px 15px; cursor: pointer; font-size: 0.9rem; }
.filter-menu button:hover { background: #f2f2f2; }
.comment-input-area { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid #ddd; }
.comment-field { background: #f0f2f5; border-radius: 20px; padding: 8px 12px; flex-grow: 1; display: flex; align-items: center; }
.comment-field input { border: none; background: none; outline: none; width: 100%; font-size: 0.95rem; color: #1c1e21; }
.btn-send { color: var(--fb-blue); background: none; border: none; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: 50%; transition: background 0.2s; }
.options-container { position: relative; }
.btn-options { background: none; border: none; color: var(--fb-gray); cursor: pointer; padding: 8px; border-radius: 50%; font-size: 1.1rem; }
.options-menu { position: absolute; right: 0; top: 35px; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: none; z-index: 2000; width: 180px; border: 1px solid #ddd; overflow: hidden; }
.options-menu button { width: 100%; text-align: left; background: none; border: none; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #f0f2f5; font-size: 0.9rem; transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.options-menu button:hover { background: #f2f2f2; }
.anim-like:hover { animation: bounce 0.4s infinite alternate; }
.anim-love:hover { animation: heartbeat 0.8s infinite; }
.anim-haha:hover { animation: laugh 0.6s infinite; }
.anim-wow:hover { transform: scale(1.4); }
.anim-sad:hover { animation: bob 1.5s infinite; }
.anim-angry:hover { animation: shake 0.3s infinite; }
.active-like { color: #1877f2 !important; } .active-love { color: #f33e58 !important; } .active-care { color: #f7b928 !important; }
.active-haha { color: #f7b928 !important; } .active-wow { color: #f7b928 !important; } .active-sad { color: #f7b928 !important; } .active-angry { color: #e9710f !important; }

/* --- GROUPES (NOUVEAU) --- */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.group-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s;
}
.group-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.group-card-cover {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: #eee;
}
.group-card-info { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.group-card-name { font-weight: bold; font-size: 1rem; margin-bottom: 5px; color: #050505; }
.group-card-members { font-size: 0.85rem; color: #65676b; margin-bottom: 10px; }
.group-card-btn {
    margin-top: auto;
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: #e7f3ff;
    color: var(--fb-blue);
}
.group-card-btn:hover { background: #dbe7f2; }
.btn-join { background: var(--fb-blue); color: white; border: none; padding: 8px 16px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-join:hover { background: #166fe5; }
.btn-invite { background: #e4e6eb; color: #050505; border: none; padding: 8px 16px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-invite:hover { background: #d8dadf; }

.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.6); z-index: 20000; display: none; align-items: center; justify-content: center; animation: fadeIn 0.2s; }
.modal-card { background: white; width: 500px; max-width: 95%; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); display: flex; flex-direction: column; border: 1px solid #ddd; animation: scaleUp 0.2s; }
.m-head { padding: 15px; border-bottom: 1px solid #eee; font-weight: bold; font-size: 1.1rem; text-align: center; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; color: #1c1e21; }
.modal-body-scroll { overflow-y: auto; padding: 15px; flex: 1; color: #1c1e21; }
.m-foot { padding: 10px 15px; text-align: right; background: #fff; border-top: 1px solid #eee; flex-shrink: 0; }
.alert-body { padding: 20px; text-align: center; font-size: 1rem; color: #333; }
.btn-modal { padding: 8px 25px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: var(--fb-blue); color: white; }
.btn-secondary { background: #e4e6eb; color: #050505; margin-right: 10px; }
.share-textarea { width: 95%; height: 60px; border: none; outline: none; font-size: 1.1rem; font-family: inherit; margin-bottom: 10px; resize: none; }
.share-preview { border: 1px solid #ddd; border-radius: 8px; padding: 10px; background: #f9f9f9; }
.share-socials { display: flex; gap: 20px; justify-content: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }
.social-icon { font-size: 1.8rem; cursor: pointer; transition: transform 0.2s; }
.social-icon:hover { transform: scale(1.1); }
.mood-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mood-option { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.mood-option:hover { background: #f0f2f5; }
.selected-mood-tag { display: inline-flex; align-items: center; gap: 5px; background: #e7f3ff; color: var(--fb-blue); padding: 5px 10px; border-radius: 15px; margin-left: 10px; font-size: 0.9rem; font-weight: bold; cursor: pointer; }

/* ======================================================= */
/*      CHAT SYSTEM (MULTI-FENETRES & BULLES)              */
/* ======================================================= */
#chats-wrapper { position: fixed; bottom: 0; right: 90px; display: flex; align-items: flex-end; gap: 15px; z-index: 5000; pointer-events: none; }
#bubbles-container { position: fixed; bottom: 100px; right: 20px; display: flex; flex-direction: column-reverse; gap: 10px; z-index: 5001; pointer-events: auto; }
.chat-window { width: 330px; height: 455px; background: white; border-radius: 8px 8px 0 0; box-shadow: 0 4px 20px rgba(0,0,0,0.15); display: flex; flex-direction: column; border: 1px solid #ddd; border-bottom: none; pointer-events: auto; }
.chat-bubble-minimized { width: 50px; height: 50px; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.3); background-size: cover; background-position: center; border: 2px solid white; position: relative; }
.chat-bubble-minimized:hover { transform: scale(1.05); }
.bubble-online-dot { width: 12px; height: 12px; background: #31a24c; border: 2px solid white; border-radius: 50%; position: absolute; bottom: 0; right: 0; }
.bubble-badge-counter { position: absolute; top: -5px; right: -5px; background: #e41e3f; color: white; font-size: 0.75rem; padding: 2px 6px; border-radius: 10px; border: 2px solid white; font-weight: bold; z-index: 10; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* CHAT HEADER & BODY */
.chat-header { padding: 8px 12px; background: white; border-bottom: 1px solid #eee; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.chat-header:hover { background: #f9f9f9; }
.chat-user-info { display: flex; align-items: center; gap: 8px; font-weight: bold; color: #050505; font-size: 0.95rem; }
.chat-controls i { color: var(--fb-blue); font-size: 1.1rem; cursor: pointer; margin-left: 8px; }
.chat-body { flex: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; background: white; }
.status-text-header { font-size: 0.75rem; color: #65676b; font-weight: normal; }

/* CHAT MESSAGES & BUBBLES */
/* Un petit espace de base pour tous les messages */
.msg-container { position: relative; display: flex; flex-direction: column; max-width: 65%; margin-bottom: 4px; }

/* 🔴 NOUVEAU : Espace plus grand si l'expéditeur change */
.msg-container.me + .msg-container.them,
.msg-container.them + .msg-container.me {
    margin-top: 15px;
}
.msg-container.me { align-self: flex-end; align-items: flex-end; }
.msg-container.them { align-self: flex-start; align-items: flex-start; }
.chat-bubble { max-width: 100%; position: relative; padding: 8px 12px; font-size: 0.9rem; border-radius: 18px; line-height: 1.3; word-wrap: break-word; }
.chat-bubble.image-mode { background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.msg-me { background: var(--fb-blue); color: white; border-bottom-right-radius: 4px; }
.msg-them { background: #f0f2f5; color: #050505; border-bottom-left-radius: 4px; }
.msg-time { font-size: 0.65rem; margin-top: 2px; opacity: 0.7; text-align: right; }
.chat-image { max-width: 100%; border-radius: 12px; margin-top: 5px; cursor: pointer; }
.chat-audio { width: 180px; margin-top: 5px; }

/* --- CORRECTION SCROLLBAR HORIZONTALE CHAT --- */

.chat-body {
    overflow-x: hidden !important; /* Interdit le scroll horizontal */
    overflow-y: auto;              /* Autorise le scroll vertical */
    
    /* Sécurité pour que le texte revienne à la ligne */
    word-wrap: break-word;
}

/* Sécurité supplémentaire pour les bulles */
.chat-bubble {
    word-break: break-word; /* Coupe les mots trop longs qui forcent le scroll */
    max-width: 100%;        /* Ne dépasse jamais le conteneur */
}

/* --- CHAT ACTIONS (MENU 3 POINTS) - AVEC PONT INVISIBLE --- */

/* --- CHAT ACTIONS (MENU 3 POINTS) --- */

.msg-actions-group { 
    position: absolute; 
    top: 50%; 
    /* Ajustement vertical : on ajoute 5px vers le bas au calcul du centre */
    transform: translateY(-30%) translateY(5px); 
    
    /* IMPORTANT : Caché par défaut */
    display: none; 
    
    gap: 5px; 
    z-index: 100; 
    align-items: center;

    /* Le pont invisible (Zone de survol élargie) */
    padding: 20px; 
    
    /* Compensation des marges pour ne pas décaler le layout */
    /* Haut Droite Bas Gauche */
    margin: -20px; 
}

/* APPARITION : Au survol OU si le menu est actif */
.msg-container:hover .msg-actions-group,
.msg-actions-group.active { 
    display: flex; 
}

/* Position pour MES messages (Boutons à gauche) */
.msg-container.me .msg-actions-group { 
    right: 100%; 
    flex-direction: row;
    margin-right: -5px; /* Petit ajustement horizontal pour coller à la bulle */
}

/* Position pour LEURS messages (Boutons à droite) */
.msg-container.them .msg-actions-group { 
    left: 100%; 
    flex-direction: row-reverse;
    margin-left: -5px; /* Petit ajustement horizontal */
}

/* Style des boutons (inchangé mais ajusté pour la taille) */
.chat-action-btn { 
    width: 24px;        
    height: 24px;       
    border-radius: 50%; 
    background: white;  
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: #65676b; 
    font-size: 0.8rem; 
    border: 1px solid #ddd; 
    transition: 0.2s; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0; /* Empêche l'écrasement */
}

.chat-action-btn:hover { 
    background: #f0f2f5; 
    color: #1877f2; 
    transform: scale(1.1);
}

/* Menu déroulant */
.chat-dropdown-menu { 
    position: absolute; 
    background: white; border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    width: 130px; z-index: 5000; overflow: visible; /* Important pour le pont invisible */
    display: none; text-align: left; 
    bottom: 100%; /* Juste au dessus */
    margin-bottom: 8px; /* L'espace visuel */
}

/* LE PONT INVISIBLE (Empêche le menu de disparaître quand on bouge la souris) */
.chat-dropdown-menu::after {
    content: '';
    position: absolute;
    top: 100%; /* En bas du menu */
    left: 0;
    width: 100%;
    height: 10px; /* Hauteur du pont (doit couvrir le margin-bottom) */
    background: transparent;
}

/* Ajustement latéral */
.msg-container.me .chat-dropdown-menu { right: 0; }
.msg-container.them .chat-dropdown-menu { left: 0; }

.chat-dropdown-item { padding: 10px 14px; font-size: 0.85rem; cursor: pointer; color: #050505; font-weight: 500; }
.chat-dropdown-item:hover { background: #f2f2f2; }
.chat-dropdown-item.delete { color: #e41e3f; }

/* --- TYPING INDICATOR (POINT 1) --- */
.typing-indicator { 
    background: #e4e6eb; padding: 8px 12px; border-radius: 18px; 
    width: fit-content; margin-bottom: 5px; 
    margin-left: 10px; align-self: flex-start;
    display: none; /* Géré par JS */
    min-height: 20px; /* Assure une hauteur visible */
}
/* Le reste des animations typing reste inchangé */

/* STATUS & PREVIEWS */
.msg-meta-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; }
.msg-edited-tag { font-size: 0.65rem; opacity: 0.6; font-style: italic; }
.msg-sent-check { font-size: 0.7rem; color: rgba(255,255,255,0.8); }
.msg-me .msg-sent-check { color: rgba(255,255,255,0.8); }
.msg-deleted-text { font-style: italic; color: #65676b !important; border: 1px solid #ddd; background: white !important; }
.reply-preview-bar { background: #f0f2f5; padding: 8px 12px; border-top: 1px solid #eee; display: none; justify-content: space-between; align-items: center; font-size: 0.85rem; border-left: 4px solid var(--fb-blue); }
.reply-preview-content { display: flex; flex-direction: column; overflow: hidden; }
.reply-to-name { font-weight: bold; font-size: 0.8rem; color: var(--fb-blue); }
.reply-to-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #65676b; max-width: 200px; }
.msg-quote { background: rgba(0,0,0,0.05); border-left: 3px solid rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 4px; margin-bottom: 4px; font-size: 0.8rem; display: flex; flex-direction: column; cursor: pointer; }
.msg-me .msg-quote { background: rgba(255,255,255,0.2); border-left-color: rgba(255,255,255,0.5); }
/* --- CORRECTION BULLE "VU" --- */
.seen-container {
    display: flex;
    justify-content: flex-end;
    /* On met une marge POSITIVE pour descendre la bulle */
    margin-top: 4px !important;  
    margin-bottom: 8px;
    padding-right: 5px;
    width: 100%;
}

.seen-avatar {
    width: 16px; /* Un tout petit peu plus grand */
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* --- CORRECTION TYPING MOBILE --- */
#mobile-typing-indicator {
    background-color: #f0f2f5;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-top: 10px;
    margin-left: 5px;
    margin-bottom: 5px;
    display: none; /* Important : caché par défaut */
    align-self: flex-start;
}

/* CHAT FOOTER & INPUT */
.chat-footer { padding: 8px 8px; display: flex; align-items: flex-end; gap: 6px; border-top: 1px solid #eee; background: white; }
.chat-tools-left { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.btn-chat-tool { color: var(--fb-blue); background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 6px; border-radius: 50%; }
.btn-chat-tool:hover { background: #f0f2f5; }
.chat-input-wrapper { flex: 1; background: #f0f2f5; border-radius: 20px; display: flex; align-items: center; padding: 6px 10px; min-width: 0; }
.chat-input { width: 100%; background: transparent; border: none; outline: none; font-size: 0.9rem; max-height: 80px; resize: none; font-family: inherit; min-width: 0; }
.btn-emoji { color: var(--fb-blue); cursor: pointer; font-size: 1.1rem; margin-left: 5px; } 
.btn-chat-send { color: var(--fb-blue); background: none; border: none; cursor: pointer; font-size: 1.2rem; margin-left: 2px; }

/* TYPING & EMPTY STATE */
.typing-indicator { background: #e4e6eb; padding: 8px 12px; border-radius: 18px; width: fit-content; margin-bottom: 5px; display: none; margin-left: 10px; align-self: flex-start; }
.typing-dots { display: flex; gap: 3px; }
.typing-dot { width: 6px; height: 6px; background: #65676b; border-radius: 50%; animation: typingBounce 1.4s infinite ease-in-out both; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; } .typing-dot:nth-child(2) { animation-delay: -0.16s; }
.empty-chat-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #bec2c9; text-align: center; padding: 20px; }
.empty-chat-icon { font-size: 3rem; margin-bottom: 10px; opacity: 0.5; }
.empty-chat-text { font-size: 0.9rem; font-weight: 600; }
.wave-hand { animation: wave 1.5s infinite; display: inline-block; }

@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { transform: scale(0.9); } to { transform: scale(1); } }
@keyframes wave { 0% { transform: rotate(0deg); } 20% { transform: rotate(-15deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-15deg); } 100% { transform: rotate(0deg); } }

/* --- NOUVELLES RÉACTIONS ANIMÉES (STYLE FACEBOOK 3D) --- */

/* L'image dans le menu de sélection (Gros et animé) */
.react-icon-anim {
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: contain;
}
.react-icon-anim:hover {
    transform: scale(1.3) translateY(-10px);
}

/* L'image une fois sélectionnée (Petit bouton sous le post) */
.react-icon-small {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 5px;
}

/* L'image dans la petite pile de stats (les bulles) */
.react-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- MENU EMOJI PERSONNALISÉ --- */
.custom-emoji-popup {
    position: absolute;
    bottom: 50px; /* Juste au-dessus du footer */
    right: 5px;
    width: 250px;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
    display: none; /* Caché par défaut */
    grid-template-columns: repeat(6, 1fr); /* 6 emojis par ligne */
    gap: 2px;
    z-index: 2000;
}

.custom-emoji-popup.active {
    display: grid;
}

.emoji-btn {
    font-size: 1.2rem;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
}

.emoji-btn:hover {
    background-color: #f0f2f5;
    transform: scale(1.2);
}

/* --- REACTION MESSAGES (STYLE WHATSAPP/MESSENGER) --- */
.message-react-popup {
    position: absolute;
    bottom: 30px; /* Au dessus du message */
    right: 0;     /* Alignement par défaut */
    background: white;
    padding: 5px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: none;
    gap: 5px;
    z-index: 200;
    width: 260px; /* Largeur pour afficher une ligne d'emojis */
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid #eee;
}

.message-react-popup.active {
    display: flex;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.msg-container.them .message-react-popup { left: 0; right: auto; } /* Menu à gauche pour les amis */

.msg-react-btn {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 2px;
}
.msg-react-btn:hover { transform: scale(1.3); }

/* La petite bulle qui reste collée au message */
.msg-reaction-badge {
    position: absolute;
    bottom: -8px; /* Un peu plus haut */
    right: 5px;
    background: white;
    border-radius: 5px; /* Arrondi plus serré */
    padding: 1px 1px;    /* Plus petit padding */
    font-size: 0.75rem;  /* Texte plus petit */
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    border: 1px solid #fff;
    cursor: pointer;
    display: none; 
    z-index: 5;
}
.msg-container.them .msg-reaction-badge { right: auto; left: 5px; }

/* Style pour la vidéo dans le chat */
.chat-video {
    max-width: 100%;     /* Ne dépasse pas la bulle */
    width: 220px;        /* Largeur idéale */
    border-radius: 12px;
    margin-top: 5px;
    background: black;   /* Fond noir si la vidéo charge */
    display: block;
}

/* Style Plyr dans le chat */
.chat-bubble .plyr {
    width: 240px;          /* Largeur fixe pour le chat */
    max-width: 100%;
    border-radius: 12px;   /* Arrondis comme la bulle */
    margin-top: 5px;
    overflow: hidden;      /* Important pour que la vidéo ne dépasse pas des arrondis */
}

/* On cache les gros contrôles inutiles dans le chat */
.chat-bubble .plyr__controls {
    padding: 5px;
}

/* style.css */
@keyframes notifBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.anim-bounce i {
    animation: notifBounce 0.3s ease-in-out;
    color: var(--fb-blue); /* L'icône change brièvement de couleur */
}

/* ======================================================= */
/*                     STORIES (STYLE FACEBOOK)            */
/* ======================================================= */

/* Le conteneur horizontal */
.stories-tray {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: none; /* Cache scrollbar Firefox */
    background: transparent;
    margin-bottom: 10px;
    height: 200px; /* Hauteur fixe pour les cartes */
}
.stories-tray::-webkit-scrollbar { display: none; }

/* --- CARTE GÉNÉRALE --- */
.story-card {
    position: relative;
    width: 112px;       /* Largeur typique FB Desktop */
    height: 190px;      /* Hauteur typique */
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;     /* Empêche l'écrasement */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    background: #000;   /* Fond noir par défaut */
}

.story-card:hover {
    transform: scale(1.02); /* Léger zoom au survol */
}

/* L'image ou vidéo de fond de la story */
.story-bg-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    opacity: 0.9;
    pointer-events: none; /* <--- DÉJÀ PRÉSENT */
}
.story-card:hover .story-bg-media {
    transform: scale(1.05); /* Zoom sur l'image interne */
}

/* Overlay sombre pour lire le texte en bas */
.story-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

/* --- CARTE "CRÉER UNE STORY" (SPÉCIFIQUE) --- */
.story-card.create-card {
    background: white;
    border: 1px solid #ddd;
}

.create-card-img {
    width: 100%;
    height: 65%; /* L'image prend le haut */
    object-fit: cover;
    transition: transform 0.3s;
    pointer-events: none; /* <--- DÉJÀ PRÉSENT */
}
.story-card:hover .create-card-img {
    transform: scale(1.05);
}

.create-card-footer {
    height: 35%;
    background: white;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Changé de 'flex-end' à 'center' */
    align-items: center;
    padding-top: 20px;       /* Ajouté pour laisser de la place au bouton */
    padding-bottom: 0;       /* Enlevé */
    pointer-events: none;
}

.create-btn-circle {
    position: absolute;
    top: -20px; /* Chevauche l'image et le footer */
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: var(--fb-blue);
    border: 4px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.create-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #050505;
}

/* --- CARTE AMIS --- */
/* La petite photo de profil en haut à gauche */
.story-profile-pic {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid var(--fb-blue); /* Bordure Bleue = Non vu */
    z-index: 10;
    overflow: hidden;
    background: #eee;
    pointer-events: none; /* <--- DÉJÀ PRÉSENT */
}

/* Bordure grise si déjà vu */
.story-card.seen .story-profile-pic {
    border-color: #ddd;
}

.story-profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nom de l'ami en bas */
.story-name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none; /* <--- DÉJÀ PRÉSENT */
}

/* --- VISUALISEUR (MODALE) --- */
.story-viewer-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    
    /* MODIFICATION CLÉ : 100dvh s'adapte à la barre d'adresse mobile */
    height: 100dvh; 
    
    background: black;
    z-index: 50000; /* Très haut */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Empêche le scroll si l'image dépasse */
}

/* NOUVEAU : Arrière-plan flouté (Style Facebook) */
/* (Nécessite la div <div id="story-bg-blur" class="story-blurred-bg"></div> dans le HTML) */
.story-blurred-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.6); /* Flou + Assombrissement */
    z-index: 1; /* Tout au fond */
    transform: scale(1.1); /* Zoom léger pour éviter les bords blancs du flou */
}

/* Barres de progression */
.story-progress-container {
    display: flex;
    gap: 4px;
    padding: 10px 10px 5px;
    width: 100%;
    box-sizing: border-box;
    
    /* MODIF : Au-dessus du flou et de l'image */
    z-index: 20; 
    position: relative;
}
.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5); /* Meilleure visibilité */
}
.story-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    /* Transition gérée en JS */
}

/* Info Header (User) */
.story-header-info {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
    
    /* MODIF : Au-dessus de tout pour être cliquable */
    z-index: 20; 
    position: relative; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.8); /* Lisibilité sur fond clair */
}
.story-header-info img { 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    border: 1px solid rgba(255,255,255,0.5); /* Petit contour propre */
}

/* 2. LE CADRE DE LA STORY (AVEC FOND FLOUTÉ) */
.story-content-area {
    position: relative;
    width: 100%;
    height: 100%;
    
    /* PC : Format Portrait */
    max-width: 450px; 
    aspect-ratio: 9 / 16;
    
    /* On enlève le fond noir dur */
    /* background: #000;  <-- SUPPRIMÉ */
    
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    display: block;
}

/* LE FOND FLOUTÉ MAGIQUE */
.story-content-area::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    
    /* L'image sera injectée via une variable CSS par le JS */
    background-image: var(--story-bg);
    background-size: cover;     /* Remplit tout l'espace */
    background-position: center;
    
    /* LE FLOU */
    filter: blur(20px) brightness(0.7); /* Flou + Assombrissement pour le contraste */
    transform: scale(1.1); /* Zoom léger pour éviter les bords blancs du flou */
    
    z-index: 0; /* Tout au fond */
}

/* 3. LA VIDÉO (PAR DESSUS LE FLOU) */
.story-content-area img,
.story-content-area video,
.story-content-area .plyr,
.story-content-area .plyr__video-wrapper {
    position: absolute !important;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    
    /* Contain = Affiche tout sans couper (laisse voir le fond flouté sur les côtés) */
    object-fit: contain !important; 
    
    z-index: 1; /* Devant le fond flouté */
    background: transparent !important; /* Important : Fond transparent pour voir le flou */
}

/* Mobile : On garde le plein écran */
@media (max-width: 768px) {
    .story-content-area {
        max-width: 100%;
        width: 100vw;
        height: 100vh;
        aspect-ratio: unset;
        border-radius: 0;
    }
	
	/* 1. CACHER LES BOUTONS PC (3 POINTS) SUR MOBILE */
    /* On force le masquage des boutons flottants qui apparaissent au survol sur PC */
    .msg-actions-group {
        display: none !important;
    }

    /* 2. EMPÊCHER LA SÉLECTION DE TEXTE LORS DE L'APPUI LONG */
    .chat-bubble {
        /* Empêche le surlignage bleu du texte */
        -webkit-user-select: none; 
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        
        /* Empêche le menu contextuel natif (loupe/copier) sur iOS/Android */
        -webkit-touch-callout: none; 
    }
}

#story-view-img, #story-view-video {
    /* MODIF : Dimensions max mais respectant le ratio */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    
    /* C'est ça qui fait que l'image n'est jamais coupée */
    object-fit: contain; 
    
    /* Ombre pour détacher l'image du fond flouté */
    box-shadow: 0 0 30px rgba(0,0,0,0.5); 
}

/* Navigation tactile (gauche/droite invisible) */
.story-nav-left, .story-nav-right {
    position: absolute;
    top: 0; bottom: 0;
    width: 30%; /* 30% de l'écran pour cliquer */
    z-index: 10;
}
.story-nav-left { left: 0; }
.story-nav-right { right: 0; }

/* Stats footer */
.story-footer-stats {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
}

/* --- NAVIGATION STORIES (FLÈCHES) --- */
.stories-wrapper {
    position: relative; /* Pour positionner les boutons en absolu par rapport à ceci */
    width: 100%;
}

.story-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
    color: #65676b;
    font-size: 1.2rem;
}

.story-scroll-btn:hover {
    background-color: #f0f2f5;
    color: #1c1e21;
    transform: translateY(-50%) scale(1.1); /* Petit zoom au survol */
}

.story-scroll-btn.left {
    left: 10px;
}

.story-scroll-btn.right {
    right: 10px;
}

/* Ajustement du rail pour le scroll fluide */
.stories-tray {
    scroll-behavior: smooth; /* Animation de scroll native */
    padding-left: 5px;       /* Petit espace */
    padding-right: 5px;
}

.story-footer-stats {
    /* ... vos styles existants ... */
    cursor: pointer; /* Indique que c'est cliquable */
    transition: opacity 0.2s;
}

.story-footer-stats:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Barre de réactions en bas (CENTRÉE) */
.story-reactions-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;                  /* 1. On pousse le bord gauche à 50% de l'écran */
    transform: translateX(-50%); /* 2. On recule de 50% de sa propre largeur pour centrer parfaitement */
    display: flex;
    gap: 8px;                   /* Espacement légèrement réduit pour bien tenir sur mobile */
    z-index: 30;
    width: max-content;         /* La largeur s'adapte au contenu */
}

/* Si c'est MA story, on cache la barre (géré en JS), sinon on l'affiche */

.story-react-btn {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.story-react-btn:hover {
    transform: scale(1.3) translateY(-5px);
}
.story-react-btn img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Animation flottante (Emoji dans les Stories) */
.floating-reaction {
    position: absolute;
    bottom: 80px; 
    left: 50%;
    
    /* C'est du texte maintenant ! */
    font-size: 3.5rem; 
    line-height: 1;
    color: inherit;
    
    z-index: 1000; 
    pointer-events: none;
    
    /* Animation */
    animation: floatUpFade 2s ease-out forwards;
    
    /* Ombre pour être visible sur fond blanc ou noir */
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

@keyframes floatUpFade { 
    0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 0; } 
    10% { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1.2); } 
    100% { transform: translateX(-50%) translateY(-400px) scale(1); opacity: 0; } 
}

/* 2. Petits émojis dans la liste des spectateurs */
.viewer-react-emoji {
    font-size: 1.2rem; /* Taille de l'émoji */
    line-height: 1;
    display: inline-block;
}

/* Affichage des réactions dans la liste spectateurs */
.viewer-reactions {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}
/* Affichage des réactions dans la liste spectateurs (TEXTE) */
.viewer-react-icon {
    font-size: 1.2rem; /* Taille de l'émoji */
    line-height: 1;
    margin-left: 2px;
    display: inline-block;
    /* On enlève width/height qui déforment le texte */
}

/* Ajustement du conteneur pour que ça reste aligné avec le texte */
.viewer-reactions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 5px; /* Petit espace après le nom */
}

/* DANS style.css */

.group-tab {
    padding-bottom: 10px;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
}

.group-tab.active-tab {
    color: var(--fb-blue);
    border-bottom: 3px solid var(--fb-blue);
}

.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}

/* --- AJUSTEMENT LARGEUR GROUPE & PAGE --- */
/* On garde la couverture large, mais on restreint le contenu en dessous */
#group-post-box, 
#group-feed, 
#group-members-view,
#page-post-box,  /* NOUVEAU */
#page-feed       /* NOUVEAU */
{
    max-width: 580px; /* Largeur standard du fil d'actualité */
    margin-left: auto; /* Centrage horizontal */
    margin-right: auto; /* Centrage horizontal */
}

/* --- REELS CONTAINER --- */
.reels-scroll-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory; /* L'effet magnétique */
    background: #000;
    position: relative;
    border-radius: 8px; /* Optionnel sur desktop */
}

/* Cache la scrollbar pour l'immersion */
.reels-scroll-container::-webkit-scrollbar { display: none; }

/* UN REEL UNIQUE */
.reel-item {
    width: 100%;
    height: 100%;
    scroll-snap-align: start; /* S'aligne parfaitement */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
}

/* LA VIDÉO */
.reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit l'écran (comme TikTok) */
    max-width: 500px;  /* Sur grand écran, on limite la largeur pour pas déformer */
}

/* OVERLAY (Infos en bas à gauche) */
.reel-info-overlay {
    position: absolute;
    bottom: 20px;
    left: 10px;
    width: 70%;
    z-index: 10;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    pointer-events: none; /* Laisse passer les clics vers la vidéo */
}
.reel-author-pic { width: 36px; height: 36px; border-radius: 50%; border: 2px solid white; margin-right: 8px; vertical-align: middle; }
.reel-author-name { font-weight: bold; font-size: 1rem; cursor: pointer; pointer-events: auto; }
.reel-description { font-size: 0.9rem; margin-top: 5px; line-height: 1.3; }

/* BARRE D'ACTION (À droite verticale) */
.reel-actions-bar {
    position: absolute;
    bottom: 20px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.reel-action-btn {
    color: white;
    text-align: center;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.reel-action-btn:hover { transform: scale(1.1); }
.reel-action-btn i { font-size: 1.8rem; display: block; margin-bottom: 5px; }
.reel-action-btn span { font-size: 0.8rem; font-weight: 600; }
.reel-liked { color: #e41e3f !important; }

/* BOUTON UPLOAD FLOTTANT */
.reel-upload-btn {
    position: fixed; /* Changé de absolute à fixed pour être sûr qu'il flotte sur l'écran */
    top: 25px;       /* Juste en dessous du header */
    right: 20px;
    z-index: 99999 !important; /* Force l'affichage au-dessus de tout */
    background: #e41e3f;       /* Rouge temporaire pour bien le repérer */
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* BOTTOM SHEET MODAL (Commentaires) */
.bottom-sheet-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 30000;
    display: none; align-items: flex-end; justify-content: center;
}
.bottom-sheet-content {
    background: white; width: 500px; max-width: 100%;
    height: 60vh; border-radius: 16px 16px 0 0;
    display: flex; flex-direction: column; animation: slideUp 0.3s;
}
.bottom-sheet-header { padding: 15px; border-bottom: 1px solid #eee; font-weight: bold; display: flex; justify-content: space-between; }
.bottom-sheet-body { flex: 1; overflow-y: auto; padding: 10px; }
.bottom-sheet-footer { padding: 10px; border-top: 1px solid #eee; display: flex; gap: 10px; }

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* S'assurer que la liste des réactions passe au-dessus des commentaires Reel */
#react-modal {
    z-index: 40000 !important;
}

/* Style pour les menus dans les commentaires Reel */
#reel-comments-list .options-menu {
    z-index: 100; /* Priorité sur les autres éléments */
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* S'assurer que le conteneur du menu ne casse pas la flexbox */
#reel-comments-list .btn-options {
    opacity: 0.6;
}
#reel-comments-list .btn-options:hover {
    opacity: 1;
}

/* --- CORRECTION PRIORITÉ MODALE ACTION --- */
/* Force la fenêtre Modifier/Signaler à passer devant les Reels et les Commentaires */
#modal {
    z-index: 70000 !important; 
}

/* --- CORRECTION FINALE SUPERPOSITION --- */

/* 1. On s'assure que la zone de commentaire est à un niveau fixe (ex: 30000) */
#reel-comments-modal {
    z-index: 30000 !important;
}

/* 2. On place la fenêtre Modifier/Signaler AU-DESSUS DE TOUT (99999) */
/* C'est le niveau le plus haut, elle passera devant les commentaires */
#modal {
    z-index: 99999 !important; 
}

/* 3. On s'assure aussi que la fenêtre de confirmation (Supprimer) est au même niveau */
#confirm-modal, #alert-modal {
    z-index: 99999 !important;
}

/* --- BOUTON RETOUR REELS --- */
.reels-back-header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 50; /* Au-dessus de la vidéo (z-index 0) mais sous les modales (z-index 100+) */
    color: white;
    font-size: 1.5rem; /* Texte assez grand */
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre la flèche et le texte */
    text-shadow: 0 2px 4px rgba(0,0,0,0.6); /* Ombre pour la lisibilité */
    transition: transform 0.2s;
}

.reels-back-header:hover {
    transform: translateX(-5px); /* Petite animation vers la gauche au survol */
    opacity: 0.9;
}

/* --- BOUTON EMOJI GÉNÉRIQUE --- */
.input-with-emoji {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

/* Le bouton smiley à l'intérieur des inputs */
.btn-emoji-inside {
    position: absolute;
    right: 10px;
    bottom: 50%;
    transform: translateY(50%); /* Centré verticalement */
    color: #65676b;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
}
.btn-emoji-inside:hover {
    color: var(--fb-blue);
    transform: translateY(50%) scale(1.1);
}

/* Pour les Textarea (Post), on met le bouton en bas à droite */
.textarea-emoji-btn {
    position: absolute;
    right: 10px;
    bottom: 10px; /* En bas */
    color: #65676b;
    cursor: pointer;
    font-size: 1.3rem;
}

/* Le menu Popup (Réutilisé du chat mais adapté) */
.general-emoji-popup {
    position: absolute;
    bottom: 100%; /* Juste au-dessus */
    right: 0;
    width: 260px;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px;
    display: none; /* Caché par défaut */
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    z-index: 100000; /* Très haut pour passer devant les Reels */
}
.general-emoji-popup.active {
    display: grid;
}

/* --- VARIANTE : MENU EMOJI VERS LE BAS --- */
/* Utilisé pour la création de publication */
.general-emoji-popup.popup-down {
    bottom: auto;    /* Annule l'affichage vers le haut */
    top: 100%;       /* Force l'affichage en dessous du bouton */
    margin-top: 5px; /* Un petit espace esthétique */
    margin-bottom: 0;
}

/* --- CORRECTION GLOBALE DES MODALES --- */
/* Force TOUTES les fenêtres (Humeur, Partage, Action, Alertes) à passer devant tout */
.modal-overlay {
    z-index: 100000 !important; /* Niveau maximum */
}

/* --- MODALE PARTAGE (STYLE MIS À JOUR) --- */
.share-socials { 
    display: flex; 
    gap: 15px; 
    justify-content: center; /* Centré horizontalement */
    margin-top: 20px; 
    padding-top: 15px; 
    border-top: 1px solid #eee;
    flex-wrap: wrap; /* Permet de passer à la ligne sur petit écran */
}

.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 60px; /* Largeur fixe pour l'alignement */
    transition: transform 0.2s;
}

.share-item:hover {
    transform: translateY(-3px); /* Petit saut au survol */
}

.share-icon-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f0f2f5; /* Fond gris clair rond */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem; /* Taille de l'icône */
    margin-bottom: 5px;
    transition: background 0.2s;
}

.share-item:hover .share-icon-circle {
    background: #e4e6eb; /* Plus foncé au survol */
}

.share-label {
    font-size: 0.75rem; /* Texte petit */
    color: #65676b;
    text-align: center;
    line-height: 1.2;
}

/* --- SIDEBAR DROITE --- */
.sidebar-right {
    position: fixed;
    top: 56px;
    right: 0;
    width: 320px; /* Un peu plus large pour les pubs */
    height: calc(100vh - 56px);
    background: transparent; /* Fond transparent pour fondre avec le site */
    padding: 20px 10px;
    overflow-y: auto;
    display: none; /* Caché sur mobile */
}

/* ======================================================= */
/*      AJUSTEMENT DES SIDEBARS ET DU CENTRE (DESKTOP)     */
/* ======================================================= */
@media (min-width: 1100px) {
    .sidebar-left {
        display: block;
    }
    
    .sidebar-right {
        display: block;
    }
    
    /* 1. On force le conteneur à prendre tout l'espace et à centrer */
    /* L'utilisation de !important annule l'interférence du JavaScript sur le profil */
    .container, 
    .container.profile-mode {
        margin-left: 280px !important;  
        margin-right: 320px !important; 
        max-width: none !important;     
        display: flex;
        justify-content: center; 
    }
    
    /* 2. On liste TOUTES les vues pour les brider à la taille d'un fil d'actualité (590px) */
    #view-home, #view-market, #view-radar, #view-lost-found, 
    #view-alerts, #view-help, #view-laoka, #view-groups, 
    #view-pages, #view-search, #view-profile, 
    #view-single-group, #view-single-page, #view-ai-dashboard, 
    #view-crush, #view-friends, #view-notifications, #view-messages, 
    #view-ambassador, #view-lang-coach /* <--- AJOUTEZ #view-lang-coach ICI */ {
        width: 100%;
        max-width: 590px; 
    }
}

/* Styles des éléments de droite */
.right-request-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.btn-confirm-sm {
    background: var(--fb-blue);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-delete-sm {
    background: #e4e6eb;
    color: black;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Style des Contacts (Liste Chat) */
.contact-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.contact-item:hover {
    background-color: #e4e6eb;
}

.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
}

.contact-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #050505;
}

.contact-online-dot {
    position: absolute;
    bottom: 0;
    right: 12px; /* Ajusté par rapport à l'avatar */
    width: 10px;
    height: 10px;
    background: #31a24c; /* Vert */
    border-radius: 50%;
    border: 2px solid #f0f2f5; /* Couleur du fond de la sidebar */
}

.cursor-pointer { cursor: pointer; }

/* --- INPUT MESSAGE STORY --- */
.story-footer-wrapper {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Espace entre les réactions et l'input */
}

/* On modifie la barre de réaction pour qu'elle ne soit plus en absolute mais dans le wrapper */
.story-reactions-bar {
    position: relative; /* On change absolute en relative */
    bottom: auto;
    left: auto;
    transform: none;
    display: flex;
    gap: 10px;
}

/* Le conteneur de l'input */
.story-reply-container {
    width: 90%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Le champ de saisie transparent */
.story-reply-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 25px;
    padding: 10px 15px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    backdrop-filter: blur(5px);
    transition: 0.2s;
}

.story-reply-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.story-reply-input:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: white;
}

/* Le bouton envoyer */
.story-send-btn {
    background: var(--fb-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.2s;
}
.story-send-btn:hover {
    transform: scale(1.1);
}

/* --- STYLE BULLE CHAT : RÉPONSE STORY --- */
.msg-story-reply {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.05);
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 5px;
    border-left: 3px solid var(--fb-blue);
    cursor: pointer;
}
.msg-me .msg-story-reply {
    background: rgba(255,255,255,0.2);
    border-left-color: rgba(255,255,255,0.8);
}
.msg-story-thumb {
    width: 40px;
    height: 60px; /* Format portrait */
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}
.msg-story-text {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.8;
}

/* --- ETIQUETTE REPONSE STORY DANS LE CHAT --- */
.msg-story-reply-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.1); /* Ligne de séparation légère */
    cursor: pointer;
    opacity: 0.9;
}

/* Ajustement couleur bordure pour mes messages (fond bleu) */
.msg-me .msg-story-reply-container {
    border-bottom-color: rgba(255,255,255,0.3);
}

.msg-story-thumb {
    width: 30px;
    height: 45px; /* Format vertical story */
    object-fit: cover;
    border-radius: 4px;
    background: #000;
    border: 1px solid rgba(0,0,0,0.1);
}

.msg-story-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.msg-story-label {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 2px;
}

.msg-story-text {
    font-size: 0.8rem;
    font-style: italic;
}

/* --- ONGLETS PROFIL --- */
.profile-tabs-container {
    border-top: 1px solid #ced0d4;
    margin-top: 10px;
    background: white;
}

.profile-tabs {
    display: flex;
    max-width: 580px; /* Aligné avec le contenu */
    margin: 0 auto;
}

.profile-tab-item {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
}

.profile-tab-item:hover {
    background-color: #f2f2f2;
    border-radius: 5px;
}

.profile-tab-item.active {
    color: var(--fb-blue);
    border-bottom-color: var(--fb-blue);
    border-radius: 0;
}

/* --- GRILLE PHOTOS --- */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding-bottom: 20px;
}

.photo-grid-item {
    width: 100%;
    aspect-ratio: 1 / 1; /* Carré parfait */
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: filter 0.2s;
}

.photo-grid-item:hover {
    filter: brightness(0.85); /* Effet au survol */
}

/* Ajustement pour que le post dans la modale prenne toute la largeur */
#single-post-content .card {
    box-shadow: none; /* On enlève l'ombre de la carte car la modale en a déjà une */
    margin-bottom: 0;
    border: none;
}

/* ======================================================= */
/*      CORRECTIONS TAILLE PROFIL & POINT VERT             */
/* ======================================================= */

/* 1. STYLE DE L'AVATAR DES PAGES (Ajoutez ceci car ça n'existait pas) */
#pg-avatar {
    width: 100px !important;
    height: 100px !important;
    margin-top: -50px !important;
    border: 4px solid white;
    background: white;
    object-fit: cover;
}

/* 2. CORRECTION POSITION POINT VERT (ONLINE DOT) */
/* On écrase l'ancienne règle pour l'adapter à la nouvelle taille de 130px */
.profile-avatar-container .online-dot {
    width: 22px;       /* Légèrement plus petit pour être proportionnel */
    height: 22px;
    
    /* C'EST ICI LA CORRECTION : */
    /* Avant c'était 15px, on met 5px pour le pousser vers le bord extérieur */
    bottom: 5px;       
    right: 5px;
    
    border: 3px solid white; /* Bordure un peu plus fine */
}

/* --- PARAMÈTRES --- */
.danger-zone {
    border: 1px solid #e41e3f;
    background-color: #fff5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

/* --- CORRECTION SUPERPOSITION --- */

/* 1. La fenêtre Paramètres (Niveau haut) */
#settings-modal {
    z-index: 100000 !important;
}

/* 2. Les fenêtres d'Alerte et Confirmation (Niveau TRÈS haut) */
/* Elles doivent passer devant les Paramètres */
#confirm-modal, #alert-modal {
    z-index: 200000 !important;
}

/* Style des Hashtags dans le texte */
.hashtag {
    color: var(--fb-blue);
    font-weight: 600;
    cursor: pointer;
}
.hashtag:hover {
    text-decoration: underline;
    background-color: #e7f3ff;
    border-radius: 2px;
}

/* Style de la liste Tendances (Sidebar) */
.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
}
.trend-item:hover {
    background-color: #e4e6eb;
}
.trend-rank {
    font-weight: bold;
    color: #65676b;
    width: 20px;
}
.trend-name {
    font-weight: 600;
    color: #050505;
    flex: 1;
}
.trend-count {
    font-size: 0.8rem;
    color: #65676b;
}

/* ======================================================= */
/*                  MODE SOMBRE (DARK MODE)                */
/* ======================================================= */

/* 1. DÉFINITION DES COULEURS SOMBRES */
[data-theme="dark"] {
    --fb-bg: #18191a;
    --fb-card-bg: #242526;
    --fb-text: #e4e6eb;
    --fb-text-sec: #b0b3b8;
    --fb-input: #3a3b3c;
    --fb-hover: #3a3b3c;
    --fb-border: #3e4042;
    --fb-blue: #2d88ff; /* Bleu plus clair pour le contraste */
}

/* 2. APPLICATION AU CORPS DE PAGE */
[data-theme="dark"] body {
    background-color: var(--fb-bg) !important;
    color: var(--fb-text) !important;
}

/* 3. APPLICATION AUX ÉLÉMENTS (Fond gris foncé) */
[data-theme="dark"] header,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .sidebar-left,
[data-theme="dark"] .chat-window,
[data-theme="dark"] .chat-header,
[data-theme="dark"] .chat-body,
[data-theme="dark"] .chat-footer,
[data-theme="dark"] .profile-header,
[data-theme="dark"] .profile-tabs-container,
[data-theme="dark"] .search-dropdown,
[data-theme="dark"] .notif-dropdown,
[data-theme="dark"] .group-card,
[data-theme="dark"] .bottom-sheet-content,
[data-theme="dark"] .options-menu,
[data-theme="dark"] .filter-menu,
[data-theme="dark"] .general-emoji-popup,
[data-theme="dark"] .message-react-popup,
[data-theme="dark"] #group-members-view,
[data-theme="dark"] .story-card.create-card,
[data-theme="dark"] .create-card-footer {
    background-color: var(--fb-card-bg) !important;
    color: var(--fb-text) !important;
    border-color: var(--fb-border) !important;
}

/* 4. TEXTES SECONDAIRES (Gris clair) */
[data-theme="dark"] .post-time,
[data-theme="dark"] .profile-bio,
[data-theme="dark"] .group-card-members,
[data-theme="dark"] .search-sub,
[data-theme="dark"] .notif-time,
[data-theme="dark"] .c-time,
[data-theme="dark"] .sidebar-item,
[data-theme="dark"] .nav-icon-btn,
[data-theme="dark"] .nav-tab {
    color: var(--fb-text-sec) !important;
}

/* 5. INPUTS ET BOUTONS */
[data-theme="dark"] .auth-input,
[data-theme="dark"] .share-textarea,
[data-theme="dark"] .search-box,
[data-theme="dark"] .comment-field,
[data-theme="dark"] .chat-input-wrapper,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-friend,
[data-theme="dark"] .btn-invite,
[data-theme="dark"] .story-reply-input {
    background-color: var(--fb-input) !important;
    color: var(--fb-text) !important;
    border-color: var(--fb-border) !important;
}

[data-theme="dark"] .search-input,
[data-theme="dark"] textarea,
[data-theme="dark"] input {
    color: var(--fb-text) !important;
}

/* 6. SURVOLS (HOVER) */
[data-theme="dark"] .nav-tab:hover,
[data-theme="dark"] .sidebar-item:hover,
[data-theme="dark"] .notif-item:hover,
[data-theme="dark"] .trend-item:hover,
[data-theme="dark"] .search-item:hover,
[data-theme="dark"] .action-btn:hover {
    background-color: var(--fb-hover) !important;
}

/* 7. DIVERS */
[data-theme="dark"] .msg-them {
    background-color: #3a3b3c !important;
    color: var(--fb-text) !important;
}
[data-theme="dark"] .nav-tab.active-tab {
    color: var(--fb-blue) !important;
    border-bottom-color: var(--fb-blue) !important;
}
[data-theme="dark"] .bubble {
    background-color: #3a3b3c !important;
    color: var(--fb-text) !important;
}
[data-theme="dark"] .bubble b {
    color: var(--fb-text) !important;
}

/* ======================================================= */
/*      CORRECTIFS SPÉCIFIQUES MODE SOMBRE                 */
/* ======================================================= */

/* 1. NOMS DES UTILISATEURS (Forcer en Blanc pur) */
[data-theme="dark"] .post-author,
[data-theme="dark"] .profile-name,
[data-theme="dark"] .group-card-name,
[data-theme="dark"] .contact-name,
[data-theme="dark"] .search-name,
[data-theme="dark"] .notif-text b, /* Le nom en gras dans les notifs */
[data-theme="dark"] .bubble b,     /* Le nom dans les commentaires */
[data-theme="dark"] strong,
[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3 {
    color: #ffffff !important;
}

/* 2. TEXTES GRIS (Les rendre plus clairs pour la lisibilité) */
[data-theme="dark"] .post-time,
[data-theme="dark"] .c-time,
[data-theme="dark"] .search-sub,
[data-theme="dark"] .group-card-members,
[data-theme="dark"] .profile-bio,
[data-theme="dark"] .sidebar-item,
[data-theme="dark"] .nav-icon-btn i {
    color: #b0b3b8 !important; /* Gris clair lisible */
}

/* 3. ZONES DE TEXTE (Publication & Commentaires) */
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"] {
    color: #e4e6eb !important;       /* Texte blanc */
    background-color: transparent !important; /* Fond transparent pour prendre la couleur de la carte */
}

/* 4. COULEUR DU TEXTE "FANTÔME" (Placeholder) */
[data-theme="dark"] ::placeholder {
    color: #b0b3b8 !important;
    opacity: 1;
}

/* 5. FOND DES BOITES DE COMMENTAIRES */
[data-theme="dark"] .comment-field,
[data-theme="dark"] .chat-input-wrapper {
    background-color: #3a3b3c !important; /* Gris plus clair que le fond */
}

/* ======================================================= */
/*      CORRECTIFS FINAUX MODE SOMBRE (TEXTE & BOUTONS)    */
/* ======================================================= */

/* 1. DESCRIPTIONS (Groupe & Page) */
[data-theme="dark"] #g-desc,
[data-theme="dark"] #pg-desc {
    color: #e4e6eb !important;
}

/* 2. TITRES DES MENUS DÉROULANTS (Notifs, Messages, etc.) */
[data-theme="dark"] .notif-header {
    color: #ffffff !important;
    border-bottom-color: #3e4042 !important;
}

/* 3. NOMS DANS LES NOTIFICATIONS ET MESSAGES */
[data-theme="dark"] .notif-text {
    color: #e4e6eb !important; /* Le texte normal */
}
[data-theme="dark"] .notif-text b,
[data-theme="dark"] .notif-item div[style*="font-weight:600"] { 
    /* Cible spécifiquement les noms en gras dans les listes */
    color: #ffffff !important; 
}

/* 4. BOUTONS RONDS DU HEADER (Chat, Notif, Lune, Logout) */
[data-theme="dark"] .nav-icon-btn {
    background-color: #3a3b3c !important; /* Le rond devient gris foncé (plus blanc) */
    transition: 0.2s;
}

[data-theme="dark"] .nav-icon-btn i {
    color: #e4e6eb !important; /* L'icône devient blanche/gris clair */
}

/* Effet au survol (devient un peu plus clair pour montrer le clic) */
[data-theme="dark"] .nav-icon-btn:hover {
    background-color: #4e4f50 !important;
}

/* Cas particulier : Le badge rouge doit rester rouge */
[data-theme="dark"] .nav-badge {
    color: white !important;
    background-color: #e41e3f !important;
    border-color: #242526 !important;
}

/* ======================================================= */
/*      CORRECTIFS POPUPS & EN-TÊTE CHAT                   */
/* ======================================================= */

/* 1. TEXTE DANS LES POPUPS (Alertes & Confirmations) */
[data-theme="dark"] .alert-body,
[data-theme="dark"] #confirm-msg,
[data-theme="dark"] #alert-msg {
    color: #e4e6eb !important; /* Blanc cassé pour le message */
}

/* 2. EN-TÊTE DU CHAT (Nom de la personne) */
[data-theme="dark"] .chat-user-info {
    color: #ffffff !important; /* Blanc pur */
}

/* On s'assure que tout texte dans l'en-tête du chat est blanc... */
[data-theme="dark"] .chat-header span {
    color: #ffffff !important;
}

/* ... SAUF le statut "En ligne" qui doit rester gris clair pour le contraste */
[data-theme="dark"] .status-text-header {
    color: #b0b3b8 !important; 
}

/* 3. ICONES DE LA FENÊTRE DE CHAT (Réduire, Fermer) */
[data-theme="dark"] .chat-controls i {
    color: #b0b3b8 !important;
}
[data-theme="dark"] .chat-controls i:hover {
    color: #ffffff !important;
}

/* ======================================================= */
/*      CORRECTIFS MODALES (TITRES & PIEDS DE PAGE)        */
/* ======================================================= */

/* 1. TITRE DES MODALES (Confirmation, Alerte, Paramètres...) */
[data-theme="dark"] .m-head {
    color: #ffffff !important;       /* Texte Blanc */
    border-bottom-color: #3e4042 !important; /* Bordure grise foncée (au lieu de gris clair) */
    background-color: transparent !important; /* Pour être sûr qu'il prenne la couleur de la carte */
}

/* 2. PIED DE PAGE DES MODALES (Zone des boutons Oui/Non) */
[data-theme="dark"] .m-foot {
    background-color: #242526 !important; /* Même gris foncé que le reste de la carte */
    border-top-color: #3e4042 !important; /* Bordure grise foncée */
    color: #e4e6eb !important;
}

/* ======================================================= */
/*      CORRECTIFS BOUTONS BLEUS & SURVOL CONTACTS         */
/* ======================================================= */

/* 1. SURVOL LISTE CONTACTS (Sidebar Droite) - MODE SOMBRE */
/* Empêche le fond de devenir blanc et de cacher le texte */
[data-theme="dark"] .contact-item:hover {
    background-color: #3a3b3c !important; /* Gris foncé */
}

/* 2. BOUTONS D'ACTION (Ajouter, Rejoindre, Voir, Gérer) */
/* On force le Bleu (#1877f2) et le texte Blanc pour tous les modes */

/* Bouton "Ajouter" (Amis) et "Supprimer" (Invitations) */
.btn-invite {
    background-color: #1877f2 !important;
    color: white !important;
}
.btn-invite:hover {
    background-color: #166fe5 !important;
}

/* Boutons dans les cartes (Groupes & Pages) */
.group-card-btn {
    background-color: #1877f2 !important;
    color: white !important;
}
.group-card-btn:hover {
    background-color: #166fe5 !important;
}

/* Exception : Bouton "Gérer" ou "Déjà membre" (Optionnel) */
/* Si vous voulez que le bouton "Gérer" reste gris pour se distinguer, décommentez ceci : */
/*
.group-card-btn.secondary {
    background-color: #e4e6eb !important;
    color: black !important;
}
[data-theme="dark"] .group-card-btn.secondary {
    background-color: #3a3b3c !important;
    color: white !important;
}
*/

/* ======================================================= */
/*      CORRECTIFS FINAUX (STORY & BOUTONS BLEUS)          */
/* ======================================================= */

/* 1. TEXTE "CRÉER UNE STORY" */
/* En mode sombre, le texte devient blanc pour être lisible sur le fond gris */
[data-theme="dark"] .create-text {
    color: #e4e6eb !important;
}

/* 2. FORCER LE BOUTON "AJOUTER" EN BLEU (AMIS) */
/* On cible spécifiquement pour écraser le gris du mode sombre */
[data-theme="dark"] .btn-invite {
    background-color: #1877f2 !important; /* Bleu Facebook */
    color: #ffffff !important;            /* Texte Blanc */
    border: none !important;
}

/* 3. FORCER LES BOUTONS GROUPES/PAGES EN BLEU */
[data-theme="dark"] .group-card-btn {
    background-color: #1877f2 !important;
    color: #ffffff !important;
    border: none !important;
}

/* Effets de survol (Hover) pour ces boutons en mode sombre */
[data-theme="dark"] .btn-invite:hover,
[data-theme="dark"] .group-card-btn:hover {
    background-color: #166fe5 !important; /* Bleu un peu plus foncé */
}

/* SÉCURITÉ : On s'assure que le mode CLAIR utilise aussi le bleu pur */
/* (Ceci écrase le style inline "background:#e7f3ff" qui était bleu pâle) */
.btn-invite, .group-card-btn {
    background-color: #1877f2 !important;
    color: white !important;
}

/* ======================================================= */
/*      CORRECTIFS BULLES DE RÉACTION (MODE SOMBRE)        */
/* ======================================================= */

/* 1. La "Pilule" globale (Le conteneur arrondi à côté des commentaires) */
[data-theme="dark"] .c-react-pill {
    background-color: #3a3b3c !important; /* Gris foncé (comme les boutons) */
    border: 1px solid #3e4042 !important; /* Bordure discrète */
    box-shadow: 0 1px 2px rgba(0,0,0,0.5) !important; /* Ombre plus noire */
}

/* 2. Le chiffre à l'intérieur de la pilule */
[data-theme="dark"] .c-react-pill span {
    color: #e4e6eb !important; /* Texte Blanc */
}

/* 3. Les petites bulles rondes empilées (qui contiennent les icônes) */
/* Important : On change la bordure blanche en gris foncé pour l'effet de superposition */
[data-theme="dark"] .react-bubble {
    border-color: #3a3b3c !important; /* La bordure se fond avec le background */
    background-color: transparent !important;
}

/* 4. Cas spécifique : Si la bulle est sur un fond de message (Chat ou Commentaire) */
/* On s'assure que la bordure correspond au gris de la bulle de chat */
[data-theme="dark"] .bubble .react-bubble {
    border-color: #3a3b3c !important; 
}

/* ==================================================================
   RESPONSIVE MOBILE - STYLE FACEBOOK LITE (2 LIGNES)
================================================================== */

/* Par défaut (Desktop) : On cache le header mobile */
.mobile-header {
    display: none;
}
.desktop-header {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    /* 1. Inversion des affichages */
    .desktop-header {
        display: none !important;
    }
    .mobile-header {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* 2. Ajustement du conteneur Header global */
    header {
        height: auto; 
        padding: 0;
        background: white;
        flex-direction: column;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
	
	/* Cache le conteneur droit du PC (où il y a la cloche, messenger, etc.) */
    .header-right {
        display: none !important;
    }

    /* Cache le conteneur gauche du PC (barre recherche PC) */
    .header-left {
        display: none !important;
    }

    /* Cache le conteneur central du PC (les anciens onglets) */
    .header-center {
        display: none !important; /* On cache l'ancien header-center du PC */
    }
    
    /* Cache spécifiquement les boutons ronds du PC au cas où */
    .nav-icon-btn {
        display: none !important;
    }

    /* 3. LIGNE 1 : TOP (Logo + Search + Menu) */
    .mh-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 15px;
        background: white;
    }

    /* Logo Texte pour Mobile */
    .header-logo {
        width: auto;
        height: auto;
        border-radius: 0;
        background: transparent;
        color: #1877f2;
        font-size: 1.8rem;
        font-weight: 900;
        padding: 0;
        margin: 0;
    }

    /* Boutons ronds gris pour Search et Menu */
    .mh-search-btn, .mh-menu-btn {
        width: 35px;
        height: 35px;
        background: #f0f2f5;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: #050505;
        cursor: pointer;
    }

    /* 4. LIGNE 2 : NAVIGATION (Grille 6 colonnes stricte) */
    .mh-nav-row {
        display: grid !important;              
        grid-template-columns: repeat(6, 1fr); /* 6 parts égales */
        width: 100%;
        height: 50px;
        background: white;
        border-top: 1px solid #ddd;
        padding: 0;
        margin: 0;
    }

    .mh-nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        width: 100%; /* Prend toute la case de la grille */
        cursor: pointer;
        font-size: 1.4rem;
        color: #65676b;
        position: relative;
    }

    /* État Actif */
    .mh-nav-item.active-mobile-tab {
        color: #1877f2;
        border-bottom: 2px solid #1877f2; /* Ligne bleue en bas */
    }
    
    .mh-nav-item:hover {
        background-color: #f0f2f5;
    }

    /* 5. Nettoyage du reste de l'interface mobile */
    body {
        padding-top: 0; 
        padding-bottom: 0; 
    }
    
    .container {
        margin-top: 10px;
        padding: 0;
    }
    
    .card {
        border-radius: 0;
        margin-bottom: 8px;
    }

    /* Modales et Dropdowns Plein Écran */
    .notif-dropdown {
        top: 95px;
        width: 100%;
        border-radius: 0;
        height: calc(100vh - 95px);
        border: none;
    }
    
    /* Support Dark Mode Mobile */
    [data-theme="dark"] .mh-top-row,
    [data-theme="dark"] .mh-nav-row,
    [data-theme="dark"] header {
        background-color: var(--fb-card-bg);
        border-color: var(--fb-border);
    }
    
    [data-theme="dark"] .mh-search-btn, 
    [data-theme="dark"] .mh-menu-btn {
        background-color: var(--fb-input);
        color: var(--fb-text);
    }
}

/* --- CORRECTION LISTE MESSAGES (STYLE LITE - HORS MEDIA QUERY) --- */

.msg-page-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f2f5;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

/* IMPORTANT : Le point . est ajouté ici */
.msg-page-avatar {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    border-radius: 50% !important;
    object-fit: cover;
    /* La marge est gérée dans le HTML maintenant */
}

.msg-page-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Support Dark Mode Liste Message */
[data-theme="dark"] .msg-page-item {
    background-color: var(--fb-card-bg);
    border-color: var(--fb-border);
}
[data-theme="dark"] .msg-page-avatar {
    border-color: #3e4042;
}

/* Ajustement pour les messages dans le chat mobile */
#mobile-chat-body .msg-container {
    max-width: 85%; /* Un peu plus large sur mobile */
}

/* En mode sombre */
[data-theme="dark"] #view-mobile-chat,
[data-theme="dark"] #view-mobile-chat > div { /* Header et Footer */
    background-color: var(--fb-bg) !important;
    border-color: var(--fb-border) !important;
}

/* AJUSTEMENTS CHAT MOBILE */
/* POPUP EMOJI MOBILE */
#mc-emoji-popup {
    /* L'affichage est géré par JS, mais on le cache par défaut */
    display: none; 
    
    /* Configuration Grille */
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    
    /* Dimensions et Position */
    position: absolute;
    bottom: 60px; /* Au-dessus de la barre de saisie */
    left: 0;
    width: 100%;
    height: 250px;
    
    /* Apparence */
    background: #f0f2f5;
    border-top: 1px solid #ddd;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1); /* Ombre plus visible vers le haut */
    z-index: 9999 !important; /* Z-Index maximum */
    
    /* Scroll */
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

/* On supprime la règle #mc-emoji-popup.active car JS fait le travail */

/* CLASSE ACTIVE (Pour l'afficher) */
#mc-emoji-popup.active {
    display: grid !important; /* Force l'affichage en grille */
}

/* Style des boutons emoji */
.emoji-btn {
    cursor: pointer;
    font-size: 1.8rem; /* Un peu plus gros pour le doigt */
    user-select: none;
    text-align: center;
    padding: 5px;
}
.emoji-btn:active {
    transform: scale(1.2);
    background-color: #ddd;
    border-radius: 50%;
}

/* Style au survol des emojis */
#mc-emoji-popup .emoji-btn:hover {
    background-color: #e4e6eb;
    border-radius: 5px;
}

/* Style des boutons emoji */
.emoji-btn {
    cursor: pointer;
    font-size: 1.5rem;
    user-select: none;
    transition: transform 0.1s;
}
.emoji-btn:active {
    transform: scale(1.2);
}
#mc-emoji-popup.active {
    display: grid;
}

/* S'assurer que le menu dropdown du message passe au-dessus de tout dans le chat mobile */
#mobile-chat-body .chat-dropdown-menu {
    position: absolute;
    /* On change la direction pour éviter que ça sorte de l'écran à droite */
    right: 30px; 
    left: auto;
    z-index: 100;
}

/* Message "Vu" (Bulle) */
.seen-container {
    display: flex;
    justify-content: flex-end;
    margin-top: -5px; /* Remonte un peu */
    margin-bottom: 5px;
    padding-right: 5px;
    width: 100%;
}
.seen-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* INDICATEUR TYPING MOBILE */
#mobile-typing-indicator {
    background-color: #f0f2f5; /* Gris clair comme une bulle reçue */
    padding: 10px 15px;
    border-radius: 20px;
    border-bottom-left-radius: 4px; /* Style "bulle message" */
    width: fit-content;
    margin-bottom: 10px;
    margin-left: 10px;
    display: none; /* Caché par défaut */
}

/* Animation des points (si pas déjà présent) */
.typing-dots { display: flex; gap: 4px; }
.typing-dot {
    width: 6px; height: 6px;
    background: #65676b;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce { 
    0%, 80%, 100% { transform: scale(0); } 
    40% { transform: scale(1); } 
}

.chat-user-info:hover {
    text-decoration: underline; /* Souligne le nom au survol */
    opacity: 0.9;
}

/* --- PAGE NOTIFICATIONS MOBILE --- */
.notif-page-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f2f5;
    background: white;
    cursor: pointer;
}

.notif-page-item.unread {
    background-color: #e7f3ff; /* Fond bleu clair pour non lu */
}

.notif-page-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.notif-page-content {
    flex: 1;
}

.notif-page-text {
    font-size: 0.95rem;
    line-height: 1.3;
    color: #050505;
}

.notif-page-time {
    font-size: 0.8rem;
    color: #1877f2; /* Bleu FB */
    font-weight: 600;
    margin-top: 4px;
}

/* Dark Mode */
[data-theme="dark"] .notif-page-item {
    background-color: var(--fb-card-bg);
    border-bottom-color: var(--fb-border);
}
[data-theme="dark"] .notif-page-item.unread {
    background-color: #2a2b2d;
}
[data-theme="dark"] .notif-page-text {
    color: var(--fb-text);
}

/* ==================================================================
   CORRECTIF FINAL : NETTOYAGE HEADER MOBILE & MENU
================================================================== */
@media (max-width: 768px) {
    
    /* 1. Cache TOUT ce qui est enfant direct du header... */
    header > div {
        display: none !important;
    }

    /* 2. ...SAUF la barre mobile (.mobile-header) qui doit être affichée en colonne */
    header > .mobile-header {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* 3. Sécurité supplémentaire pour l'icône fantôme */
    .header-right, .header-left, .header-center {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* --- CORRECTION MENU MOBILE PLEIN ÉCRAN (AU-DESSUS DE TOUT) --- */
    .sidebar-left {
        display: none; /* Caché par défaut */
        
        /* POSITIONNEMENT FIXE IMPÉRATIF */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        
        /* TAILLE PLEIN ÉCRAN */
        width: 100% !important;
        height: 100vh !important; /* 100vh = toute la hauteur de l'écran */
        
        /* APPARENCE */
        background: white !important; /* Fond blanc opaque (très important) */
        padding: 0 0 120px 0 !important; 
        overflow-y: auto !important; /* Permet de scroller si le menu est long */
        box-shadow: none !important;
        
        /* Z-INDEX SUPÉRIEUR À TOUT (Header, Chat, etc.) */
        z-index: 200000 !important; 
    }

    /* Quand le menu est actif (via JS) */
    .sidebar-left.active-mobile {
        display: block !important;
        animation: slideInRight 0.2s ease-out;
    }

    /* En-tête du menu (Flèche retour) */
    .mobile-menu-header {
        display: flex !important;
        align-items: center;
        background: white;
        
        /* Position sticky pour qu'il reste en haut quand on scroll le menu */
        position: sticky;
        top: 0;
        z-index: 200001 !important; /* Encore plus haut que le menu lui-même */
        
        padding: 15px;
        border-bottom: 1px solid #ddd;
    }

    /* Ajustement des items pour le tactile */
    .sidebar-item {
        padding: 15px 20px !important;
        font-size: 1.1rem !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    /* Support Dark Mode pour le menu */
    [data-theme="dark"] .sidebar-left,
    [data-theme="dark"] .mobile-menu-header {
        background-color: var(--fb-bg) !important;
        border-color: var(--fb-border) !important;
    }
}

/* Animation d'entrée du menu */
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* --- CORRECTION POSITION BADGES MOBILE (STYLE FB - VALIDÉ) --- */
.mh-nav-item .nav-badge {
    /* Positionnement par rapport au centre de l'icône */
    left: 45% !important;
    right: auto !important; /* On annule l'alignement droite */
    top: 4px !important;
    border-radius: 20px !important;
    
    /* Décalage pour chevaucher le coin supérieur droit de l'icône */
    margin-left: 6px !important; 
    
    /* Style visuel */
    position: absolute;
    background: #e41e3f;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 3px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
    line-height: 1.2;
    
    /* Bordure blanche pour détacher l'icône (effet propre) */
    border: 2px solid white; 
    z-index: 10;
}

/* Ajustement pour le Dark Mode (Bordure noire au lieu de blanche) */
[data-theme="dark"] .mh-nav-item .nav-badge {
    border-color: var(--fb-card-bg);
}

/* --- STYLE PRÉVISUALISATION LIEN (DANS L'ÉDITEUR) --- */

.editor-preview-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    position: relative;
    background: #f9f9f9;
    
    /* C'est ça qui empêche le débordement */
    width: 100%; 
    max-width: 100%; 
    box-sizing: border-box; 
}

/* Bouton Fermer (X) */
.preview-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
}
.preview-close-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* Image plus petite pour l'éditeur */
.preview-image {
    width: 100%;
    height: 120px; /* Hauteur réduite (avant c'était trop grand) */
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #eee;
}

/* Zone de texte */
.preview-info {
    padding: 8px 10px;
}

.preview-domain {
    font-size: 0.7rem;
    color: #65676b;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.preview-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: #050505;
    line-height: 1.2;
    
    /* Coupe le texte s'il est trop long (2 lignes max) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mode Sombre */
[data-theme="dark"] .editor-preview-card {
    background: var(--fb-input);
    border-color: var(--fb-border);
}
[data-theme="dark"] .preview-title {
    color: var(--fb-text);
}

/* STYLE DES LIENS DANS LES POSTS */
.post-link {
    color: var(--fb-blue); /* Bleu Facebook */
    text-decoration: none;
    word-break: break-all; /* Coupe le lien s'il est trop long pour éviter de casser le design */
}

.post-link:hover {
    text-decoration: underline;
}

/* En mode sombre, on garde le bleu ou on l'éclaircit un peu */
[data-theme="dark"] .post-link {
    color: #4599ff;
}

/* --- CORRECTIFS PLYR & HLS --- */

/* 1. Cacher le gros bouton bleu quand la vidéo joue ou charge */
.plyr--playing .plyr__control--overlaid,
.plyr--loading .plyr__control--overlaid {
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: -1 !important;
}

/* 2. Forcer l'affichage de la barre de contrôle en bas */
.plyr__controls {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 3. S'assurer que la vidéo ne déborde pas */
.plyr__video-wrapper {
    height: 100%;
}

/* ==================================================================
   L'ARÈNE (DÉBAT) - CSS FINAL
================================================================== */

/* 1. LE CONTENEUR DU POST */
.debate-container {
    display: flex;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.debate-side {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    color: white;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.debate-blue { background: linear-gradient(135deg, #1877f2, #0d5bbd); }
.debate-red { background: linear-gradient(135deg, #e41e3f, #b3122d); }

/* 2. ZONE DES COMMENTAIRES (COLONNES) */
.debate-comments-area {
    display: flex;
    border-top: 1px solid #ddd;
    background: #fafafa;
    min-height: 100px;
    align-items: flex-start; /* Important pour que les colonnes ne s'étirent pas bizarrement */
}

.debate-col {
    flex: 1;
    padding: 10px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    width: 50%; /* Force la largeur à 50% */
    box-sizing: border-box;
}
.debate-col:last-child { border-right: none; }

.debate-col-header {
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #65676b;
    text-transform: uppercase;
}

/* 3. CARTES COMMENTAIRES INDIVIDUELLES */
.debate-comment-card {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 0.85rem;
    word-wrap: break-word; /* Sécurité anti-débordement */
    /* La bordure de couleur est gérée par le JS via style="border-left..." */
}

/* 4. GESTION DU TEXTE TROP LONG (TRONCATURE) */
.debate-text-short {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Coupe après 3 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.debate-text-full {
    display: block; /* Affiche tout */
}

.debate-see-more-text {
    font-size: 0.75rem;
    color: #65676b;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    display: inline-block;
}
.debate-see-more-text:hover { text-decoration: underline; }

/* 5. GESTION DE LA LISTE CACHÉE (BOUTON "VOIR PLUS D'ARGUMENTS") */
.debate-hidden-list {
    display: none; /* Ajoutez !important pour forcer le masquage au début */
}

/* Style du bouton gris */
.debate-load-more-btn {
    width: 100%;
    padding: 8px;
    background: #f0f2f5;
    color: #65676b;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    text-align: center;
}
.debate-load-more-btn:hover {
    background: #e4e6eb;
    color: #1c1e21;
}

/* 6. INPUT EN BAS */
.debate-actions {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: white;
}
.btn-vote {
    flex: 1;
    border: none;
    padding: 8px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Cache un élément individuel de la liste */
.debate-item-hidden {
    display: none;
}

/* Petite animation pour que l'apparition soit fluide */
@keyframes fadeInItem {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-appear {
    animation: fadeInItem 0.3s ease-out forwards;
}

/* ======================================================= */
/*                  MODE ZÉRO (DATA SAVER)                 */
/* ======================================================= */

/* 1. CIBLAGE GLOBAL (Images + Vidéos + Plyr) */
body.zero-mode .post-media, 
body.zero-mode .shared-post-box img,
body.zero-mode .reel-video,
body.zero-mode .story-bg-media,
body.zero-mode .group-card-cover,
body.zero-mode .photo-grid-item,
body.zero-mode .link-preview-card div[style*="background-image"],
/* AJOUTS POUR LES VIDÉOS : */
body.zero-mode video,
body.zero-mode .plyr {
    filter: contrast(0) brightness(0.9) !important; /* Bloc gris */
    opacity: 0.1 !important; /* Presque invisible */
    cursor: pointer !important;
    min-height: 150px;
    background-color: #ccc !important;
    z-index: 10; /* Passe au-dessus des contrôles */
}

/* 2. On cache les contrôles du lecteur vidéo quand c'est masqué */
body.zero-mode .plyr__controls,
body.zero-mode .plyr__control--overlaid {
    display: none !important;
}

/* 3. Style Placeholder */
body.zero-mode .post-media, 
body.zero-mode .reel-video,
body.zero-mode .plyr {
    border: 2px dashed #999;
    box-sizing: border-box;
}

/* 4. CLASSE POUR RÉVÉLER (QUAND ON CLIQUE) */
body.zero-mode .zero-revealed,
body.zero-mode .zero-revealed .plyr,
body.zero-mode .plyr.zero-revealed {
    filter: none !important;
    opacity: 1 !important;
    border: none !important;
    min-height: auto !important;
    z-index: auto !important;
    background-color: transparent !important;
}

/* On réaffiche les contrôles quand révélé */
body.zero-mode .zero-revealed .plyr__controls,
body.zero-mode .zero-revealed .plyr__control--overlaid,
body.zero-mode .plyr.zero-revealed .plyr__controls,
body.zero-mode .plyr.zero-revealed .plyr__control--overlaid {
    display: flex !important;
}

/* 5. Indicateur visuel */
#zero-mode-indicator {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: #000;
    color: #2ebb43;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    z-index: 99999;
    pointer-events: none;
    display: none;
}
body.zero-mode #zero-mode-indicator {
    display: block;
}

/* ======================================================= */
/*                  SPLASH SCREEN (CORRIGÉ)                */
/* ======================================================= */
#glow-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Support mobile moderne */
    
    background-color: #ffffff !important;
    z-index: 2147483647 !important; /* Toujours au-dessus de tout */
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centre le contenu principal (Logo) */
    
    /* On enlève le padding-bottom car le footer sera en absolute */
    padding: 0; 
    transition: opacity 0.5s ease-out;
}

/* Conteneur du Logo + Points (Reste au centre) */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Petit ajustement pour compenser visuellement le footer */
    margin-bottom: 50px; 
}

/* Le Logo "g" */
.splash-logo-icon {
    width: 95px;
    height: 95px; /* Carré parfait */
    background: #1877f2;
    color: white;
    font-size: 5rem;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3);
    
    /* Centrage précis du "g" */
    padding-bottom: 15px; 
    line-height: 1;
    box-sizing: border-box;
}

/* Les points de chargement */
.splash-loader-dots {
    display: flex;
    gap: 8px;
}

.s-dot {
    width: 10px;
    height: 10px;
    background-color: #e4e6eb;
    border-radius: 50%;
    animation: glowLoading 1.2s infinite ease-in-out both;
}

.s-dot:nth-child(1) { animation-delay: -0.4s; }
.s-dot:nth-child(2) { animation-delay: -0.3s; }
.s-dot:nth-child(3) { animation-delay: -0.2s; }
.s-dot:nth-child(4) { animation-delay: -0.1s; }
.s-dot:nth-child(5) { animation-delay: 0s; }

@keyframes glowLoading {
    0%, 80%, 100% { background-color: #e4e6eb; transform: scale(0.8); }
    40% { background-color: #1877f2; transform: scale(1.2); }
}

/* Footer "Powered by" (Collé en bas) */
.splash-footer {
    position: absolute; /* C'est la clé ! */
    bottom: 40px;       /* Marge du bas */
    left: 0;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

/* Mode sombre Splash Screen */
[data-theme="dark"] #glow-splash-screen { background-color: #18191a !important; }
[data-theme="dark"] .s-dot { background-color: #3a3b3c; }
[data-theme="dark"] .splash-footer div:first-child { color: #b0b3b8; } /* Powered by */
[data-theme="dark"] .splash-footer div:last-child { color: #2d88ff; } /* Mada Tools */

/* Signature en bas */
.splash-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: fadeInUp 0.5s ease-out;
}

/* Support Mode Sombre pour le Splash */
[data-theme="dark"] #glow-splash-screen {
    background-color: #18191a;
}
[data-theme="dark"] .s-dot {
    background-color: #3a3b3c;
}
[data-theme="dark"] .splash-footer div {
    color: #b0b3b8; /* Texte "Powered by" */
}
[data-theme="dark"] .splash-footer div:last-child {
    color: #2d88ff; /* Texte "Mada Tools" */
}

/* ======================================================= */
/*                  PWA INSTALL POPUP                      */
/* ======================================================= */
.pwa-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%); /* Caché en bas par défaut */
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 99999; /* Au-dessus de tout le reste */
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none; /* Masqué par défaut via JS */
}

.pwa-popup.show {
    display: block;
    transform: translateX(-50%) translateY(0);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pwa-icon-box {
    width: 50px;
    height: 50px;
    background: #1877f2;
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    padding-bottom: 6px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.pwa-text {
    flex: 1;
}

.pwa-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #050505;
}

.pwa-desc {
    font-size: 0.85rem;
    color: #65676b;
    line-height: 1.3;
}

.pwa-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn-install {
    flex: 1;
    background: #1877f2;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.pwa-btn-close {
    flex: 1;
    background: #f0f2f5;
    color: #65676b;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Mode sombre PWA */
[data-theme="dark"] .pwa-popup { background: #242526; border-color: #3e4042; }
[data-theme="dark"] .pwa-title { color: white; }
[data-theme="dark"] .pwa-desc { color: #b0b3b8; }
[data-theme="dark"] .pwa-btn-close { background: #3a3b3c; color: #e4e6eb; }

/* ======================================================= */
/*                  PWA INSTALL POPUP                      */
/* ======================================================= */
.pwa-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%); /* Caché en bas par défaut */
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 99999; /* Au-dessus de tout le reste */
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none; /* Masqué par défaut via JS */
}

.pwa-popup.show {
    display: block;
    transform: translateX(-50%) translateY(0);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pwa-icon-box {
    width: 50px;
    height: 50px;
    background: #1877f2;
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    padding-bottom: 6px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.pwa-text {
    flex: 1;
}

.pwa-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #050505;
}

.pwa-desc {
    font-size: 0.85rem;
    color: #65676b;
    line-height: 1.3;
}

.pwa-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn-install {
    flex: 1;
    background: #1877f2;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.pwa-btn-close {
    flex: 1;
    background: #f0f2f5;
    color: #65676b;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Mode sombre PWA */
[data-theme="dark"] .pwa-popup { background: #242526; border-color: #3e4042; }
[data-theme="dark"] .pwa-title { color: white; }
[data-theme="dark"] .pwa-desc { color: #b0b3b8; }
[data-theme="dark"] .pwa-btn-close { background: #3a3b3c; color: #e4e6eb; }

/* --- FIX LOGO MOBILE --- */
.mobile-header .header-logo {
    /* On annule le style "rond bleu" du PC */
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    
    /* On remet le style texte */
    color: #1877f2 !important; /* Bleu texte */
    font-size: 1.8rem !important;
    font-family: sans-serif;
    letter-spacing: -1px;
    padding-left: 10px !important; /* Marge gauche */
    display: block !important;
}

/* En mode sombre mobile */
[data-theme="dark"] .mobile-header .header-logo {
    color: #ffffff !important;
}

/* ======================================================= */
/*      GESTION VIDÉO & STORIES (CODE UNIFIÉ FINAL)        */
/* ======================================================= */

/* --- 1. LECTEUR VIDÉO DANS LE FIL D'ACTUALITÉ (CARTE) --- */

/* Le conteneur (défini par l'aspect-ratio du JS) */
.card .plyr__video-embed {
    position: relative;
    width: 100%;
    /* La hauteur est gérée par le JS (aspect-ratio) */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 5px;
}

/* Le lecteur normal */
.card .plyr {
    position: absolute !important;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* La vidéo remplit le lecteur (Cover = Joli remplissage) */
.card video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Contrôles flottants (toujours visibles) */
.card .plyr__controls {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 10px 15px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
    z-index: 20 !important;
    display: flex !important;
    gap: 10px !important;
}

/* --- 2. MODE PLEIN ÉCRAN (POUR TOUTES LES VIDÉOS) --- */

.plyr--fullscreen-active {
    background: #000 !important;
    border-radius: 0 !important;
    z-index: 2147483647 !important; /* Au-dessus de tout */
}

.plyr--fullscreen-active .plyr__video-wrapper {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    padding-bottom: 0 !important; /* Annule ratio forcé */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* En plein écran, on voit TOUTE la vidéo (Contain) */
.plyr--fullscreen-active video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    margin: auto !important;
}

/* --- 3. STORIES : STRUCTURE & FOND FLOUTÉ --- */

.story-viewer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: #000; z-index: 50000;
    display: flex; justify-content: center; align-items: center;
}

/* Le Cadre de la Story */
.story-content-area {
    position: relative;
    width: 100%; height: 100%;
    max-width: 450px; aspect-ratio: 9 / 16; /* Format Portrait PC */
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    display: block; /* Important pour les calques */
}

/* L'arrière-plan Flouté (Généré via variable CSS du JS) */
.story-content-area::before {
    content: "";
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: var(--story-bg);
    background-size: cover; background-position: center;
    filter: blur(25px) brightness(0.7);
    transform: scale(1.1);
    z-index: 0;
}

/* Mobile : Plein écran total */
@media (max-width: 768px) {
    .story-content-area {
        max-width: 100%; width: 100vw; height: 100vh;
        aspect-ratio: unset; border-radius: 0;
    }
}

/* --- 4. STORIES : VIDÉO & MEDIA (CALQUE 1) --- */

.story-content-area img,
.story-content-area video,
.story-content-area .plyr,
.story-content-area .plyr__video-wrapper {
    position: absolute !important;
    top: 0; left: 0;
    width: 100% !important; height: 100% !important;
    object-fit: contain !important; /* Entier avec bandes transparentes */
    background: transparent !important; /* Pour voir le flou derrière */
    z-index: 1;
}

/* On cache les contrôles Plyr dans les stories */
.story-content-area .plyr__controls { display: none !important; }

/* Image Poster (Miniature) : Doit remplir l'espace avant le chargement */
.plyr__poster {
    background-size: cover !important; background-position: center !important;
    opacity: 1 !important; z-index: 2;
    transition: opacity 0.3s ease-out;
}
.plyr--playing .plyr__poster { opacity: 0 !important; pointer-events: none; }

/* --- 5. STORIES : INTERFACE (CALQUES SUPÉRIEURS) --- */

/* Header (Barres + Profil) */
.story-ui-top {
    position: absolute !important; top: 0; left: 0; width: 100%;
    padding: 15px 10px 0; box-sizing: border-box;
    z-index: 20; /* Devant la vidéo */
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}
.story-header-info, .story-progress-container { pointer-events: auto; }

.story-progress-container { display: flex; gap: 4px; margin-bottom: 12px; width: 100%; }
.story-progress-bar { flex: 1; height: 3px; background: rgba(255,255,255,0.3); border-radius: 2px; overflow: hidden; }
.story-progress-fill { height: 100%; background: #fff; width: 0%; }

.story-header-info { display: flex; align-items: center; gap: 10px; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.story-header-info img { width: 36px !important; height: 36px !important; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5); object-fit: cover !important; position: relative !important; z-index: 25; }

.story-close-btn { margin-left: auto; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; padding: 5px; line-height: 1; }

/* Footer (Input + Réactions) */
.story-footer-wrapper {
    position: absolute !important; bottom: 0; left: 0; width: 100%;
    padding: 20px 10px; padding-bottom: max(20px, env(safe-area-inset-bottom));
    box-sizing: border-box; z-index: 30;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    display: flex; flex-direction: column; gap: 15px;
}

/* Navigation Tactile */
.story-nav-left, .story-nav-right { position: absolute; top: 20%; bottom: 20%; width: 30%; z-index: 10; }
.story-nav-left { left: 0; } .story-nav-right { right: 0; }

/* --- 6. STORIES : RÉACTIONS (FIX ALIGNEMENT) --- */

/* Barre horizontale centrée */
.story-reactions-bar {
    display: flex; justify-content: center; gap: 15px; width: 100%;
    margin-bottom: 5px; pointer-events: auto;
}
.story-react-btn { width: 40px; height: 40px; cursor: pointer; transition: transform 0.2s; }
.story-react-btn:hover { transform: scale(1.2); }
.story-react-btn img { width: 100%; height: 100%; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }

/* Animation flottante */
/* Conteneur invisible qui prend tout l'écran de la story */
#story-floating-container {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Laisse passer les clics (navigation) */
    z-index: 100; /* Devant la vidéo et le footer */
    overflow: hidden; /* Pour que les coeurs ne sortent pas du cadre */
}

/* L'animation elle-même (Rappel) */
.floating-reaction {
    position: absolute;
    bottom: 80px; 
    left: 50%;
    font-size: 3.5rem; 
    line-height: 1;
    z-index: 101; 
    pointer-events: none;
    animation: floatUpFade 2s ease-out forwards;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
@keyframes floatUpFade { 
    0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 0; } 
    10% { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1.2); } 
    100% { transform: translateX(-50%) translateY(-400px) scale(1); opacity: 0; } 
}

/* ======================================================= */
/*      NOUVEAUX STYLES (EMOJIS NATIFS & UPLOAD)           */
/* ======================================================= */

/* --- 1. EMOJIS NATIFS (Performance) --- */
.react-icon-native {
    font-size: 1.3rem !important;
    line-height: 1;
    vertical-align: middle;
}

/* Bulles de stats (sous le post) */
.react-bubble.native {
    background: #fff; /* Fond blanc */
    font-size: 14px;  /* Taille emoji */
    border: none;     /* Plus de bordure image */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    display: flex; 
    align-items: center; 
    justify-content: center;
}

/* Animation au survol (Menu réaction) */
.react-icon-anim.native {
    font-size: 2rem; /* Gros emojis dans le menu */
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-block;
    padding: 0 5px;
}
.react-icon-anim.native:hover {
    transform: scale(1.3) translateY(-5px);
}

/* Dans les Stories */
.story-react-btn.native {
    font-size: 2rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    cursor: pointer;
}
.story-react-btn.native:hover {
    transform: scale(1.3);
}


/* --- 2. BOUTONS D'IMPORTATION (STYLE MODERNE) --- */

/* Cacher l'input file moche de base */
input[type="file"].custom-file-input {
    display: none;
}

/* Le Label qui sert de bouton */
.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background-color: #f0f2f5;
    border: 2px dashed #1877f2; /* Bordure pointillée bleue */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #1877f2;
    font-weight: 600;
    box-sizing: border-box;
    margin-top: 10px;
    margin-bottom: 5px;
}

.file-upload-label:hover {
    background-color: #e7f3ff;
}

.file-upload-label i {
    font-size: 1.5rem;
}

/* Zone pour afficher le nom du fichier choisi */
.file-name-display {
    font-size: 0.85rem;
    color: #2ebb43; /* Vert */
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    height: 20px; /* Hauteur fixe pour éviter le saut */
}

/* Mode sombre */
[data-theme="dark"] .file-upload-label {
    background-color: #242526;
    border-color: #2d88ff;
    color: #2d88ff;
}
[data-theme="dark"] .file-upload-label:hover {
    background-color: #3a3b3c;
}

/* Menu contextuel dans les Reels */
.reel-actions-bar .options-menu {
    right: 60px !important; /* Pousse le menu vers la gauche du bouton */
    bottom: 0 !important;
    top: auto !important;
    left: auto !important;
    width: 160px;
    background: white;
    color: black;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
}

.reel-actions-bar .options-menu button {
    color: black;
    text-align: left;
    padding: 12px;
    width: 100%;
}
.reel-actions-bar .options-menu button:hover {
    background: #f0f2f5;
}

/* --- STORY EN COURS D'UPLOAD --- */
.story-card.uploading {
    opacity: 0.8;
    pointer-events: none; /* On ne peut pas cliquer dessus pendant l'envoi */
    border: 2px solid #1877f2; /* Bordure bleue pour dire "C'est actif" */
}

.upload-overlay {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(255, 255, 255, 0.4); /* Le voile blanc */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(2px);
}

.upload-spinner-box {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cercle qui tourne */
.upload-spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #1877f2; /* Bleu Facebook */
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

.upload-text {
    font-size: 0.75rem;
    font-weight: 800;
    color: #1877f2;
    margin-top: 5px;
    text-shadow: 0 0 2px white;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ======================================================= */
/*      OPTIMISATION MOBILE : STORIES (EFFET 3.5 CARTES)   */
/* ======================================================= */

@media (max-width: 768px) {
    /* 1. Ajustement de la taille des cartes */
    .story-card {
        /* 
           28vw = 28% de la largeur de l'écran.
           28% x 3 = 84% + les espaces (gaps) = ~95%.
           Il reste donc ~5% pour afficher le bout de la 4ème carte.
        */
        width: 28vw !important; 
        
        /* On fixe des limites pour que ça ne devienne ni trop petit ni trop gros */
        min-width: 95px !important;
        max-width: 110px !important;
        
        /* On réduit proportionnellement la hauteur pour ne pas déformer */
        height: 170px !important; 
    }

    /* 2. Ajustement du conteneur (Rail) */
    .stories-tray {
        height: 180px !important; /* Ajusté à la nouvelle hauteur des cartes */
        gap: 8px; /* Espacement entre les cartes */
        
        /* Padding pour que la 1ère carte ne colle pas au bord gauche */
        padding-left: 10px; 
        padding-right: 10px;
    }
    
    /* 3. Ajustement de la carte "Créer" (interne) */
    .create-card-footer {
        padding-top: 15px !important; /* Un peu moins d'espace car la carte est plus petite */
    }
    
    .create-btn-circle {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
        top: -16px !important; /* Remonté légèrement */
    }
}

/* --- CERCLE STORY AUTOUR AVATAR --- */
.has-story-ring {
    border: 3px solid #1877f2 !important; /* Bleu Facebook */
    padding: 2px; /* Espace entre l'image et le cercle */
    background-clip: content-box; /* L'image ne déborde pas sur le padding */
    box-sizing: border-box;
}

/* --- MODALE VISIONNEUSE PHOTO DE PROFIL --- */
#profile-pic-modal .modal-card {
    background: transparent;
    box-shadow: none;
    border: none;
    width: 100%;
    height: 100%;
    justify-content: center;
}
#profile-pic-full {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background: black;
}

/* --- MENU OPTION AVATAR (Story ou Photo) --- */
#avatar-options-modal .modal-card {
    width: 300px;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
}
.avatar-option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 15px 20px;
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.avatar-option-btn:hover { background: #f0f2f5; }
.avatar-option-btn:last-child { border-bottom: none; }

/* --- CERCLE STORY AUTOUR AVATAR --- */
.has-story-ring {
    border: 3px solid #1877f2 !important; /* Bleu Facebook */
    padding: 2px; /* Espace entre l'image et le cercle */
    background-clip: content-box; /* L'image ne déborde pas sur le padding */
    box-sizing: border-box;
}

/* --- MODALE VISIONNEUSE PHOTO DE PROFIL --- */
#profile-pic-modal .modal-card {
    background: transparent;
    box-shadow: none;
    border: none;
    width: 100%;
    height: 100%;
    justify-content: center;
}
#profile-pic-full {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background: black;
}

/* --- MENU OPTION AVATAR (Story ou Photo) --- */
#avatar-options-modal .modal-card {
    width: 300px;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
}
.avatar-option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 15px 20px;
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.avatar-option-btn:hover { background: #f0f2f5; }
.avatar-option-btn:last-child { border-bottom: none; }

/* ======================================================= */
/*      OPTIMISATION ÉDITEUR DE POST (MOBILE)              */
/* ======================================================= */

@media (max-width: 768px) {
    /* 1. Ciblage de la barre d'action dans l'éditeur (Accueil, Profil, Groupe, Page) */
    #view-home .card > div[style*="border-top"] > div:first-child span,
    #profile-post-card > div[style*="border-top"] > div:first-child span,
    #group-post-box > div[style*="border-top"] > div:first-child span,
    #page-post-box > div[style*="border-top"] > div:first-child span {
        font-size: 0 !important;   /* Cache le texte (Photo, Vidéo...) */
        padding: 10px !important;  /* Transforme en bouton carré */
        margin-right: 0 !important;
    }

    /* 2. On rétablit la taille des icônes */
    #view-home .card > div[style*="border-top"] > div:first-child span i,
    #profile-post-card > div[style*="border-top"] > div:first-child span i,
    #group-post-box > div[style*="border-top"] > div:first-child span i,
    #page-post-box > div[style*="border-top"] > div:first-child span i {
        font-size: 1.4rem !important; /* Icône un peu plus grosse pour le tactile */
        margin-right: 0 !important;   /* Enlève la marge à droite de l'icône */
    }

    /* 3. Ajustement du conteneur parent pour gagner de la place */
    #view-home .card > div[style*="border-top"],
    #profile-post-card > div[style*="border-top"],
    #group-post-box > div[style*="border-top"],
    #page-post-box > div[style*="border-top"] {
        padding-top: 10px !important;
        gap: 5px !important; /* Réduit l'espace entre le groupe d'icônes et le bouton Publier */
    }

    /* 4. On s'assure que le bouton "Publier" reste visible et beau */
    button[onclick*="publish"] {
        padding: 8px 15px !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important; /* Empêche le texte de passer à la ligne */
        flex-shrink: 0; /* Empêche le bouton d'être écrasé */
    }
}

/* ======================================================= */
/*      CORRECTIF LAOKA MOBILE (GRILLE COUPÉE)             */
/* ======================================================= */

@media (max-width: 768px) {
    #laoka-feed {
        /* 1. Force les colonnes à ne pas dépasser l'écran */
        /* minmax(0, 1fr) est une astuce CSS vitale pour empêcher le débordement */
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        
        /* 2. Réduit l'espace entre les cartes (10px -> 6px) pour gagner de la place */
        gap: 6px !important;
        
        /* Enlève les marges négatives potentielles */
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. Réduit la hauteur de l'image sur mobile (pour l'esthétique) */
    /* On cible la div qui contient l'image de fond */
    #laoka-feed .card > div:first-child {
        height: 130px !important; /* 180px -> 130px */
    }

    /* 4. Ajuste le padding du texte pour gagner de la place */
    #laoka-feed .card > div:last-child {
        padding: 8px !important;
    }
    
    /* 5. Réduit légèrement la taille du titre du plat */
    #laoka-feed .card div[style*="font-size:1rem"] {
        font-size: 0.9rem !important;
    }
}

/* Modification optionnelle pour les miniatures vidéo */
.video-thumbnail {
    /* On garde le ratio carré pour la grille, ou on peut changer en 9/16 si vous préférez des rectangles verticaux */
    aspect-ratio: 9 / 16 !important; /* Format TikTok plus joli pour les Reels */
    background-color: #000;
}

/* Si vous préférez garder des carrés comme Instagram, ne mettez pas la règle ci-dessus */

/* ======================================================= */
/*      STYLE "GRAND CADRE STORY" (PROFIL)                 */
/* ======================================================= */

.big-story-card {
    position: relative;
    width: 100%;
    height: 400px; /* Grande hauteur pour bien voir */
    background: black;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.big-story-card:active {
    transform: scale(0.98);
}

/* Le dégradé noir en bas pour lire le texte */
.big-story-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 10;
    box-sizing: border-box;
}

/* Le petit cercle avec la photo en haut à gauche */
.big-story-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 3px;
    background: white; /* Bordure blanche interne */
    z-index: 10;
}

/* Animation cercle bleu autour de la photo */
.story-ring-anim {
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 3px solid #1877f2;
    z-index: 1;
}

/* Ajustement Mobile */
@media (max-width: 768px) {
    .big-story-card {
        height: 500px; /* Plus haut sur mobile (format portrait) */
        border-radius: 0; /* Pleine largeur sur mobile */
        margin-left: -10px; /* Compense le padding du container */
        margin-right: -10px;
        width: calc(100% + 20px);
    }
}

/* ==================================================================
   CORRECTIF FINAL : HIÉRARCHIE DES CALQUES (Z-INDEX)
   (À coller tout en bas de style.css)
================================================================== */

/* NIVEAU 1 : NAVIGATION & HEADER (Base) */
header, 
.mobile-header,
.desktop-header {
    z-index: 1500 !important; /* <--- PASSÉ DE 100 À 1500 POUR PASSER AU-DESSUS DES SIDEBARS */
}

/* NIVEAU 2 : MENUS DÉROULANTS & BULLES CHAT */
.notif-dropdown, 
.search-dropdown, 
.options-menu,
.chat-dropdown-menu,
.general-emoji-popup,
.message-react-popup,
.custom-emoji-popup,
#chats-wrapper {
    z-index: 2000 !important; /* On s'assure que les menus déroulants sont encore au-dessus */
}

/* ======================================================= */
/*      VUE REELS (OPTIMISÉE MOBILE & PERFORMANCE)         */
/* ======================================================= */
#view-reels {
    /* 1. Positionnement Fixe = Le processeur ne recalcule pas le fond */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    
    /* 2. La clé du succès sur mobile : 100dvh (Dynamic Height) */
    /* Ça évite que la barre d'adresse du navigateur ne cache le bas */
    height: 100dvh; 
    
    background: #000;
    
    /* 3. Niveau de superposition (Z-Index) */
    z-index: 2000 !important;
    
    /* 4. Sécurité */
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    display: none; /* Caché par défaut */
}

/* NIVEAU 4 : MODALES STANDARDS (Création, Paramètres, Profil) */
.modal-overlay,
#create-market-modal,
#create-radar-modal,
#create-help-modal,
#create-laoka-modal,
#create-group-modal,
#create-page-modal,
#edit-profile-modal,
#settings-modal,
#react-modal,
#share-modal,
#select-crush-modal,
#reel-comments-modal {
    z-index: 3000 !important;
}

/* NIVEAU 5 : MODALES CRITIQUES (Alertes, Confirmations, Boom) */
/* Doivent toujours passer au-dessus des modales standards */
#alert-modal,
#confirm-modal,
#match-boom-modal,
#create-alert-modal, /* Alerte Quartier Urgent */
#modal { /* Fenêtre Modifier/Supprimer générique */
    z-index: 200000 !important;
}

/* NIVEAU 6 : SYSTÈME (Splash Screen, PWA, Video Plein Écran) */
#pwa-install-popup {
    z-index: 5000 !important;
}

/* Le Splash Screen doit masquer tout le reste au démarrage */
#glow-splash-screen {
    z-index: 9999 !important;
}

/* Le lecteur vidéo en plein écran doit être le roi absolu */
.plyr--fullscreen-active {
    z-index: 2147483647 !important; /* Max Integer CSS */
}

/* --- STYLE AUTHENTIFICATION AMÉLIORÉ --- */

/* Wrapper pour positionner l'oeil */
.password-wrapper {
    position: relative;
    width: 100%;
}

/* L'input prend toute la largeur */
.password-wrapper input {
    width: 100%;
    padding-right: 40px; /* Espace pour l'icône */
}

/* L'icône Oeil */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #65676b;
    font-size: 1rem;
    z-index: 5;
    /* Ajustement si l'input a une marge bottom */
    margin-top: -2px; 
}

/* Liens en bas des cartes (Mdp oublié / Créer compte) */
.auth-links {
    margin-top: 20px;
    font-size: 0.95rem;
    color: #1877f2;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.auth-links span {
    cursor: pointer;
}
.auth-links span:hover {
    text-decoration: underline;
}
.auth-links .separator {
    color: #ccc;
    text-decoration: none;
    cursor: default;
}

/* Footer (CGU, About...) */
.auth-footer {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    font-size: 0.75rem;
    color: #8a8d91;
}

.auth-footer a {
    color: #65676b;
    text-decoration: none;
    margin: 0 2px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Mode sombre pour ces éléments */
[data-theme="dark"] .toggle-password { color: #b0b3b8; }
[data-theme="dark"] .auth-footer { border-top-color: #3e4042; }
[data-theme="dark"] .auth-footer a { color: #b0b3b8; }

/* --- PIED DE PAGE SIDEBAR GAUCHE --- */
.sidebar-footer-text {
    padding: 15px 10px;
    font-size: 0.75rem;
    color: #65676b;
    line-height: 1.5;
    margin-top: 10px;
}

.sidebar-footer-text a {
    color: #65676b;
    text-decoration: none;
}

.sidebar-footer-text a:hover {
    text-decoration: underline;
}

.powered-by {
    font-weight: normal;      /* Même épaisseur que le copyright */
    color: inherit;           /* Prend la couleur grise du parent (comme le copyright) */
    margin-top: 2px;
    font-size: inherit;       /* Même taille */
    text-transform: none;     /* Enlève les MAJUSCULES forcées */
    letter-spacing: normal;   /* Enlève l'espacement large */
}

/* Mode Sombre pour le pied de page */
[data-theme="dark"] .sidebar-footer-text,
[data-theme="dark"] .sidebar-footer-text a {
    color: #b0b3b8;
}

[data-theme="dark"] .powered-by {
    color: #2d88ff; /* Bleu clair pour le mode sombre */
}

/* Ajustement icône "À propos" en mode sombre */
[data-theme="dark"] .fa-circle-info {
    color: #b0b3b8 !important;
}

/* --- STATUTS LISTE DISCUSSION --- */

/* 1. Compteur Rouge (à gauche) */
.conv-unread-badge {
    background: #e41e3f;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 2px;
    border-radius: 10px;
    margin-right: 6px;
    min-width: 14px;
    text-align: center;
    display: inline-block;
}

/* 2. Icône "Envoyé" (Check) - Mise à jour marges */
.conv-status-check {
    font-size: 0.75rem;
    color: #65676b;
    margin-left: 5px; /* Espace après la date */
    margin-right: 0;  /* Plus de marge à droite */
}

/* 3. Icône "Vu" (Avatar) - Mise à jour marges */
.conv-seen-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 5px; /* Espace après la date */
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    vertical-align: middle;
    display: inline-block;
}

/* Flexbox pour aligner le tout sur une ligne */
.msg-page-snippet {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

/* Le texte prend toute la place disponible */
.snippet-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1; 
}

/* --- APERÇU FICHIER CHAT (AVANT ENVOI) --- */
/* --- APERÇU FICHIERS MULTIPLES --- */
.chat-attachment-preview {
    display: none;
    padding: 10px;
    background: #f0f2f5;
    border-top: 1px solid #ddd;
    flex-direction: column; /* Changement : Colonne pour séparer titre et images */
    gap: 5px;
    position: relative;
}

.att-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.85rem;
    color: #65676b;
    font-weight: bold;
}

.att-preview-list {
    display: flex;
    gap: 8px;
    overflow-x: auto; /* Scroll horizontal */
    padding-bottom: 5px;
    width: 100%;
}

/* Scrollbar fine */
.att-preview-list::-webkit-scrollbar { height: 4px; }
.att-preview-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.att-thumb-item {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.att-thumb {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #ccc;
    background: black;
}

.att-video-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- DRAG & DROP CHAT PC --- */
.chat-window {
    transition: all 0.2s;
    position: relative; /* Important pour l'overlay */
}

/* Classe ajoutée quand on survole avec un fichier */
.chat-window.drag-over {
    border: 2px dashed #1877f2 !important;
    background-color: rgba(24, 119, 242, 0.05); /* Fond bleu très léger */
}

/* Message "Lâcher ici" qui apparaît au survol */
.chat-window.drag-over::after {
    content: 'Lâcher le fichier ici';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1877f2;
    z-index: 100;
    pointer-events: none; /* Laisse passer le drop */
    border-radius: 8px 8px 0 0;
}


/* --- MENU CHAT CENTRÉ (OVERLAY) --- */
.chat-center-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85); /* Fond blanc semi-transparent */
    backdrop-filter: blur(2px); /* Léger flou */
    z-index: 2000; /* Au-dessus des messages */
    display: none; /* Caché par défaut */
    align-items: center;
    justify-content: center;
    border-radius: 8px; /* Pour suivre les coins de la fenêtre */
    animation: fadeIn 0.2s;
}

.chat-center-menu {
    background: white;
    width: 200px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
    overflow: hidden;
    animation: scaleUp 0.2s;
}

.chat-center-item {
    padding: 12px 15px;
    font-size: 0.95rem;
    color: #050505;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.chat-center-item:hover {
    background-color: #f0f2f5;
}

.chat-center-item:last-child {
    border-bottom: none;
}

.chat-center-item i {
    font-size: 1.1rem;
    color: #65676b;
    width: 20px;
    text-align: center;
}

.chat-center-item.delete { color: #e41e3f; font-weight: bold; }
.chat-center-item.delete i { color: #e41e3f; }

/* Mode Sombre */
[data-theme="dark"] .chat-center-overlay { background: rgba(24, 25, 26, 0.85); }
[data-theme="dark"] .chat-center-menu { background: #242526; border-color: #3e4042; }
[data-theme="dark"] .chat-center-item { color: #e4e6eb; border-bottom-color: #3e4042; }
[data-theme="dark"] .chat-center-item:hover { background-color: #3a3b3c; }


/* --- MENU MOBILE MESSAGE (APPUI LONG) --- */
.mobile-msg-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); /* Fond sombre */
    z-index: 200000; /* Au-dessus de tout */
    display: none;
    align-items: flex-end; /* Colle en bas */
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.mobile-msg-overlay.show {
    display: flex;
    opacity: 1;
}

.mobile-msg-sheet {
    background: white;
    width: 100%;
    max-width: 500px; /* Pour tablettes */
    border-radius: 20px 20px 0 0;
    padding: 20px 15px;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.mobile-msg-overlay.show .mobile-msg-sheet {
    transform: translateY(0);
}

/* ZONE RÉACTIONS (Ligne 1) */
.mob-sheet-reactions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f2f5;
}

.mob-react-big {
    font-size: 2rem;
    transition: transform 0.2s;
    cursor: pointer;
}
.mob-react-big:active { transform: scale(1.4); }

.mob-react-plus {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex; align-items: center; justify-content: center;
    color: #65676b;
    font-size: 1.2rem;
}

/* ZONE ACTIONS (Ligne 2) */
.mob-sheet-list {
    display: flex;
    flex-direction: column;
}

.mob-action-item {
    padding: 12px 10px;
    font-size: 1rem;
    color: #050505;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 8px;
}
.mob-action-item:active { background: #f2f2f2; }

.mob-action-item i {
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
    color: #65676b;
}

.mob-action-item.delete { color: #e41e3f; }
.mob-action-item.delete i { color: #e41e3f; }

/* Dark Mode */
[data-theme="dark"] .mobile-msg-sheet { background: #242526; }
[data-theme="dark"] .mob-sheet-reactions { border-bottom-color: #3e4042; }
[data-theme="dark"] .mob-action-item { color: #e4e6eb; }
[data-theme="dark"] .mob-react-plus { background: #3a3b3c; color: #e4e6eb; }

/* --- INDICATEUR TYPING DANS LA LISTE (MINI) --- */
.list-typing-indicator {
    display: none; /* Caché par défaut */
    align-items: center;
    gap: 3px;
    background: #f0f2f5;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
    height: 16px;
}

.list-typing-dot {
    width: 4px;
    height: 4px;
    background: #65676b;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.list-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.list-typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Support Dark Mode */
[data-theme="dark"] .list-typing-indicator {
    background: #3a3b3c;
}
[data-theme="dark"] .list-typing-dot {
    background: #b0b3b8;
}

/* --- APERÇU DE LIEN DANS LE CHAT (BULLE) --- */
.chat-link-card {
    margin-top: 5px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1);
    max-width: 300px;
}

/* Ajustement pour mes messages (fond bleu) */
.msg-me .chat-link-card {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.chat-link-img {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
}

.chat-link-info {
    padding: 8px;
}

.chat-link-domain {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.chat-link-title {
    font-weight: bold;
    font-size: 0.9rem;
    line-height: 1.2;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- ZONE APERÇU AVANT ENVOI (AU-DESSUS DE L'INPUT) --- */
.chat-draft-preview {
    position: absolute;
    bottom: 100%; /* Juste au-dessus de la barre */
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    padding: 8px;
    box-sizing: border-box;
    display: none; /* Caché par défaut */
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.draft-link-card {
    display: flex;
    background: #f0f2f5;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.draft-link-img {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.draft-link-info {
    padding: 8px;
    flex: 1;
    min-width: 0;
}

.draft-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

/* Dark Mode */
[data-theme="dark"] .chat-draft-preview { background: #242526; border-color: #3e4042; }
[data-theme="dark"] .draft-link-card { background: #3a3b3c; }


/* --- COULEUR DES LIENS DANS LE CHAT --- */

/* Par défaut (Message reçu / Fond gris) : Bleu */
.post-link {
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
}

/* CAS SPÉCIFIQUE : Message envoyé (Fond bleu) : Blanc */
.msg-me .post-link {
    color: white !important;
    text-decoration: underline; /* Souligné pour bien voir que c'est un lien */
}

/* Mode sombre : on s'assure que le lien reste lisible */
[data-theme="dark"] .msg-them .post-link {
    color: #4599ff; /* Bleu clair sur fond gris foncé */
}

/* --- BARRE CONTACTS ACTIFS MOBILE --- */
.mobile-active-contacts {
    display: flex;
    gap: 15px;
    padding: 12px 15px;
    background: white;
    overflow-x: auto; /* Permet le scroll horizontal */
    scrollbar-width: none; /* Cache scrollbar Firefox */
    border-bottom: 1px solid #ddd;
    min-height: 85px; /* Hauteur fixe pour éviter le saut */
    align-items: flex-start;
}

/* Cache scrollbar Chrome/Safari */
.mobile-active-contacts::-webkit-scrollbar { 
    display: none; 
}

.mob-contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    min-width: 60px; /* Largeur min pour bien cliquer */
    position: relative;
}

.mob-contact-avatar-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
}

.mob-contact-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
}

/* Point vert (En ligne) */
.mob-contact-dot {
    position: absolute;
    
    /* MODIFICATION ICI : On met à 0 pour le pousser vers l'extérieur */
    bottom: -2px;
    right: -2px;
    
    width: 13px;
    height: 13px;
    background: #31a24c;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 10;
}

.mob-contact-name {
    font-size: 0.75rem;
    color: #65676b;
    margin-top: 5px;
    text-align: center;
    width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Coupe le nom s'il est trop long */
}

/* Dark Mode */
[data-theme="dark"] .mobile-active-contacts {
    background-color: var(--fb-card-bg);
    border-bottom-color: var(--fb-border);
}
[data-theme="dark"] .mob-contact-dot {
    border-color: var(--fb-card-bg);
}

/* --- LISTE CONTACTS DÉFILANTE (SIDEBAR DROITE) --- */
#right-contacts-list {
    /* Hauteur pour afficher environ 5 contacts (5 x ~52px) */
    max-height: 260px; 
    
    /* Active le scroll vertical si la liste dépasse */
    overflow-y: auto;
    
    /* Esthétique : petite marge en bas */
    margin-bottom: 5px;
    
    /* Scrollbar fine (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Scrollbar fine (Chrome, Edge, Safari) */
#right-contacts-list::-webkit-scrollbar {
    width: 6px;
}

#right-contacts-list::-webkit-scrollbar-track {
    background: transparent;
}

#right-contacts-list::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

/* Mode sombre pour la scrollbar */
[data-theme="dark"] #right-contacts-list {
    scrollbar-color: #3e4042 transparent;
}
[data-theme="dark"] #right-contacts-list::-webkit-scrollbar-thumb {
    background-color: #3e4042;
}

/* AJOUTEZ CECI DANS style.css */

.action-btn, 
.reaction-container,
.reactions-box,
.react-icon-native {
    /* Empêche la sélection de texte (Blue highlight) sur mobile et PC */
    -webkit-user-select: none; /* Safari / Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE */
    user-select: none;         /* Standard */
    
    /* Empêche le menu contextuel natif (Clic droit / Long press) sur mobile */
    -webkit-touch-callout: none; 
}

/* --- GRILLES PHOTO STYLE FACEBOOK --- */
.post-gallery-grid {
    display: grid;
    gap: 2px;
    width: 100%;
    overflow: hidden;
    margin-top: 5px;
    cursor: pointer;
}

/* 2 Photos : Côte à côte */
.gallery-2 {
    grid-template-columns: 1fr 1fr;
    height: 300px;
}

/* 3 Photos : 1 grosse à gauche, 2 petites à droite */
.gallery-3 {
    grid-template-columns: 1.5fr 1fr; /* Gauche plus large */
    grid-template-rows: 1fr 1fr;
    height: 350px;
}
.gallery-3 img:nth-child(1) {
    grid-row: 1 / 3; /* Prend toute la hauteur à gauche */
    height: 100%;
}

/* 4 Photos et plus : 1 grosse en haut, 3 petites en bas */
.gallery-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* CORRECTION : On équilibre mieux les lignes (60% hauteur pour la grande, 40% pour les petites) */
    grid-template-rows: 60% 40%; 
    height: 400px;
    gap: 2px;
}

.gallery-4 img:nth-child(1) {
    grid-column: 1 / 4; /* Toute la largeur en haut */
    height: 100%;
    width: 100%;
    object-fit: cover; /* Important pour ne pas déformer */
}

/* On s'assure que les petites images remplissent bien leur case */
.gallery-4 img:nth-child(2),
.gallery-4 img:nth-child(3),
.gallery-4 .gallery-overlay-container {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* Style commun des images */
.post-gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* L'overlay "+X" sur la dernière image */
.gallery-overlay-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- PREVIEW UPLOAD (GRILLE SUPPRESSION) --- */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
}

.btn-remove-img:hover {
    background: #e41e3f;
}

/* --- CORRECTION PRIORITÉ GALERIE (Au-dessus de tout) --- */
#gallery-viewer {
    z-index: 2147483647 !important; /* Maximum théorique CSS */
}

/* --- TEXTE EXTENSIBLE (STYLE FACEBOOK LITE) --- */
.expandable-text {
    cursor: pointer; /* Indique qu'on peut cliquer partout */
}

/* Le texte "Voir plus" */
.see-more-label {
    color: #65676b;
    font-weight: 600;
    font-size: 0.9rem;
}

/* En mode sombre, on éclaircit le "Voir plus" */
[data-theme="dark"] .see-more-label {
    color: #b0b3b8;
}

/* On s'assure que le texte complet respecte les retours à la ligne */
.expandable-text span {
    word-wrap: break-word;
}

/* --- DROPDOWN MENTIONS (@) --- */
.mention-dropdown {
    position: absolute; /* Sera positionné par JS */
    background: white;
    width: 250px;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #ddd;
    z-index: 2147483647 !important; /* Maximum absolu */
    display: none;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: 0.2s;
}

.mention-item:hover {
    background-color: #e7f3ff;
}

.mention-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.mention-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #050505;
}

/* Mode sombre */
[data-theme="dark"] .mention-dropdown {
    background: #242526;
    border-color: #3e4042;
}
[data-theme="dark"] .mention-item {
    border-bottom-color: #3e4042;
}
[data-theme="dark"] .mention-item:hover {
    background-color: #3a3b3c;
}
[data-theme="dark"] .mention-name {
    color: #e4e6eb;
}

/* Bouton Repositionner (Flottant sur la couverture - EN HAUT) */
.btn-reposition-cover {
    position: absolute !important;
    top: 15px !important;    /* <--- CHANGEMENT ICI (C'était bottom) */
    right: 15px !important;
    
    background: rgba(0, 0, 0, 0.6) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    z-index: 50 !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background 0.2s;
}

.btn-reposition-cover:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* --- CERCLES STORIES GLOBAUX --- */

/* Cercle BLEU (Story non vue) */
.story-ring-new {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1877f2; /* Blanc puis Bleu */
    border-radius: 50%;
    cursor: pointer;
    box-sizing: border-box;
}

/* Cercle GRIS (Story déjà vue) */
.story-ring-seen {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ccc; /* Blanc puis Gris */
    border-radius: 50%;
    cursor: pointer;
    box-sizing: border-box;
}

/* Animation au clic pour feedback */
.story-ring-new:active, .story-ring-seen:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* DANS style.css */

.reel-sound-btn {
    position: absolute;
    top: 70px;   /* <--- MODIFICATION : On descend le bouton pour qu'il soit visible */
    left: 20px;  /* Alignement gauche */
    z-index: 50;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
}

/* SELECTEUR EFFETS AUDIO */
.audio-effect-option input {
    display: none; /* Cache le bouton radio moche */
}

.effect-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #65676b;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.effect-box i {
    font-size: 1.2rem;
}

.effect-box span {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Quand c'est sélectionné */
.audio-effect-option input:checked + .effect-box {
    background: #e7f3ff;
    border-color: #1877f2;
    color: #1877f2;
    box-shadow: 0 2px 5px rgba(24, 119, 242, 0.2);
}

/* Mode sombre */
[data-theme="dark"] .effect-box { background: #3a3b3c; border-color: #3e4042; color: #b0b3b8; }
[data-theme="dark"] .audio-effect-option input:checked + .effect-box { background: rgba(24, 119, 242, 0.2); color: #2d88ff; border-color: #2d88ff; }

.audio-effect-option input[value="trap"]:checked + .effect-box {
    background: #f3e5f5 !important;
    border-color: #9c27b0 !important;
    color: #9c27b0 !important;
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.4) !important;
}

.filter-bubble {
    width: 50px; height: 50px; border-radius: 50%; 
    display:flex; align-items:center; justify-content:center;
    font-size: 0.7rem; font-weight:bold; color:#333;
    border: 2px solid white; cursor:pointer; flex-shrink:0;
    transition: transform 0.2s;
    text-shadow: 0 0 2px white;
}
.filter-bubble.selected { border: 2px solid #1877f2; transform: scale(1.1); }

/* MASQUES STUDIO (POUR PC) */
.studio-mask {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Noir semi-transparent */
    z-index: 5;
    backdrop-filter: blur(5px); /* Floute les côtés inutiles */
    pointer-events: none; /* Laisse passer les clics */
}

/* Calcul mathématique pour laisser un trou de ratio 9/16 au milieu */
/* Sur un écran large, on veut que le centre soit vide */
.mask-left {
    left: 0;
    width: calc(50% - (56.25vh / 2)); /* 56.25vh correspond à une largeur relative à la hauteur (9/16 = 0.5625) */
}

.mask-right {
    right: 0;
    width: calc(50% - (56.25vh / 2));
}

/* SUR MOBILE (Mode Portrait) : On cache les masques car l'écran est déjà au bon format */
@media (max-aspect-ratio: 9/16) {
    .studio-mask {
        display: none;
    }
    /* Sur mobile, on remplit tout l'écran */
    #studio-preview {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* Ici on peut zoomer pour remplir le téléphone */
    }
}

/* --- CORRECTIF STUDIO CAMÉRA (Remplissage écran Mobile) --- */
#view-studio video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Remplit l'écran comme Snapchat/TikTok */
    transform: scaleX(-1); /* Effet miroir selfie */
}

/* S'assurer que la validation passe au-dessus de la caméra live */
#studio-validation {
    z-index: 50 !important; /* Au-dessus de la preview (z-index 0) et des boutons (z-index 20) */
    background: black; /* Fond opaque pour cacher la caméra derrière */
}

/* --- OPTIMISATION REELS (Suppression UI lourde) --- */
.reel-video {
    /* On s'assure que la vidéo native remplit bien le conteneur */
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: black;
}

/* --- STUDIO : PANNEAU RÉTRACTABLE --- */
/* Le panneau blanc de validation */
.studio-controls-panel {
    padding: 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    width: 100%;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
    max-height: 75%;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animation fluide */
    z-index: 50;
}

/* Classe ajoutée quand on clique sur la flèche */
.studio-controls-panel.minimized {
    transform: translateY(calc(100% - 60px)); /* Ne laisse dépasser que le haut (60px) */
}

/* Le bouton flèche */
.studio-minimize-btn {
    width: 100%;
    text-align: center;
    padding-bottom: 15px;
    cursor: pointer;
    color: #ccc;
    font-size: 1.2rem;
}
.studio-minimize-btn:hover { color: #1877f2; }

/* --- BARRE DE PROGRESSION REELS --- */
.reel-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px; /* Très fin par défaut */
    background: rgba(255, 255, 255, 0.2);
    z-index: 50; /* Au-dessus de la vidéo */
    cursor: pointer;
    transition: height 0.2s;
}

/* Zone tactile plus grande pour faciliter le clic sur mobile */
.reel-progress-container::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 15px; /* Zone invisible cliquable */
    background: transparent;
}

/* Quand on touche/survole, la barre grossit un peu */
.reel-progress-container:hover {
    height: 8px;
}

.reel-progress-bar {
    height: 100%;
    width: 0%;
    background: #e41e3f; /* Rouge Glow (ou blanc si vous préférez) */
    transition: width 0.1s linear; /* Animation fluide */
}

/* --- OPTIMISATION D'AFFICHAGE (PC vs MOBILE) --- */

/* Par défaut (PC) : On veut voir toute la vidéo sans couper les têtes */
.reel-video {
    object-fit: contain !important; /* Ajoute des bandes noires propres */
    background-color: #000;
}

/* Sur Mobile (Écran vertical) : On veut l'immersion totale */
@media (max-width: 768px) {
    .reel-video {
        object-fit: cover !important; /* Remplit tout l'écran */
    }
}

/* Ajouter à style.css */
.group-card-cover, .cover-photo {
    background-color: #ddd; /* Gris clair par défaut */
    min-height: 150px;      /* Force une hauteur même si l'image est cassée */
}

/* Badge automatique pour les liens Drive dans le texte */
.drive-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #e7f3ff;
    color: #1877f2;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0 2px;
    border: 1px solid rgba(24, 119, 242, 0.2);
    transition: 0.2s;
}

.drive-badge:hover {
    background-color: #1877f2;
    color: white;
    text-decoration: none;
}

/* Mode sombre */
[data-theme="dark"] .drive-badge {
    background-color: rgba(24, 119, 242, 0.2);
    color: #4599ff;
    border-color: #4599ff;
}

/* --- FIX : LISTE DES SPECTATEURS DE STORY AU-DESSUS DE LA STORY --- */
#story-viewers-modal {
    z-index: 60000 !important;
}

/* --- BOUTIQUE IA ORANGE MONEY --- */
.topup-pack {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.topup-pack:hover {
    border-color: #ff6600;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.15);
    transform: translateY(-2px);
}

.topup-pack.popular {
    border-color: #ff6600;
    background: #fffaf5;
}

.topup-popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff6600;
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.topup-credits {
    font-size: 1.6rem;
    font-weight: 900;
    color: #1c1e21;
}

.topup-label {
    font-size: 0.9rem;
    color: #65676b;
    margin-left: 5px;
}

.topup-price {
    background: #1877f2;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    padding: 8px 15px;
    border-radius: 20px;
}

/* ======================================================= */
/*                  ESPACE ADMINISTRATION (SaaS)           */
/* ======================================================= */

/* Le Conteneur principal qui bloque tout l'écran */
#view-admin {
    position: fixed;
    top: 56px; /* Juste en dessous du header PC */
    left: 0;
    width: 100vw;
    height: calc(100vh - 56px);
    background: #f0f2f5;
    z-index: 50000; /* Par-dessus tout le site */
    flex-direction: row;
    overflow: hidden;
}

/* LA NOUVELLE SIDEBAR GAUCHE ADMIN */
.admin-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* Empêche l'écrasement */
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.admin-sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #eee;
}

.admin-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.admin-menu-item {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #65676b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.admin-menu-item:hover {
    background: #f0f2f5;
    color: #1c1e21;
}

.admin-menu-item.active {
    background: #e7f3ff;
    color: #1877f2;
    border-left-color: #1877f2;
}

.admin-menu-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.admin-badge {
    background: #e41e3f;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto; /* Pousse le badge tout à droite */
}

.admin-quit-zone {
    padding: 20px;
    border-top: 1px solid #eee;
}

/* LE CONTENU CENTRAL */
.admin-main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f0f2f5;
}

.admin-main-content-inner {
    max-width: 1100px; /* Très large pour afficher plein de data */
    margin: 0 auto;
}

/* Cache l'en-tête mobile de l'admin sur PC */
.admin-mobile-header {
    display: none;
}

/* Grilles & Cartes */
.admin-grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.admin-stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.admin-stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: #1c1e21;
    margin-bottom: 5px;
}

.admin-stat-card .stat-label {
    font-size: 0.9rem;
    color: #65676b;
    font-weight: bold;
    text-transform: uppercase;
}

.admin-list-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}
.admin-list-item:last-child { border-bottom: none; }
.admin-list-item:hover { background-color: #f9f9f9; }

/* Boutons */
.btn-admin-action {
    border: none; padding: 8px 15px; border-radius: 8px; font-size: 0.85rem; font-weight: bold; cursor: pointer; transition: 0.2s;
}
.btn-admin-danger { background: #ffebee; color: #e41e3f; }
.btn-admin-danger:hover { background: #e41e3f; color: white; }
.btn-admin-success { background: #e8f5e9; color: #2ebb43; }
.btn-admin-success:hover { background: #2ebb43; color: white; }
.btn-admin-neutral { background: #f0f2f5; color: #1c1e21; }
.btn-admin-neutral:hover { background: #e4e6eb; }

/* ============================================== */
/* RESPONSIVE MOBILE POUR L'ADMIN                 */
/* ============================================== */
@media (max-width: 768px) {
    #view-admin {
        top: 0; /* Prend l'écran depuis tout en haut */
        height: 100dvh;
        flex-direction: column; /* La sidebar passe au-dessus */
        z-index: 200000;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto; /* Scroll horizontal pour le menu */
        padding: 0;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    /* On cache l'en-tête et le bouton quitter de la sidebar sur mobile */
    .admin-sidebar-header, .admin-quit-zone {
        display: none;
    }

    .admin-sidebar-scroll {
        display: flex;
        padding: 0;
    }

    .admin-menu-item {
        padding: 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap; /* Empêche le retour à la ligne */
    }

    .admin-menu-item.active {
        border-left-color: transparent;
        border-bottom-color: #1877f2;
    }

    .admin-main-content {
        padding: 15px;
    }

    /* Affiche le bouton retour mobile */
    .admin-mobile-header {
        display: block;
        background: white;
        padding: 15px;
        font-weight: bold;
        color: #1c1e21;
        border-radius: 8px;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        cursor: pointer;
    }
}

/* Mode sombre */
[data-theme="dark"] #view-admin, [data-theme="dark"] .admin-main-content { background: #18191a; }
[data-theme="dark"] .admin-sidebar { background: #242526; border-color: #3e4042; }
[data-theme="dark"] .admin-sidebar-header { border-color: #3e4042; color: white; }
[data-theme="dark"] .admin-sidebar-header span { color: white !important; }
[data-theme="dark"] .admin-menu-item { color: #b0b3b8; }
[data-theme="dark"] .admin-menu-item:hover { background: #3a3b3c; color: white; }
[data-theme="dark"] .admin-menu-item.active { background: rgba(24, 119, 242, 0.2); }
[data-theme="dark"] .admin-quit-zone { border-color: #3e4042; }
[data-theme="dark"] .admin-quit-zone button { background: #3a3b3c !important; color: white !important; border-color: #4e4f50 !important; }
[data-theme="dark"] .admin-stat-card, [data-theme="dark"] .admin-list-item, [data-theme="dark"] .admin-mobile-header { background: #242526; border-color: #3e4042; color: white; }[data-theme="dark"] .admin-stat-card .stat-value { color: white; }[data-theme="dark"] .admin-list-item:hover { background: #3a3b3c; }


/* ==================================================================
   BOUTONS DE SÉLECTION DE PAIEMENT (MVOLA / ORANGE MONEY)
================================================================== */

/* 1. Base commune des boutons (Opaque et cliquable) */
.payment-method-box {
    flex: 1;
    background: #ffffff; /* Fond blanc par défaut */
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 1; /* On enlève l'ancien effet transparent/grisé */
}

.payment-method-box i {
    font-size: 1.8rem;
}

.payment-method-box .brand-title {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* =========================================
   ÉTATS INACTIFS (NON SÉLECTIONNÉS)
========================================= */

/* Orange Money - Inactif (Contour Orange) */
#select-om, #coach-select-om {
    border: 2px solid #ff6600; 
    color: #65676b; 
}
#select-om i, #coach-select-om i {
    color: #ff6600; 
}

/* MVola - Inactif (Contour Jaune, Texte/Icône Vert) */
#select-mvola, #coach-select-mvola {
    border: 2px solid #FFD700; 
    color: #00994d; 
}
#select-mvola i, #coach-select-mvola i {
    color: #00994d; 
}

#select-om:hover, #coach-select-om:hover { background: #fffaf5; }
#select-mvola:hover, #coach-select-mvola:hover { background: #eafff0; }

/* =========================================
   ÉTATS ACTIFS (SÉLECTIONNÉS)
========================================= */

/* Orange Money - SÉLECTIONNÉ */
.payment-method-box.active#select-om, 
.payment-method-box.active#coach-select-om {
    background: #ff6600; 
    color: #ffffff; 
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
}
.payment-method-box.active#select-om i,
.payment-method-box.active#select-om .brand-title,
.payment-method-box.active#coach-select-om i,
.payment-method-box.active#coach-select-om .brand-title {
    color: #ffffff; 
}

/* MVola - SÉLECTIONNÉ */
.payment-method-box.active#select-mvola, 
.payment-method-box.active#coach-select-mvola {
    background: #00994d; 
    border-color: #00994d; 
    box-shadow: 0 4px 15px rgba(0, 153, 77, 0.3);
}
.payment-method-box.active#select-mvola .brand-title,
.payment-method-box.active#select-mvola i,
.payment-method-box.active#coach-select-mvola .brand-title,
.payment-method-box.active#coach-select-mvola i {
    color: #FFD700; 
}

/* ======================================================= */
/*      CORRECTIF : ONGLETS IA DASHBOARD MOBILE            */
/* ======================================================= */
#view-ai-dashboard .profile-tabs {
    display: flex;
    flex-wrap: nowrap; 
    overflow-x: auto;  
    
    /* 1. On remet une scrollbar très fine sur Firefox */
    scrollbar-width: thin; 
    scrollbar-color: #ddd transparent;
    padding-bottom: 2px; /* Petit espace pour la barre */
}

/* 2. On remet une scrollbar très fine (3px) sur Chrome/Safari/Mobiles */
#view-ai-dashboard .profile-tabs::-webkit-scrollbar {
    display: block; /* On l'affiche (avant c'était none) */
    height: 3px;    /* Très fine pour rester jolie */
}
#view-ai-dashboard .profile-tabs::-webkit-scrollbar-track {
    background: transparent;
}
#view-ai-dashboard .profile-tabs::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 10px;
}

#view-ai-dashboard .profile-tab-item {
    white-space: nowrap; 
    /* 3. On réduit l'espacement et la police pour afficher plus d'onglets */
    padding: 10px 10px;  
    font-size: 0.8rem;   
    
    /* 4. Alignement parfait icône + texte */
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================================================================
   CORRECTIONS GLOBALES DU MODE SOMBRE (ANTI INLINE-STYLES)
================================================================== */

/* 1. ÉCRASER LES FONDS BLANCS ET GRIS CLAIR ÉCRITS EN DUR DANS LE JS ET HTML */
[data-theme="dark"] div[style*="background:white"],[data-theme="dark"] div[style*="background: white"],
[data-theme="dark"] div[style*="background-color: white"],
[data-theme="dark"] div[style*="background-color:white"],
[data-theme="dark"] div[style*="background:#fff"],[data-theme="dark"] div[style*="background: #fff"],
[data-theme="dark"] div[style*="background:#ffffff"],
[data-theme="dark"] div[style*="background: #ffffff"] {
    background-color: var(--fb-card-bg) !important;
    border-color: var(--fb-border) !important;
}

/* Écraser les fonds gris clair (zones de texte, cartes imbriquées) */[data-theme="dark"] div[style*="background:#f0f2f5"],[data-theme="dark"] div[style*="background: #f0f2f5"],[data-theme="dark"] div[style*="background:#f9f9f9"],
[data-theme="dark"] div[style*="background: #f9f9f9"],
[data-theme="dark"] div[style*="background:#f7f8fa"],
[data-theme="dark"] div[style*="background:#fafafa"] {
    background-color: var(--fb-input) !important;
    border-color: var(--fb-border) !important;
    color: var(--fb-text) !important;
}

/* 2. ÉCRASER LES TEXTES NOIRS ET GRIS FONCÉS POUR LES RENDRE BLANCS */
[data-theme="dark"] div[style*="color:#1c1e21"],[data-theme="dark"] div[style*="color: #1c1e21"],[data-theme="dark"] div[style*="color:#050505"],[data-theme="dark"] div[style*="color: #050505"],[data-theme="dark"] div[style*="color:#333"],
[data-theme="dark"] div[style*="color: #333"],
[data-theme="dark"] span[style*="color:#1c1e21"],
[data-theme="dark"] span[style*="color:#050505"],
[data-theme="dark"] span[style*="color:black"] {
    color: var(--fb-text) !important;
}

/* Rendre les sous-titres gris clairs et lisibles */
[data-theme="dark"] div[style*="color:#65676b"],
[data-theme="dark"] div[style*="color: #65676b"],
[data-theme="dark"] div[style*="color:#777"],[data-theme="dark"] span[style*="color:#65676b"],[data-theme="dark"] span[style*="color:#777"] {
    color: var(--fb-text-sec) !important;
}

/* 3. FIX SPÉCIFIQUE DES EN-TÊTES DE MODULES (Market, Radar, etc.) */
[data-theme="dark"] #view-market > div:first-child,[data-theme="dark"] #view-radar > div:first-child,
[data-theme="dark"] #view-lost-found > div:first-child,
[data-theme="dark"] #view-help > div:first-child,
[data-theme="dark"] #view-laoka > div:first-child,
[data-theme="dark"] #view-alerts > div:first-child {
    background-color: var(--fb-card-bg) !important;
    border: 1px solid var(--fb-border) !important;
    color: var(--fb-text) !important;
}

/* 4. FIX ONGLETS DE FILTRES (Tout, Ventes, Échanges...) */
[data-theme="dark"] .profile-tab-item {
    color: var(--fb-text-sec) !important;
}[data-theme="dark"] .profile-tab-item[style*="background:#f0f2f5"],[data-theme="dark"] .profile-tab-item[style*="background: #f0f2f5"] {
    background-color: var(--fb-input) !important;
}[data-theme="dark"] .profile-tab-item.active,
[data-theme="dark"] .profile-tab-item[style*="background:#e7f3ff"],
[data-theme="dark"] .profile-tab-item[style*="background: #e7f3ff"] {
    background-color: rgba(45, 136, 255, 0.2) !important;
    color: var(--fb-blue) !important;
}

/* 5. FIX DE L'ARÈNE (DÉBATS) */[data-theme="dark"] .debate-comments-area {
    background-color: var(--fb-bg) !important;
    border-top-color: var(--fb-border) !important;
}
[data-theme="dark"] .debate-col {
    border-color: var(--fb-border) !important;
}[data-theme="dark"] .debate-comment-card {
    background-color: var(--fb-card-bg) !important;
    color: var(--fb-text) !important;
    box-shadow: none !important;
    border-right: 1px solid var(--fb-border);
    border-top: 1px solid var(--fb-border);
    border-bottom: 1px solid var(--fb-border);
}[data-theme="dark"] .debate-load-more-btn {
    background-color: var(--fb-input) !important;
    color: var(--fb-text-sec) !important;
}
[data-theme="dark"] .debate-load-more-btn:hover {
    background-color: var(--fb-hover) !important;
    color: var(--fb-text) !important;
}

/* 6. FIX DU DASHBOARD IA (GEMINI) */
[data-theme="dark"] #view-ai-dashboard .card {
    background-color: var(--fb-card-bg) !important;
    border-color: var(--fb-border) !important;
}
[data-theme="dark"] #ai-logs-container > div,
[data-theme="dark"] #ai-payment-history-container > div {
    background-color: var(--fb-input) !important;
    border-color: var(--fb-border) !important;
    color: var(--fb-text) !important;
}[data-theme="dark"] #ai-logs-container > div > div[style*="background: #f0f2f5"],
[data-theme="dark"] #ai-logs-container > div > div[style*="background:#f0f2f5"] {
    background-color: var(--fb-card-bg) !important;
    color: var(--fb-text) !important;
}
[data-theme="dark"] #ai-credits-display {
    color: #ffffff !important; /* Force le compteur en blanc */
}

/* 7. FIX DES MENUS DÉROULANTS (3 POINTS) ET POPUPS */
[data-theme="dark"] .options-menu,
[data-theme="dark"] .filter-menu,
[data-theme="dark"] .chat-dropdown-menu {
    background-color: var(--fb-card-bg) !important;
    border-color: var(--fb-border) !important;
}
[data-theme="dark"] .options-menu button,[data-theme="dark"] .filter-menu button,
[data-theme="dark"] .chat-dropdown-item {
    color: var(--fb-text) !important;
}[data-theme="dark"] .options-menu button:hover,
[data-theme="dark"] .filter-menu button:hover,
[data-theme="dark"] .chat-dropdown-item:hover {
    background-color: var(--fb-hover) !important;
}

/* 8. FIX DU TEXTE DANS LES BULLES DE CHAT ET COMMENTAIRES */
[data-theme="dark"] .bubble,[data-theme="dark"] .chat-bubble {
    color: var(--fb-text) !important;
}[data-theme="dark"] .msg-them {
    background-color: var(--fb-input) !important;
}

/* 9. ASSURER QUE LES LIENS CLOIQUABLES RESTENT VISIBLES */
[data-theme="dark"] a,
[data-theme="dark"] .post-link {
    color: #4599ff !important; /* Bleu un peu plus clair pour ressortir sur le noir */
}

/* ==================================================================
   FIX : BOÎTES BLEUES CLAIRES EN MODE SOMBRE (Ex: Dashboard IA)
================================================================== */
[data-theme="dark"] div[style*="background: #e7f3ff"],
[data-theme="dark"] div[style*="background:#e7f3ff"] {
    background-color: rgba(24, 119, 242, 0.15) !important;
    border-color: rgba(45, 136, 255, 0.5) !important;
}

/* MODE SOMBRE POUR ESPACE AMBASSADEUR */
[data-theme="dark"] #view-ambassador .card { 
    background-color: var(--fb-card-bg) !important; 
    border-color: #2ebb43 !important; 
}
[data-theme="dark"] #view-ambassador div[style*="background: white"],
[data-theme="dark"] #view-ambassador div[style*="background:white"] {
    background-color: var(--fb-input) !important;
    border-color: var(--fb-border) !important;
}
[data-theme="dark"] #amb-promo-code { 
    color: #ffffff !important; 
}
[data-theme="dark"] #amb-total-earned, 
[data-theme="dark"] #amb-total-referrals,
[data-theme="dark"] #view-ambassador h3 { 
    color: #ffffff !important; 
}

/* Style du Toggle Switch (Bouton SMS IA) */
.switch input:checked + .slider {
    background-color: #2ebb43; /* Vert Glow quand activé */
}
.switch input:checked + .slider span {
    transform: translateX(24px); /* Pousse le rond vers la droite */
}

/* Style des boutons Switch SMS (Gris -> Vert) */
.switch input:checked + .slider {
    background-color: #2ebb43 !important; /* Vert Glow */
}
.switch input:checked + .slider span {
    transform: translateX(20px); /* Déplace le rond blanc */
}

/* Style Boutons Scénario Coach */
.coach-scenario-btn {
    background: white; border: 1px solid #ddd; padding: 8px 15px; border-radius: 20px;
    font-size: 0.85rem; font-weight: bold; color: #65676b; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.coach-scenario-btn.active {
    background: #e8f5e9; border-color: #2ebb43; color: #2ebb43;
}
[data-theme="dark"] .coach-scenario-btn { background: var(--fb-card-bg); border-color: var(--fb-border); }
[data-theme="dark"] .coach-scenario-btn.active { background: rgba(46, 187, 67, 0.2); }

/* Animation du micro */
@keyframes pulseMic {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}
.mic-listening {
    animation: pulseMic 1.5s infinite;
    display: block !important;
}

/* ==================================================================
   CORRECTIF DÉFINITIF : CENTRAGE DU FIL D'ACTUALITÉ SUR PC & STORIES
================================================================== */

@media (min-width: 1100px) {
    /* 1. On fige la barre de gauche */
    .sidebar-left {
        display: block !important;
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        width: 280px !important;
        height: calc(100vh - 56px) !important;
        background-color: var(--fb-bg, #f0f2f5) !important;
        z-index: 100 !important;
        overflow-y: auto !important;
    }

    /* 2. On fige la barre de droite (si elle existe) */
    .sidebar-right {
        display: block !important;
        position: fixed !important;
        top: 56px !important;
        right: 0 !important;
        width: 320px !important;
        height: calc(100vh - 56px) !important;
        z-index: 100 !important;
        overflow-y: auto !important;
    }

    /* 3. Le conteneur principal prend l'espace RESTANT entre les deux barres */
    .container, .container.profile-mode {
        margin-top: 0 !important;       
        margin-bottom: 0 !important;    
        margin-left: 280px !important;  
        margin-right: 320px !important; 
        max-width: none !important;
        display: block !important;      
        padding-top: 10px !important;   /* <--- Modifiez cette valeur (10px ou même 5px) */
        box-sizing: border-box !important;
    }
    
    /* 4. On centre parfaitement le fil d'actualité (590px) au milieu de cet espace */
    #view-home, #view-market, #view-radar, #view-lost-found,
    #view-alerts, #view-help, #view-laoka, #view-groups,
    #view-pages, #view-search, #view-profile,
    #view-single-group, #view-single-page, #view-ai-dashboard,
    #view-crush, #view-friends, #view-notifications, #view-messages,
    #view-ambassador, #view-lang-coach {
        width: 100% !important;
        max-width: 590px !important;
        margin: 0 auto !important; /* <-- C'est ceci qui centre parfaitement ! */
    }
}

/* ==================================================================
   5. CORRECTIF DES STORIES (Empêche l'empilement vertical)
================================================================== */
.stories-wrapper {
    width: 100% !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
}

.stories-tray {
    display: flex !important;
    flex-direction: row !important; /* Force l'alignement horizontal */
    flex-wrap: nowrap !important;   /* Interdit le retour à la ligne */
    gap: 8px !important;
    overflow-x: auto !important;    /* Permet le défilement horizontal */
    padding: 10px 0 !important;
}

.story-card {
    width: 112px !important;
    min-width: 112px !important;    /* Force la largeur stricte */
    height: 190px !important;
    flex-shrink: 0 !important;      /* Interdit l'écrasement de la carte */
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow: hidden !important;
}

.promo-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}