/* ============================================================
   SYSMI GLOBAL BAR
============================================================ */

:root {
    --global-sidebar-width: 240px;
    --globalbar-height: 68px;

    --global-bg: rgba(13, 13, 13, 0.94);
    --global-panel: rgba(20, 20, 20, 0.98);

    --global-border: rgba(255, 255, 255, 0.08);

    --global-primary: #ff00aa;
    --global-accent: #00ff88;
}

/* ============================================================
   SYSMI GLOBAL BAR
============================================================ */

:root {
    --global-sidebar-width: 240px;
    --globalbar-height: 68px;
    --globalbar-transition: 240ms ease;
}

/* ============================================================
   BAR
============================================================ */

#global-bar {
    position: fixed;

    top: 0;
    left: var(--global-sidebar-width);
    right: 0;

    height: var(--globalbar-height);

    z-index: 900;

    background: var(--bg);
    /*background: var(--global-bg);*/

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
        transition:
        transform var(--globalbar-transition),
        opacity var(--globalbar-transition);
}

.notifications-badge {
    display: flex;
    min-width: 15px;
    height: 15px;
    background: red;
    color: white;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    position: absolute;
    right: 21px;
    top: -3px;
    border: solid 5px #0d0d0d;
}


/* ============================================================
   INNER
============================================================ */

.global-bar-inner {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 0 22px;

    box-sizing: border-box;
}


/* ============================================================
   SEARCH WRAPPER
============================================================ */

.global-search-wrapper {
    position: relative;

    width: min(620px, 65%);

    flex: 1 1 auto;

    max-width: 620px;
}


/* ============================================================
   SEARCH
============================================================ */

.global-search {
    width: 100%;
    height: 44px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 14px;

    box-sizing: border-box;

    border: 1px solid var(--global-border);

    border-radius: 13px;

    background: rgba(255, 255, 255, 0.045);

    color: #fff;

    transition:
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}


/* ============================================================
   SEARCH FOCUS
============================================================ */

.global-search:focus-within {
    background: rgba(255, 255, 255, 0.065);

    border-color: rgba(255, 0, 170, 0.42);

    box-shadow:
        0 0 0 3px rgba(255, 0, 170, 0.06),
        0 0 20px rgba(255, 0, 170, 0.08);
}


/* ============================================================
   SEARCH ICON
============================================================ */

.global-search-icon {
    flex: 0 0 auto;

    font-size: 23px;
    line-height: 1;

    color: rgba(255, 255, 255, 0.68);

    user-select: none;
}


/* ============================================================
   SEARCH INPUT
============================================================ */

.global-search-input {
    flex: 1;

    min-width: 0;

    height: 100%;

    padding: 0;

    border: 0;
    outline: none;

    background: transparent;

    color: #fff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
}


/* Placeholder */

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}


/* Remove native search decorations */

.global-search-input::-webkit-search-decoration,
.global-search-input::-webkit-search-cancel-button,
.global-search-input::-webkit-search-results-button,
.global-search-input::-webkit-search-results-decoration {
    display: none;
}


/* ============================================================
   CLEAR BUTTON
============================================================ */

.global-search-clear {
    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: rgba(255, 255, 255, 0.55);

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease;
}

.global-search-clear:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}


/* ============================================================
   SEARCH RESULTS DROPDOWN
============================================================ */

.global-search-results {
    position: absolute;

    top: calc(100% + 8px);

    left: 0;
    right: 0;

    max-height: min(560px, calc(100vh - 90px));

    overflow-y: auto;

    padding: 8px;

    box-sizing: border-box;

    background: var(--global-panel);

    border: 1px solid rgba(255, 255, 255, 0.09);

    border-radius: 15px;

    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 0 30px rgba(255, 0, 170, 0.04);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    scrollbar-width: thin;

    animation: globalSearchDrop .16s ease;
}


/* ============================================================
   DROPDOWN SCROLLBAR
============================================================ */

.global-search-results::-webkit-scrollbar {
    width: 5px;
}

.global-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.global-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}


/* ============================================================
   SECTION
============================================================ */

.global-search-section {
    padding: 4px 0;
}

.global-search-section + .global-search-section {
    margin-top: 5px;

    padding-top: 8px;

    border-top: 1px solid rgba(255, 255, 255, 0.055);
}


/* ============================================================
   SECTION TITLE
============================================================ */

.global-search-section-title {
    padding: 7px 10px;

    color: rgba(255, 255, 255, 0.42);

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .08em;
}


/* ============================================================
   RESULT
============================================================ */

.global-search-result {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 9px 10px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    color: #fff;

    text-align: left;

    cursor: pointer;

    font-family: inherit;

    transition:
        background .15s ease,
        transform .15s ease;
}

.global-search-result:hover {
    background: rgba(255, 255, 255, 0.065);
}

.global-search-result:active {
    transform: scale(.985);
}


/* ============================================================
   USER AVATAR
============================================================ */

.global-search-avatar {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    object-fit: cover;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.08);
}


/* ============================================================
   RESULT ICON
============================================================ */

.global-search-result-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: rgba(255, 255, 255, 0.055);

    color: rgba(255, 255, 255, 0.8);

    font-size: 17px;
    font-weight: 700;
}

.global-search-result-icon.hashtag {
    color: var(--global-primary);

    background: rgba(255, 0, 170, 0.08);
}

.global-search-result-icon.post {
    color: var(--global-accent);

    background: rgba(0, 255, 136, 0.07);
}

.global-search-result-icon.group {
    color: #fff;

    background: rgba(255, 255, 255, 0.07);
}


/* ============================================================
   RESULT CONTENT
============================================================ */

.global-search-result-content {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.global-search-result-content strong {
    display: block;

    overflow: hidden;

    color: #fff;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.global-search-result-content span {
    display: block;

    overflow: hidden;

    color: rgba(255, 255, 255, 0.43);

    font-size: 12px;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ============================================================
   EMPTY
============================================================ */

.global-search-empty {
    min-height: 100px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 20px;

    box-sizing: border-box;

    color: rgba(255, 255, 255, 0.48);

    font-size: 13px;

    text-align: center;
}

.global-search-empty strong {
    color: #fff;
    font-weight: 600;
}

.global-search-empty-icon {
    font-size: 25px;

    opacity: .55;
}


/* ============================================================
   LOADING
============================================================ */

.global-search-loading {
    min-height: 90px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    color: rgba(255, 255, 255, 0.5);

    font-size: 13px;
}


/* ============================================================
   SPINNER
============================================================ */

.search-spinner {
    width: 16px;
    height: 16px;

    border: 2px solid rgba(255, 255, 255, 0.12);

    border-top-color: var(--global-primary);

    border-radius: 50%;

    animation: globalSearchSpin .7s linear infinite;
}


/* ============================================================
   SEE ALL
============================================================ */

.global-search-see-all {
    width: 100%;

    margin-top: 5px;

    padding: 12px 10px;

    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);

    border-radius: 0 0 9px 9px;

    background: transparent;

    color: var(--global-accent);

    font-family: inherit;

    font-size: 13px;
    font-weight: 600;

    text-align: center;

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease;
}

.global-search-see-all:hover {
    background: rgba(0, 255, 136, 0.05);

    color: #fff;
}

.global-search-see-all strong {
    color: #fff;
}


/* ============================================================
   ACTIONS
============================================================ */

.global-bar-actions {
    display: flex;

    align-items: center;

    gap: 10px;

    flex: 0 0 auto;
}


/* ============================================================
   ACTION BUTTONS
============================================================ */

.global-action,
.global-profile {
    width: 42px;
    height: 42px;
    position: relative;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.05);

    color: #fff;

    cursor: pointer;

    transition:
        background .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}


.global-action:hover {
    background: rgba(255, 0, 170, 0.13);

    box-shadow:
        0 0 14px rgba(255, 0, 170, 0.18);
}


.global-action:active,
.global-profile:active {
    transform: scale(.94);
}


/* ============================================================
   AVATAR
============================================================ */

.global-profile {
    padding: 2px;

    background: transparent;

    overflow: hidden;
}


.global-profile:hover {
    box-shadow:
        0 0 0 2px rgba(255, 0, 170, 0.22),
        0 0 18px rgba(255, 0, 170, 0.12);
}


.global-profile img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    border-radius: 50%;
}


/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes globalSearchDrop {

    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes globalSearchSpin {

    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 768px) {

    :root {
        --global-sidebar-width: 0px;
        --globalbar-height: 60px;
    }


    #global-bar {
        left: 0;

        height: var(--globalbar-height);
    }


    .global-bar-inner {
        padding: 0 12px;

        gap: 10px;
    }


    .global-search-wrapper {
        max-width: none;

        width: auto;

        flex: 1;
    }


    .global-search {
        height: 42px;

        padding: 0 12px;

        border-radius: 12px;
    }


    .global-search-icon {
        font-size: 21px;
    }


    .global-search-input {
        font-size: 13px;
    }


    .global-bar-actions {
        gap: 6px;
    }


    .global-action,
    .global-profile {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }


    .global-search-results {
        position: fixed;

        top: calc(var(--globalbar-height) + 5px);

        left: 8px;
        right: 8px;

        width: auto;

        max-height: calc(100vh - 75px);

        border-radius: 14px;
    }
}


/* ============================================================
   VERY SMALL MOBILE
============================================================ */

@media (max-width: 420px) {

    .global-bar-inner {
        padding: 0 8px;
    }


    .global-search {
        gap: 8px;

        padding: 0 10px;
    }


    .global-search-icon {
        font-size: 19px;
    }


    .global-action {
        display: none;
    }


    .global-profile {
        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }
}

/* ============================================================
   TOGGLE
============================================================ */

.global-bar-toggle {
    position: absolute;
    right: 50%;
    bottom: -40px;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.96);
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.global-bar-toggle:hover {
    color: #fff;

    background: rgba(255, 0, 170, 0.18);

    box-shadow:
        0 0 15px rgba(255, 0, 170, 0.2);
}

.global-bar-toggle:active {
    transform: scale(.9);
}


/* ============================================================
   BARRE MASQUÉE
============================================================ */

body.global-bar-hidden #global-bar {
    transform: translateY(
        calc(-100% + 8px)
    );
}
