/*
 * LOUDmusic Fluent Community theme overrides
 * Scoped to the community frame only — no layout or font changes.
 */

.fcom_wrap .fcom_primary_button,
.fcom_wrap .el-button.fcom_primary_button,
.fcom_wrap a.fcom_login_btn {
    background-color: var(--fcom-primary-button, #1E73BD);
    border-color: var(--fcom-primary-button, #1E73BD);
}

.fcom_wrap .fcom_primary_button:hover,
.fcom_wrap .el-button.fcom_primary_button:hover,
.fcom_wrap a.fcom_login_btn:hover {
    filter: brightness(0.92);
}

.fcom_wrap .fcom_text_link,
.fcom_wrap a.fcom_menu_link {
    color: var(--fcom-text-link, #1E73BD);
}

/* Selected sidebar item (custom portal sidebar only) */
.fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.router-link-exact-active,
.fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.lm-fcom-menu-prefix-active,
.fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link_active,
.fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.fcom_menu_link_active {
    background: rgba(30, 115, 189, 0.18) !important;
    color: var(--fcom-primary-button-text, #ffffff) !important;
}

html:not(.dark) .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.router-link-exact-active,
html:not(.dark) .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.lm-fcom-menu-prefix-active,
html:not(.dark) .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link_active,
html:not(.dark) .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.fcom_menu_link_active {
    background: #f5f5f5 !important;
    color: #000000 !important;
}

html.dark .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.router-link-exact-active,
html.dark .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.lm-fcom-menu-prefix-active,
html.dark .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link_active,
html.dark .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap .fcom_menu_link.fcom_menu_link_active {
    background: rgba(30, 115, 189, 0.28) !important;
    color: var(--fcom-primary-button-text, #ffffff) !important;
}

.fcom_wrap .fcom_top_menu,
.fcom_wrap .spaces .space_contents,
.fcom_wrap .fhr_content,
.fcom_wrap .feed_layout {
    background-color: var(--fcom-primary-bg);
}

/* Desktop custom portal: sidebar column layout + hide Fluent default side footer */
@media (min-width: 769px) {
    .fcom_wrap:not(.lm-fcom-standard-portal) .space_contents .fcom_side_footer,
    .fcom_wrap:not(.lm-fcom-standard-portal) .fcom_side_footer {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    .fcom_wrap:not(.lm-fcom-standard-portal) .fcom_side_footer a.fcom_inline_icon_link_item[href*="fluentcommunity.co"] {
        display: none !important;
    }

    /* Sidebar layout (custom portal only — not admin settings) */
    .fcom_wrap:not(.lm-fcom-standard-portal) .spaces .space_contents {
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    .fcom_wrap:not(.lm-fcom-standard-portal) #fcom_sidebar_wrap {
        flex: 1 1 auto;
        min-height: 0;
    }
}

/* Full-height sidebar (Claude-like layout)
 * Fluent defaults start the sidebar below the header using `--fcom-header-height`.
 * We override that so the sidebar becomes taller and can host the logo inside it.
 */
@media (min-width: 769px) {
    .fcom_wrap:not(.lm-fcom-standard-portal) .spaces .space_contents {
        top: 0 !important;
        max-height: 100vh !important;
    }

    body.admin-bar .fcom_wrap:not(.lm-fcom-standard-portal) .spaces .space_contents {
        top: 32px !important;
        max-height: calc(100vh - 32px) !important;
    }

    /*
     * Desktop: hide Fluent top bar (actions are in the sidebar footer).
     * Fluent's portal_general.js sets --fcom-header-height from the menu height;
     * zero that variable so main content does not keep a blank header band.
     */
    body.lm-fcom-desktop-portal,
    body:has(.fcom_wrap.lm-fcom-hide-top-menu) {
        --fcom-header-height: 0px !important;
    }

    .fcom_wrap.lm-fcom-hide-top-menu .fcom_top_menu {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    .fcom_wrap.lm-fcom-hide-top-menu .fhr_wrap,
    .fcom_wrap.lm-fcom-hide-top-menu .fhr_content,
    .fcom_wrap.lm-fcom-hide-top-menu #fluent_comminity_body,
    .fcom_wrap.lm-fcom-hide-top-menu .feed_layout,
    .fcom_wrap.lm-fcom-hide-top-menu #fluent_com_portal,
    .fcom_wrap.lm-fcom-hide-top-menu .feeds_main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .fcom_wrap.lm-fcom-hide-top-menu.fcom_sticky_header .fhr_content,
    .fcom_wrap.lm-fcom-hide-top-menu.fcom_sticky_header .feed_layout {
        padding-top: 0 !important;
    }

    .fcom_wrap.lm-fcom-hide-top-menu .feed_layout {
        min-height: 100vh;
    }

    body.admin-bar .fcom_wrap.lm-fcom-hide-top-menu .feed_layout {
        min-height: calc(100vh - 32px);
    }

    /*
     * Elementor sticky headers inside the portal content.
     * Many pages use an Elementor container with sticky_offset ~55px (to sit below the Fluent top menu).
     * When we hide the Fluent top menu on desktop, Elementor still applies that offset via inline `top`,
     * leaving a blank band. Override the `top` and neutralize the spacer height in this portal mode.
     */
    .fcom_wrap.lm-fcom-hide-top-menu .feeds_main .elementor-sticky.elementor-sticky--active {
        top: 0 !important;
    }

    body.admin-bar .fcom_wrap.lm-fcom-hide-top-menu .feeds_main .elementor-sticky.elementor-sticky--active {
        top: 32px !important;
    }

    .fcom_wrap.lm-fcom-hide-top-menu .feeds_main .elementor-sticky__spacer {
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }
}

/*
 * Elementor Pro sticky locks width/left in inline styles at stick time.
 * When the portal sidebar expands/collapses, remeasure via JS resize — this CSS
 * keeps the bar aligned with the content column if inline values are stale.
 */
@media (min-width: 769px) {
    .fcom_wrap:not(.lm-fcom-standard-portal) .feeds_main .elementor-sticky.elementor-sticky--active {
        width: calc(100vw - var(--lm-sidebar-width, 280px)) !important;
        max-width: none !important;
        inset-inline-start: var(--lm-sidebar-width, 280px) !important;
    }
}

/* LOUDmusic sidebar footer card (desktop only — hidden on mobile via max-width rule) */
@media (min-width: 769px) {
.fcom_wrap:not(.lm-fcom-standard-portal) .lm-fcom-sidebar-footer {
    position: sticky;
    top: calc(
        var(--lm-sidebar-brand-height, 76px) +
        var(--lm-general-menu-height, 0px) +
        8px
    );
    z-index: 2;
    margin-top: auto;
    padding: 12px 12px var(--lm-sidebar-sticky-bottom, 104px);
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
}
}

/* Portal sidebar brand row (logo + collapse button) */
.fcom_wrap:not(.lm-fcom-standard-portal) .lm-portal-brand-row {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px 12px 10px;
    background: var(--fcom-primary-bg, #0B0D1B);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.fcom_wrap .lm-portal-sidebar-brand {
    padding: 0;
}

.fcom_wrap .lm-portal-sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    text-decoration: none !important;
}

.fcom_wrap .lm-portal-sidebar-brand-logo {
    display: block;
    max-height: 36px;
    width: auto;
}

.fcom_wrap .lm-portal-sidebar-brand-text {
    display: inline-block;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--fcom-primary-text, #fff);
    margin-left: 10px;
    white-space: nowrap;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-sidebar-brand {
    display: none !important;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-brand-row {
    flex-direction: column;
    align-items: center;
    padding: 10px 0 0;
    justify-content: center;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-sidebar-brand-logo {
    display: none !important;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-sidebar-brand-text {
    display: none !important;
}

/* Place collapse toggle on the right of the logo row */
.fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toolbar {
    padding: 0 !important;
    margin-left: auto;
}

.fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle {
    padding: 0 !important;
}

/* Keep collapse toggle icon-only even if other plugins/style packs
 * re-apply button defaults on production.
 */
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:hover,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:focus,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:active,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:focus-visible {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
}

body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle::before,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle::after,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle-icon,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle svg {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:hover,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:active,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:focus,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle:focus-visible {
    color: var(--fcom-menu-text, #99A0AE) !important;
    opacity: 1 !important;
}

body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle .lm-fcom-sidebar-toggle-icon,
body .fcom_wrap .lm-portal-brand-row .lm-fcom-sidebar-toggle svg {
    opacity: 1 !important;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-brand-row .lm-fcom-sidebar-toolbar {
    margin-left: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-brand-row .lm-fcom-sidebar-toolbar::after {
    content: "";
    display: block !important;
    width: 28px;
    height: 1px;
    margin: 8px auto 10px;
    background-color: var(--fcom-primary-border, #e3e8ee) !important;
    border: 0 !important;
    box-shadow: none !important;
    opacity: 1;
}

html.dark .fcom_wrap.lm-sidebar-collapsed .lm-portal-brand-row .lm-fcom-sidebar-toolbar::after {
    background-color: rgba(255, 255, 255, 0.4) !important;
}

.fcom_wrap.lm-sidebar-collapsed .lm-portal-brand-row .lm-fcom-sidebar-toggle {
    margin: 0 auto !important;
    width: 52px;
    max-width: 52px;
    min-width: 52px;
    padding: 10px 0 !important;
    justify-content: center;
}

.fcom_wrap .lm-fcom-footer-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: var(--fcom-secondary-content-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.fcom_wrap .lm-fcom-upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 45%, #06b6d4 100%);
    color: #FFFFFF !important;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.fcom_wrap .lm-fcom-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.42);
    filter: brightness(1.03);
    color: #FFFFFF !important;
}

.fcom_wrap .lm-fcom-upgrade-btn svg {
    display: none !important;
}

.fcom_wrap .lm-fcom-upgrade-btn::before {
    content: "⭐";
    display: inline-block;
    font-size: 14px;
    line-height: 1;
}

.fcom_wrap .lm-fcom-footer-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid var(--fcom-primary-border);
}

.fcom_wrap .lm-fcom-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fcom-menu-text) !important;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
}

.fcom_wrap .lm-fcom-footer-link-text {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fcom_wrap .lm-fcom-footer-label {
    flex: 0 1 auto;
    min-width: 0;
}

.fcom_wrap .lm-fcom-footer-link-notifications {
    position: relative;
}

.fcom_wrap .lm-fcom-footer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff !important;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    text-align: center;
}

.fcom_wrap .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon {
    display: inline-flex;
    flex-shrink: 0;
    opacity: 0.75;
}

.fcom_wrap .lm-fcom-dark-mode-toggle:hover .lm-fcom-footer-icon {
    opacity: 1;
}

.fcom_wrap .lm-fcom-footer-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--fcom-primary-border);
    background: var(--fcom-light-bg);
}

.fcom_wrap .lm-fcom-footer-link svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.fcom_wrap .lm-fcom-footer-link:hover {
    background: var(--fcom-menu-bg-hover);
    color: var(--fcom-menu-text-hover) !important;
}

.fcom_wrap .lm-fcom-footer-link:hover svg {
    opacity: 1;
}

.fcom_wrap .lm-fcom-footer-link-logout {
    color: #f87171 !important;
}

.fcom_wrap .lm-fcom-footer-link-logout:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5 !important;
}

/* Keep explicit footer treatment for light mode */
html:not(.dark) body .fcom_wrap .lm-fcom-footer-card {
    background: #FFFFFF;
    border-color: #e5e7eb;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

html:not(.dark) body .fcom_wrap .lm-fcom-footer-links {
    border-top-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) body .fcom_wrap .lm-fcom-footer-link {
    color: #475569 !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-footer-link:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-footer-link-logout {
    color: #dc2626 !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-footer-link-logout:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c !important;
}

/* Explicit dark mode footer tuning */
html.dark body .fcom_wrap .lm-fcom-footer-card {
    background: #191B2E;
    border-color: #1a2332;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.dark body .fcom_wrap .lm-fcom-footer-links {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/*
 * Footer controls: isolate from WP/BuddyBoss/global button & link styles
 * (same approach as .lm-fcom-sidebar-toggle).
 */
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:hover,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:focus,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:active,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:visited,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:focus:not(:focus-visible),
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:hover,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:focus,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:active,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:focus:not(:focus-visible) {
    background-image: none !important;
    border: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout),
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle {
    background: transparent !important;
    background-color: transparent !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout),
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):visited,
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle {
    color: #475569 !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):hover,
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):active,
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:hover,
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:active {
    background: rgba(15, 23, 42, 0.05) !important;
    background-color: rgba(15, 23, 42, 0.05) !important;
    color: #0f172a !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):focus:not(:focus-visible),
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:focus:not(:focus-visible) {
    background: transparent !important;
    background-color: transparent !important;
    color: #475569 !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout,
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:visited {
    background: transparent !important;
    background-color: transparent !important;
    color: #dc2626 !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:hover,
html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:active {
    background: rgba(220, 38, 38, 0.08) !important;
    background-color: rgba(220, 38, 38, 0.08) !important;
    color: #b91c1c !important;
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:focus:not(:focus-visible) {
    background: transparent !important;
    background-color: transparent !important;
    color: #dc2626 !important;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout),
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):visited,
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--fcom-menu-text, #99A0AE) !important;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):hover,
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):active,
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:hover,
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:active {
    background: var(--fcom-menu-bg-hover, rgba(255, 255, 255, 0.06)) !important;
    background-color: var(--fcom-menu-bg-hover, rgba(255, 255, 255, 0.06)) !important;
    color: var(--fcom-menu-text-hover, #ffffff) !important;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:not(.lm-fcom-footer-link-logout):focus:not(:focus-visible),
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:focus:not(:focus-visible) {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--fcom-menu-text, #99A0AE) !important;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout,
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:visited {
    background: transparent !important;
    background-color: transparent !important;
    color: #f87171 !important;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:hover,
html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:active {
    background: rgba(248, 113, 113, 0.1) !important;
    background-color: rgba(248, 113, 113, 0.1) !important;
    color: #fca5a5 !important;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout:focus:not(:focus-visible) {
    background: transparent !important;
    background-color: transparent !important;
    color: #f87171 !important;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link:focus-visible,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle:focus-visible {
    outline: 2px solid var(--fcom-primary-button, #1E73BD) !important;
    outline-offset: 2px;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link .lm-fcom-footer-link-text,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link .lm-fcom-footer-label,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link .lm-fcom-footer-icon,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link .lm-fcom-dark-mode-label,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link svg,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle svg {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:hover,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:focus,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:active,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:visited,
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:focus:not(:focus-visible) {
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 45%, #06b6d4 100%) !important;
    background-color: transparent !important;
    background-image: linear-gradient(135deg, #7c3aed 0%, #2563eb 45%, #06b6d4 100%) !important;
    border: 0 !important;
    border-color: transparent !important;
    color: #ffffff !important;
    text-shadow: none !important;
    outline: none !important;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:hover {
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.42) !important;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:focus:not(:focus-visible),
body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:active {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
}

body .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-upgrade-btn:focus-visible {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
}

/* Sidebar width tokens */
.fcom_wrap {
    --lm-sidebar-width-expanded: 280px;
    --lm-sidebar-width-collapsed: 76px;
    --lm-sidebar-width: var(--lm-sidebar-width-expanded);
    --lm-sidebar-brand-height: 76px;
    /* Back-compat alias (if any other rules reference the old token) */
    --lm-sidebar-sticky-top: var(--lm-sidebar-brand-height);
    /* Bottom inset for footer card (was 104px — pushed card too high) */
    --lm-sidebar-sticky-bottom: 12px;
    --lm-general-menu-height: 0px;
}

.fcom_wrap.lm-sidebar-collapsed {
    --lm-sidebar-width: var(--lm-sidebar-width-collapsed);
    --lm-sidebar-sticky-bottom: 8px;
}

/* Collapse toggle */
.fcom_wrap .lm-fcom-sidebar-toolbar {
    flex: 0 0 auto;
    padding: 10px 12px 0;
}

.fcom_wrap:not(.lm-sidebar-collapsed) .lm-fcom-sidebar-toolbar {
    padding-left: 24px;
}

.fcom_wrap:not(.lm-sidebar-collapsed) .lm-fcom-sidebar-toggle-icon {
    margin-left: 4px;
}

.fcom_wrap .lm-fcom-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: auto;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--fcom-menu-text, #99A0AE);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.fcom_wrap .lm-fcom-sidebar-toggle:hover {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--fcom-menu-text-hover, #FFFFFF);
}

html:not(.dark) body .fcom_wrap .lm-fcom-sidebar-toggle:hover {
    color: #0f172a;
}

html.dark body .fcom_wrap .lm-fcom-sidebar-toggle:hover {
    color: #ffffff;
}

/* Override WP/BuddyBoss button:focus box-shadow (red theme ring) */
.fcom_wrap .lm-fcom-sidebar-toggle:focus,
.fcom_wrap .lm-fcom-sidebar-toggle:active,
.fcom_wrap .lm-fcom-sidebar-toggle:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
}

.fcom_wrap .lm-fcom-sidebar-toggle:focus-visible {
    outline: 2px solid var(--fcom-primary-button, #1E73BD);
    outline-offset: 2px;
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
}

.fcom_wrap .lm-fcom-sidebar-toggle-icon {
    display: inline-flex;
    flex-shrink: 0;
    margin-left: 2px;
}

/* Icon swap: show the "open" chevron when sidebar is expanded,
 * and show the "close" chevron when sidebar is collapsed. */
.fcom_wrap .lm-fcom-sidebar-toggle-collapse {
    display: none;
}

.fcom_wrap .lm-fcom-sidebar-toggle-expand {
    display: inline-flex;
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-sidebar-toggle-collapse {
    display: inline-flex;
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-sidebar-toggle-expand {
    display: none;
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-sidebar-toggle-label {
    display: none;
}

/* Scrollable sidebar sections */
.fcom_wrap #fcom_sidebar_wrap {
    overflow-y: auto;
}

.fcom_wrap .fcom_sidebar_contents {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Space groups: always expanded (no accordion) */
.fcom_wrap .fcom_communities_menu .space_section_title {
    cursor: default;
    user-select: none;
    pointer-events: none;
}

.fcom_wrap .fcom_communities_menu .space_section_title .el-icon {
    display: none !important;
}

.fcom_wrap .fcom_communities_menu.fcom_group_collapsed > ul,
.fcom_wrap .fcom_communities_menu.fcom_group_collapsed > nav > ul {
    display: block !important;
}

/* Collapsed sidebar layout (desktop only) */
@media (min-width: 769px) {
.fcom_wrap.lm-sidebar-collapsed .spaces,
.fcom_wrap.lm-sidebar-collapsed .spaces .space_contents,
.fcom_wrap.lm-sidebar-collapsed #fluent_community_sidebar_menu,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap {
    width: var(--lm-sidebar-width) !important;
    min-width: var(--lm-sidebar-width) !important;
    max-width: var(--lm-sidebar-width) !important;
    box-sizing: border-box;
    overflow-x: hidden;
}

.fcom_wrap.lm-sidebar-collapsed .feed_layout {
    padding-left: var(--lm-sidebar-width) !important;
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-sidebar-footer {
    max-width: var(--lm-sidebar-width);
    padding: 8px 8px var(--lm-sidebar-sticky-bottom, 100px);
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card {
    padding: 8px;
    gap: 8px;
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-upgrade-btn > span,
.fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-link .lm-fcom-footer-label,
.fcom_wrap.lm-sidebar-collapsed .lm-fcom-dark-mode-label {
    display: none !important;
}

/* Sidebar footer theme toggle: emoji icons (SVG color was too faint) */
.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    height: 18px;
    opacity: 1 !important;
}

.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon svg {
    display: none !important;
}

html:not(.dark) .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_light {
    display: inline-flex !important;
}

html:not(.dark) .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_light::before {
    content: "🌙";
    font-size: 15px;
    line-height: 1;
}

html.dark .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_dark {
    display: inline-flex !important;
}

html.dark .fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_dark::before {
    content: "☀️";
    font-size: 15px;
    line-height: 1;
}

/* Reorder footer actions: dark/light toggle above notifications */
.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-links {
    display: flex;
    flex-direction: column;
}

.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-profile {
    order: 1;
}

.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-dark-mode-toggle {
    order: 2;
}

.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-notifications {
    order: 3;
}

.fcom_wrap .lm-fcom-sidebar-footer .lm-fcom-footer-link-logout {
    order: 4;
}

/*
 * Collapsed footer: every control centered like Upgrade (icon-only, full card width).
 */
body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-upgrade-btn,
body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-link,
body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 10px 8px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-link .lm-fcom-footer-link-text {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-link:not(.lm-fcom-dark-mode-toggle) svg,
body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-avatar {
    display: block !important;
    flex-shrink: 0 !important;
    margin: 0 auto !important;
}

body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon svg {
    display: none !important;
}

/* Dark mode toggle in collapsed footer */
body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon {
    flex-shrink: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    opacity: 1 !important;
}

html:not(.dark) body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_light {
    display: inline-flex !important;
}

html:not(.dark) body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_dark {
    display: none !important;
}

html.dark body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_dark {
    display: inline-flex !important;
}

html.dark body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-dark-mode-toggle .lm-fcom-footer-icon.show_on_light {
    display: none !important;
}

/* Notifications: bell centered; badge pinned to control corner */
body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-link-notifications {
    position: relative !important;
}

body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-link-notifications .lm-fcom-footer-link-text {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    flex: none !important;
    pointer-events: none !important;
    background: transparent !important;
}

body .fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-card .lm-fcom-footer-link-notifications .lm-fcom-footer-badge {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.6rem;
    box-shadow: 0 0 0 2px var(--fcom-primary-bg, #0b0d1b);
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-footer-links {
    border-top: 0;
    padding-top: 0;
}

/* Icon-only sidebar menu when collapsed — only restyle existing items */
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .community_name,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .space_section_title,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_space_group_header,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_space_create,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_unread_count,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_space_lock {
    display: none !important;
}

/* Keep icons visible for collapsed groups in icon-only sidebar mode.
   DOM structure: .fcom_communities_menu -> nav -> ul (NOT direct ul child). */
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_communities_menu.fcom_group_collapsed > nav > ul,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_communities_menu.fcom_group_collapsed nav > ul {
    display: block !important;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_communities_menu {
    margin-top: 0 !important;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_general_menu,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_general_menu li,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_communities_menu ul,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_communities_menu ul li {
    width: 100%;
    max-width: 100%;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link {
    justify-content: center;
    align-items: center;
    width: 52px;
    max-width: 52px;
    margin: 4px auto !important;
    padding: 10px 0 !important;
    column-gap: 0;
    box-sizing: border-box;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link .community_avatar {
    margin: 0;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link .community_avatar img,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link .community_avatar .fcom_emoji,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link .community_avatar .fcom_shape {
    margin: 0 auto;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link > .el-icon {
    display: inline-flex !important;
    margin: 0;
}

.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link.router-link-exact-active::before,
.fcom_wrap.lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_menu_link.lm-fcom-menu-prefix-active::before {
    display: none !important;
}

.fcom_wrap.lm-sidebar-collapsed .lm-fcom-sidebar-toggle-icon {
    margin-left: 0;
}
}

@media (max-width: 768px) {
    .fcom_wrap .lm-fcom-sidebar-toolbar {
        display: none;
    }

    .fcom_wrap:not(.lm-fcom-standard-portal) .lm-portal-brand-row {
        display: none !important;
    }

    .fcom_wrap:not(.lm-fcom-standard-portal) .lm-fcom-sidebar-footer {
        display: none !important;
    }

    /* Undo desktop collapsed layout if class persists from localStorage */
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed .feed_layout {
        padding-left: 0 !important;
    }

    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed .spaces,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed .spaces .space_contents,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fluent_community_sidebar_menu,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap .community_name,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap .space_section_title,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_space_group_header,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_space_create,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_unread_count,
    .fcom_wrap:not(.lm-fcom-standard-portal).lm-sidebar-collapsed #fcom_sidebar_wrap .fcom_space_lock {
        display: revert !important;
    }
}

/* Fluent Community admin pages: restore Fluent default sidebar/header layout */
.fcom_wrap.lm-fcom-standard-portal .lm-portal-brand-row,
.fcom_wrap.lm-fcom-standard-portal .lm-fcom-sidebar-footer,
.fcom_wrap.lm-fcom-standard-portal .lm-fcom-sidebar-toolbar {
    display: none !important;
}

.fcom_wrap.lm-fcom-standard-portal .spaces .space_contents {
    display: block !important;
    min-height: 0 !important;
}

.fcom_wrap.lm-fcom-standard-portal #fcom_sidebar_wrap {
    flex: none !important;
    min-height: 0 !important;
}

@media (min-width: 769px) {
    .fcom_wrap.lm-fcom-standard-portal .spaces .space_contents {
        top: revert !important;
        max-height: revert !important;
    }

    body.admin-bar .fcom_wrap.lm-fcom-standard-portal .spaces .space_contents {
        top: revert !important;
        max-height: revert !important;
    }

    .fcom_wrap.lm-fcom-standard-portal .fcom_top_menu .fhr_logo {
        display: block !important;
    }

    .fcom_wrap.lm-fcom-standard-portal .fcom_top_menu {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

.fcom_wrap.lm-fcom-standard-portal.lm-sidebar-collapsed .feed_layout {
    padding-left: 280px !important;
}

.fcom_wrap.lm-fcom-standard-portal.lm-sidebar-collapsed .spaces,
.fcom_wrap.lm-fcom-standard-portal.lm-sidebar-collapsed .spaces .space_contents,
.fcom_wrap.lm-fcom-standard-portal.lm-sidebar-collapsed #fluent_community_sidebar_menu,
.fcom_wrap.lm-fcom-standard-portal.lm-sidebar-collapsed #fcom_sidebar_wrap {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
}