/* ===== HEADER USER DROPDOWN MENU ===== */
.header__user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Hide dropdown by default — toggle via JS .open class */
.header__user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 500;
    padding: 8px 0;
    white-space: nowrap;
}

.header__user-menu.open .header__user-dropdown {
    display: block;
}

.header__user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.15s, color 0.15s;
}

.header__user-dropdown a:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.header__user-dropdown hr {
    border: none;
    border-top: 1px solid #2a2a2a;
    margin: 6px 0;
}

/* Badge signalements en attente (lien Administration dans le dropdown) */
.hsb-admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #c0392b;
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    margin-left: auto;
    line-height: 1;
}

/* Uniform icon size for social bar items — match Framway btnIcon */
.hsb-btn--placeholder {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.hsb-btn--placeholder:hover {
    opacity: 0.4;
}

/* ===== HEADER SOCIAL BAR ===== */
#ms-hsb {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    order: -1;
}

/* Override Framway btnIcon quirks for social bar icons */
#ms-hsb .btn.btnIcon {
    align-self: center !important;  /* Framway uses baseline — override */
}

#ms-hsb .btn.btnIcon i {
    height: auto !important;        /* Framway forces 50% — override */
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Notification wrapper */
.hsb-notif {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Badge positioning relative to the icon span */
#hsb-notif-btn {
    position: relative;
}

/* Align the nav user col items centered vertically */
.header__nav__user {
    align-items: center !important;
}

/* Language switcher */
.hsb-lang {
    position: relative;
    margin-right: 4px;
}

.hsb-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
    color: rgba(255,255,255,0.8);
}

.hsb-lang-btn:hover { background: rgba(255,255,255,0.1); }

.hsb-lang--active {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.hsb-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 500;
    min-width: 150px;
    padding: 6px 0;
    white-space: nowrap;
}

.hsb-lang-dropdown.open { display: block; }

.hsb-lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 0.88em;
    cursor: pointer;
    color: #ccc;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hsb-lang-item:hover,
.hsb-lang-item.active { background: rgba(255,255,255,0.07); color: #fff; }
.hsb-lang-item.active { font-weight: 600; }
.hsb-lang-item.disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* Icon buttons */
.hsb-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: color 0.2s, background 0.2s;
}

.hsb-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.hsb-btn.hsb-btn--placeholder { cursor: default; opacity: 0.4; }
.hsb-btn.hsb-btn--placeholder:hover { background: transparent; color: rgba(255,255,255,0.7); }

/* Unread badge */
.hsb-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #e53935;
    color: #fff;
    font-size: 0.65em;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}

.hsb-badge.visible { display: flex; }

/* Notification dropdown trigger */
.hsb-notif { position: relative; }

.hsb-notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: hidden;
}

.hsb-notif-dropdown.open { display: block; }

.hsb-notif-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #2a2a2a;
}

.hsb-notif-dropdown__header h4 {
    margin: 0;
    font-size: 0.95em;
    font-weight: 700;
    color: #fff;
}

.hsb-notif-dropdown__markall {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.75em;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.hsb-notif-dropdown__markall:hover { color: #fff; }

.hsb-notif-list { max-height: 320px; overflow-y: auto; }

.hsb-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.hsb-notif-item:hover { background: rgba(255,255,255,0.05); }
.hsb-notif-item.unread { background: rgba(255,255,255,0.04); }

.hsb-notif-item__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    margin-top: 7px;
    flex-shrink: 0;
    opacity: 0;
}

.hsb-notif-item.unread .hsb-notif-item__dot { opacity: 1; }

.hsb-notif-item__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hsb-notif-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 15%;
}

.hsb-notif-item__avatar i { color: #555; font-size: 0.9em; }

.hsb-notif-item__body { flex: 1; min-width: 0; }

.hsb-notif-item__text {
    font-size: 0.85em;
    color: #ccc;
    line-height: 1.4;
}

.hsb-notif-item__text strong { color: #fff; }

.hsb-notif-item__time {
    font-size: 0.75em;
    color: #666;
    margin-top: 2px;
}

.hsb-notif-dropdown__empty {
    padding: 24px 16px;
    text-align: center;
    color: #555;
    font-size: 0.85em;
}

.hsb-notif-dropdown__footer {
    padding: 10px 16px;
    border-top: 1px solid #2a2a2a;
}

.hsb-notif-dropdown__footer a {
    display: block;
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.hsb-notif-dropdown__footer a:hover { color: #fff; background: rgba(255,255,255,0.07); }

/* Support button */
.hsb-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    background: transparent;
    color: rgba(255,255,255,0.85) !important;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 600;
    text-decoration: none !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.hsb-support-btn:hover { border-color: rgba(255,255,255,0.7); color: #fff !important; background: rgba(255,255,255,0.05); }
.hsb-support-btn .fa-heart { font-size: 0.85em; color: #ef4444; }
.headerVintera.is-reduce #ms-hsb .hsb-support-label { display: none; }
.headerVintera.is-reduce #ms-hsb .hsb-support-btn { padding: 5px 9px; }

/* Responsive: hide lang + placeholders when header is reduced (mobile) */
.headerVintera.is-reduce #ms-hsb .hsb-lang,
.headerVintera.is-reduce #ms-hsb .hsb-btn--placeholder {
    display: none;
}

/* Notification dropdown on small screens */
@media (max-width: 600px) {
    .hsb-lang { display: none; }
    .hsb-btn--placeholder { display: none !important; }
    .hsb-support-label { display: none; }
    .hsb-support-btn { padding: 5px 9px; }
    .hsb-notif-dropdown {
        width: calc(100vw - 20px);
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .hsb-btn { width: 32px; height: 32px; font-size: 0.9em; }
    .header__user-dropdown,
    .hsb-lang-dropdown {
        white-space: normal;
        max-width: calc(100vw - 16px);
    }
}

/* Friend requests dropdown — keeps horizontal avatar + body layout */
.hsb-friends-item { cursor: default !important; }
.hsb-friends-item:hover { background: rgba(255,255,255,0.03) !important; }

.hsb-friends-item__actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.hsb-friends-btn {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}
.hsb-friends-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hsb-friends-btn--accept { background: #22c55e !important; color: #fff !important; border-color: #22c55e !important; }
.hsb-friends-btn--accept:hover:not(:disabled) { opacity: 0.85 !important; }
.hsb-friends-btn--decline { background: transparent !important; color: #ef4444 !important; border: 1px solid #ef4444 !important; }
.hsb-friends-btn--decline:hover:not(:disabled) { background: #ef4444 !important; color: #fff !important; }
.hsb-friends-item__note {
    font-size: 0.82em;
    color: #a0a0a0;
    font-style: italic;
    margin: 3px 0 6px;
    padding: 4px 8px;
    border-left: 2px solid #6366f1;
    background: rgba(99,102,241,0.08);
    border-radius: 0 4px 4px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

@media (max-width: 480px) {
    .hsb-friends-item__actions { flex-direction: column; }
    .hsb-friends-btn { width: 100%; justify-content: center; }
}

/* ===== POST LIGHTBOX ===== */
.post-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

/* Container relatif qui entoure dialogue + bouton × */
.post-lightbox__dialog-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 640px;
}

.post-lightbox__dialog {
    background: #1a1a1a;
    border-radius: 12px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* × positionné hors du dialogue, à droite du container */
.post-lightbox__close {
    position: absolute;
    top: 0;
    right: -48px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    color: #fff !important;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}

.post-lightbox__close:hover { background: rgba(255, 255, 255, 0.28) !important; }

.post-lightbox__body {
    overflow-y: auto;
    flex: 1;
    padding: 20px 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.post-lightbox__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 120px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1em;
}

/* Author */
.post-lightbox__author { margin-bottom: 14px; }

.post-lightbox__author-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.post-lightbox__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2e2e2e;
    color: rgba(255, 255, 255, 0.4);
}

.post-lightbox__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 15%;
}

.post-lightbox__author-info strong { display: block; color: #fff; font-size: 0.95em; }
.post-lightbox__author-info time { font-size: 0.78em; color: rgba(255, 255, 255, 0.38); }

/* Content */
.post-lightbox__text {
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
    margin-bottom: 16px;
    word-break: break-word;
    font-size: 0.97em;
}

/* Reactions */
.post-lightbox__reactions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.post-lightbox__reaction {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    cursor: pointer;
    font-size: 0.88em;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post-lightbox__reaction.active {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

.post-lightbox__reaction:hover { background: rgba(255, 255, 255, 0.12) !important; }

/* Meta bar */
.post-lightbox__meta {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 10px 0 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.post-lightbox__action {
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.48) !important;
    cursor: pointer;
    font-size: 0.88em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px !important;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.post-lightbox__action:hover { background: rgba(255, 255, 255, 0.07) !important; color: #fff !important; }
.post-lightbox__action.active { color: #f59e0b !important; }

.post-lightbox__action .plb-share-count {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.85em;
    line-height: 1.6;
}

.post-lightbox__comment-count,
.post-lightbox__share-count {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.88em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Author row with menu */
.post-lightbox__author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.post-lightbox__author-link { flex: 1; min-width: 0; }

/* "..." menu in lightbox */
.plb-menu-wrap { position: relative; flex-shrink: 0; }
.plb-menu-btn {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.45) !important;
    cursor: pointer;
    padding: 5px 7px !important;
    border-radius: 6px !important;
    font-size: 1em;
}
.plb-menu-btn:hover { color: rgba(255, 255, 255, 0.9) !important; background: rgba(255, 255, 255, 0.07) !important; }
.plb-menu {
    position: fixed;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
}
.plb-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer;
    font-size: 0.9em;
    text-align: left;
}
.plb-menu button:hover { background: rgba(255, 255, 255, 0.07) !important; }
.plb-menu-btn--danger { color: #ef4444 !important; }

.post-lightbox__comment-form .btn { align-self: flex-end; }

/* Comments section */
.post-lightbox__comments-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.post-lightbox__comments-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
    padding-bottom: 4px;
}

/* Le commentaire réutilise .social-comment + .social-comment__bubble depuis social.css */
/* On garde la classe pour l'animation de highlight */
.post-lightbox__comment { }

.post-lightbox__no-comments {
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.88em;
    text-align: center;
    padding: 10px 0 14px;
    margin: 0;
}

/* Comment form — sticky en bas de la section commentaires */
.post-lightbox__comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #1a1a1a;
}

.post-lightbox__comment-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #fff !important;
    padding: 10px 12px !important;
    resize: none;
    font-size: 0.9em;
    font-family: inherit;
    box-sizing: border-box;
}

.post-lightbox__comment-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.24) !important;
}

.post-lightbox__comment-input::placeholder { color: rgba(255, 255, 255, 0.3) !important; }

/* Responsive mobile */
@media (max-width: 768px) {
    .post-lightbox__dialog-container {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
    }

    .post-lightbox__dialog {
        border-radius: 0;
        max-height: 100dvh;
        height: 100dvh;
    }

    /* Sur mobile plein écran, le × flotte en haut à droite du dialogue */
    .post-lightbox__close {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .post-lightbox__body { padding: 60px 16px 20px; }
    .post-lightbox__reactions { gap: 6px; }
    .post-lightbox__reaction { padding: 4px 10px !important; }
    .post-lightbox__comments-section { max-height: 280px; }
}
