/* Global Search Styles
 * (c) Adrian Ranta. All rights reserved. Unauthorised use, reproduction and or distribution is strictly prohibited.
 */

/* Search container in top bar */
.global-search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.global-search-input {
    width: 220px;
    height: 34px;
    padding: 6px 12px 6px 34px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 13px;
    outline: none;
    transition: all 0.25s ease;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.global-search-input:focus {
    width: 300px;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.global-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.6);
}

/* Results dropdown */
.global-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 420px;
    max-height: 480px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: globalSearchFadeIn 0.15s ease;
}

@keyframes globalSearchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Group header */
.global-search-group {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7366ef;
    border-top: 1px solid #f0f0f0;
}

.global-search-group:first-child {
    border-top: none;
}

/* Individual result item */
.global-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.global-search-item:hover {
    background: #f5f3ff;
}

.global-search-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #ffffff;
}

.global-search-item-icon.asset     { background: #667eea; }
.global-search-item-icon.account   { background: #48bb78; }
.global-search-item-icon.vendor    { background: #ed8936; }
.global-search-item-icon.ticket    { background: #e53e3e; }
.global-search-item-icon.inventory { background: #4299e1; }
.global-search-item-icon.license   { background: #805ad5; }
.global-search-item-icon.user      { background: #38b2ac; }

.global-search-item-content {
    flex: 1;
    min-width: 0;
}

.global-search-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-item-meta {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No results */
.global-search-no-results {
    padding: 24px 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Loading state */
.global-search-loading {
    padding: 16px 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Keyboard shortcut hint */
.global-search-hint {
    padding: 8px 14px;
    text-align: center;
    font-size: 11px;
    color: #bbb;
    border-top: 1px solid #f0f0f0;
}

.global-search-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 10px;
    font-family: monospace;
    color: #555;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
}
