/* ==========================================================================
   STYLING DES STORIES (Design Immersif & Fluide)
   ========================================================================== */
.stories-bar { 
    display: flex; 
    gap: 14px; 
    overflow-x: auto; 
    padding: 6px 4px 18px 4px; 
    margin-bottom: 16px; 
    scrollbar-width: none; 
}
.stories-bar::-webkit-scrollbar { display: none; }
.story-item { flex: 0 0 auto; text-align: center; cursor: pointer; width: 70px; }
.story-avatar { 
    width: 66px; height: 66px; border-radius: 50%; background: var(--accent-gradient);
    padding: 2.5px; box-shadow: var(--shadow-glow);
    display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}
.story-avatar:hover { 
    transform: scale(1.08); 
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}
.story-inner { width: 100%; height: 100%; border-radius: 50%; background: var(--bg-deep); display: flex; align-items: center; justify-content: center; overflow: hidden; }
body.light-theme .story-inner { background: #ffffff; }
.story-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-label { font-size: 0.74rem; margin-top: 6px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }


/* ==========================================================================
   PANNEAU DE CONTRÔLE CONTEXTUEL (Autour du fil, sans concurrence)
   ========================================================================== */
#tab-feed > .feed-filters:first-of-type {
    background: #000000;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#tab-feed > .feed-filters:nth-of-type(2) {
    background: #000000;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-group { 
    display: flex; 
    gap: 6px; 
    flex-wrap: wrap; 
    align-items: center; 
}

.filter-chip { 
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(56, 189, 248, 0.2); 
    color: var(--text-muted);
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease;
}
.filter-chip:hover { 
    border-color: var(--accent-cyan); 
    color: var(--text-main); 
    background: rgba(56, 189, 248, 0.08);
}
.filter-chip.active { 
    background: var(--accent-cyan); 
    color: #000000; 
    border-color: transparent; 
    font-weight: 700; 
}


/* ==========================================================================
   BOÎTE DE CRÉATION DE PUBLICATION (Compact-post-box sur fond noir absolu)
   ========================================================================== */
.compact-post-box {
    background: #000000;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9);
}

.compact-post-box textarea {
    background: #050811;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 0.96rem;
    color: var(--text-main);
    resize: none;
    height: 90px;
    transition: all 0.25s ease;
}
.compact-post-box textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}


/* ==========================================================================
   PUBLICATIONS STYLE SOUVERAIN X (Lignes uniformes & Fond Noir Absolu)
   ========================================================================== */
.post-card { 
    background: #000000 !important; /* Fond noir totalement vide et profond */
    border: 1px solid rgba(56, 189, 248, 0.25); /* Ligne uniforme et nette */
    border-radius: 18px; /* Coins arrondis et uniformes */
    padding: 18px 20px; 
    margin-bottom: 20px; 
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(56, 189, 248, 0.1);
}

/* Post Épinglé mis en valeur */
.post-card.pinned { 
    border-color: var(--accent-cyan); 
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2), 0 10px 30px rgba(0, 0, 0, 0.8);
}

body.compact-mode .post-card { padding: 14px 18px; }

/* En-tête X : Disposition Flex (Avatar à gauche, Nom + Pseudo + Heure alignés) */
.post-header { 
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.92rem; 
}

/* Avatar de l'auteur dans le post */
.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--accent-cyan);
    cursor: pointer;
}

.post-user-meta {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.post-author-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-author-name {
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
}
.post-author-name:hover {
    text-decoration: underline;
}

.post-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Corps du texte du post (décalé pour s'aligner sous le pseudo, style X parfait) */
.post-content { 
    font-size: 0.95rem; 
    line-height: 1.6; 
    color: var(--text-main); 
    white-space: pre-wrap; 
    word-break: break-word; 
    margin-left: 56px; /* Aligne le texte proprement avec l'avatar de 44px + 12px de gap */
    margin-bottom: 12px;
}

/* Médias grand format immersifs avec coins arrondis et bordure nette */
.post-media { 
    width: calc(100% - 56px);
    margin-left: 56px; /* S'aligne avec le texte */
    border-radius: 14px; 
    margin-top: 6px; 
    max-height: 440px; 
    object-fit: cover; 
    background: #000; 
    cursor: pointer; 
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    transition: opacity 0.2s ease;
}
.post-media:hover { opacity: 0.95; }

/* Actions sous le post (Style icônes minimalistes éparpillées façon X) */
.post-actions { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: 14px; 
    margin-left: 56px; /* Aligné également avec le contenu */
    padding-top: 10px; 
    border-top: 1px solid rgba(255, 255, 255, 0.08); /* Ligne uniforme de séparation */
    max-width: 90%;
    font-size: 0.85rem; 
    color: var(--text-muted); 
}
.post-actions span { 
    cursor: pointer; 
    font-weight: 500; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 6px 10px;
    border-radius: 50px;
    transition: background 0.2s, color 0.2s;
}
.post-actions span:hover { 
    color: var(--accent-cyan); 
    background: rgba(56, 189, 248, 0.08);
}

/* Sondages & Blocs de code stylisés sur fond noir */
.poll-container { 
    margin-top: 12px; 
    margin-left: 56px;
    background: #030712; 
    padding: 14px; 
    border-radius: 14px; 
    border: 1px solid rgba(56, 189, 248, 0.2); 
}
.poll-option { 
    padding: 10px 14px; 
    background: rgba(56,189,248,0.03); 
    border: 1px solid rgba(56, 189, 248, 0.2); 
    border-radius: 10px; 
    margin-top: 6px; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    font-weight: 600; 
    font-size: 0.85rem; 
    transition: background 0.2s, border-color 0.2s;
}
.poll-option:hover { 
    background: rgba(56,189,248,0.1); 
    border-color: var(--accent-cyan);
}

.code-block { 
    background: #030712; 
    margin-left: 56px;
    padding: 16px; 
    border-radius: 14px; 
    border: 1px solid rgba(56, 189, 248, 0.2); 
    font-family: 'Fira Code', monospace; 
    font-size: 0.82rem; 
    margin-top: 12px; 
    position: relative; 
    overflow-x: auto; 
    color: #38bdf8; 
    box-shadow: inset 0 2px 12px rgba(0,0,0,0.8);
}


/* ==========================================================================
   NOUVELLES FONCTIONNALITÉS MODERNES
   ========================================================================== */

/* 1. Panneau de Réactions Multiples */
.reaction-picker {
    position: absolute;
    bottom: 55px;
    left: 14px;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 30px;
    padding: 8px 14px;
    display: flex;
    gap: 10px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9);
    z-index: 10;
    animation: popUpReaction 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popUpReaction { 
    from { opacity: 0; transform: translateY(10px) scale(0.9); } 
    to { opacity: 1; transform: translateY(0) scale(1); } 
}
.reaction-emoji {
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.reaction-emoji:hover {
    transform: scale(1.4) translateY(-4px);
}

/* 2. Badges de Réactions sur les Posts */
.post-reactions-summary {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 10px;
    margin-left: 56px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.reaction-badge-chip {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 3px 10px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* 3. Visionneuse de Story Améliorée */
.story-viewer-footer {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    display: flex;
    gap: 10px;
}
.story-reply-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 22px;
    padding: 12px 18px;
    color: #fff;
    font-size: 0.92rem;
}
.story-reply-input:focus {
    border-color: var(--accent-cyan);
    outline: none;
}