﻿.global-menu-search-wrapper {
    position: relative;
    width: 230px;
    min-width: 0;
}

.navbar-search-slot {
    display: flex;
    flex: 0 0 220px;
    align-items: center;
    margin: 0 10px;
}

.global-menu-search-icon {
    position: absolute;
    left: 12px;
    top: 17px;
    z-index: 2;
    color: #667085;
    font-size: 15px;
    transform: translateY(-50%);
    pointer-events: none;
}

.global-menu-search-shortcut {
    position: absolute;
    right: 9px;
    top: 17px;
    z-index: 2;
    padding: 1px 6px;
    color: #667085;
    background: #f2f4f7;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    font-size: 10px;
    line-height: 17px;
    transform: translateY(-50%);
    pointer-events: none;
}

.global-menu-search-input {
    width: 100%;
    height: 34px;
    padding: 6px 62px 6px 35px;
    color: #1d2939;
    background: #f8fafc;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    outline: none;
    font: inherit;
    font-size: 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .global-menu-search-input:focus {
        background: #fff;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
    }

.global-menu-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000000;
    width: 340px;
    max-height: 390px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .18);
}

    .global-menu-search-results[hidden] {
        display: none;
    }

.global-search-result {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 6px 9px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

    .global-search-result:hover,
    .global-search-result.is-active {
        background: #eff6ff;
    }

.global-search-result-icon {
    flex: 0 0 auto;
    margin-right: 11px;
    color: #3b82f6;
    font-size: 20px;
}

.global-search-result-content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.global-search-result-title {
    overflow: hidden;
    color: #1d2939;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-result:hover .global-search-result-title,
.global-search-result.is-active .global-search-result-title {
    color: #175cd3;
}

.global-search-result-group {
    margin-top: 3px;
    overflow: hidden;
    color: #667085;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-empty {
    padding: 16px 12px;
    color: #667085;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 768px) {
    .navbar-search-slot {
        flex: 1 0 100%;
        width: 100%;
        margin: 8px 0;
    }

    .global-menu-search-wrapper {
        position: relative;
        width: 220px;
        min-width: 0;
    }

    .global-menu-search-shortcut {
        display: none;
    }

    .global-menu-search-input {
        padding-right: 38px;
    }

    .global-menu-search-results {
        right: auto;
        left: 0;
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1199.98px) {
    .navbar-search-slot {
        flex-basis: 190px;
        margin-right: 8px;
        margin-left: 8px;
    }

    .global-menu-search-wrapper {
        width: 190px;
    }

    .global-menu-search-shortcut {
        display: none;
    }

    .global-menu-search-input {
        padding-right: 32px;
    }
}

/* Cho navbar sử dụng hết chiều ngang màn hình */
#appSystemMenu > .container {
    width: 100%;
    max-width: 100%;
    padding-right: 28px;
    padding-left: 28px;
}

/* Không cho tên menu xuống dòng */
#appSystemMenu .navbar-nav {
    flex-wrap: nowrap;
    align-items: center;
}

    #appSystemMenu .navbar-nav .nav-item {
        flex: 0 0 auto;
    }

    #appSystemMenu .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }

/* Giữ tên tài khoản trên một dòng */
#appSystemMenu .dropdown > .btn {
    white-space: nowrap;
}

/* Thu khoảng cách menu một chút */
#appSystemMenu .navbar-nav .nav-link {
    padding-right: 9px;
    padding-left: 9px;
}

.global-menu-search-input {
    padding-right: 12px !important;
}

    .global-menu-search-input::-webkit-search-cancel-button {
        margin-right: 0;
        cursor: pointer;
    }
