/* ==================== GLOBAL SEARCH - SPOTLIGHT/COMMAND BAR ==================== */

/* Overlay backdrop */
.global-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.global-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.global-search-modal {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 95%;
    max-width: 640px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.global-search-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Search container */
.gs-container {
    background: #1e2433;
    border: 1px solid rgba(107, 91, 149, 0.3);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(107, 91, 149, 0.15);
    overflow: hidden;
}

/* Search input area */
.gs-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.gs-input-icon {
    color: #6B5B95;
    font-size: 20px;
    flex-shrink: 0;
}

.gs-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 17px;
    font-weight: 400;
    color: #f1f5f9;
    font-family: inherit;
}

.gs-input::placeholder {
    color: #64748b;
}

.gs-input-shortcut {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.gs-input-shortcut kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: #64748b;
    font-family: inherit;
}

/* Category tabs */
.gs-categories {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.gs-categories::-webkit-scrollbar {
    display: none;
}

.gs-category-pill {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
}

.gs-category-pill:hover {
    color: #f1f5f9;
    background: rgba(107, 91, 149, 0.15);
}

.gs-category-pill.active {
    color: #fff;
    background: linear-gradient(135deg, #6B5B95 0%, #00B4D8 100%);
    border-color: transparent;
}

/* Results area */
.gs-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 91, 149, 0.3) transparent;
}

.gs-results::-webkit-scrollbar {
    width: 6px;
}

.gs-results::-webkit-scrollbar-track {
    background: transparent;
}

.gs-results::-webkit-scrollbar-thumb {
    background: rgba(107, 91, 149, 0.3);
    border-radius: 3px;
}

/* Result group header */
.gs-group-header {
    font-size: 10px;
    font-weight: 700;
    color: #48CAE4;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 12px 6px;
}

/* Result item */
.gs-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.gs-result-item:hover,
.gs-result-item.gs-highlighted {
    background: rgba(107, 91, 149, 0.15);
}

.gs-result-item.gs-highlighted {
    outline: 1px solid rgba(107, 91, 149, 0.4);
}

.gs-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(107, 91, 149, 0.15);
    color: #6B5B95;
}

/* Category-specific icon colors */
.gs-result-item[data-category="CRM"] .gs-result-icon {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.gs-result-item[data-category="Finance"] .gs-result-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.gs-result-item[data-category="Recruitment"] .gs-result-icon {
    background: rgba(107, 91, 149, 0.15);
    color: #6B5B95;
}

.gs-result-item[data-category="Projects"] .gs-result-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.gs-result-item[data-category="Contracts"] .gs-result-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.gs-result-info {
    flex: 1;
    min-width: 0;
}

.gs-result-title {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-result-subtitle {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.gs-result-badge {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Empty state */
.gs-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.gs-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.gs-empty-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.gs-empty-hint {
    font-size: 12px;
    color: #475569;
}

/* Loading state */
.gs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    gap: 12px;
    color: #94a3b8;
    font-size: 13px;
}

.gs-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(107, 91, 149, 0.2);
    border-top-color: #6B5B95;
    border-radius: 50%;
    animation: gs-spin 0.8s linear infinite;
}

@keyframes gs-spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.gs-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: #475569;
}

.gs-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gs-footer-action {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gs-footer-action kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    color: #64748b;
    font-family: inherit;
}

/* Recent searches */
.gs-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 6px;
}

.gs-recent-title {
    font-size: 10px;
    font-weight: 700;
    color: #48CAE4;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.gs-recent-clear {
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.gs-recent-clear:hover {
    color: #f1f5f9;
}

.gs-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #94a3b8;
    font-size: 13px;
}

.gs-recent-item:hover {
    background: rgba(107, 91, 149, 0.1);
    color: #f1f5f9;
}

.gs-recent-item i {
    color: #475569;
    font-size: 14px;
}

/* ==================== LIGHT MODE ==================== */
[data-bs-theme="light"] .gs-container {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="light"] .gs-input-wrapper {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .gs-input {
    color: #1e293b;
}

[data-bs-theme="light"] .gs-input::placeholder {
    color: #94a3b8;
}

[data-bs-theme="light"] .gs-input-shortcut kbd {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

[data-bs-theme="light"] .gs-categories {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .gs-category-pill {
    color: #64748b;
    background: #f1f5f9;
}

[data-bs-theme="light"] .gs-category-pill:hover {
    color: #1e293b;
    background: #e2e8f0;
}

[data-bs-theme="light"] .gs-result-item:hover,
[data-bs-theme="light"] .gs-result-item.gs-highlighted {
    background: rgba(107, 91, 149, 0.08);
}

[data-bs-theme="light"] .gs-result-item.gs-highlighted {
    outline-color: rgba(107, 91, 149, 0.3);
}

[data-bs-theme="light"] .gs-result-title {
    color: #1e293b;
}

[data-bs-theme="light"] .gs-result-subtitle {
    color: #94a3b8;
}

[data-bs-theme="light"] .gs-result-badge {
    color: #64748b;
    background: #f1f5f9;
}

[data-bs-theme="light"] .gs-footer {
    border-top-color: rgba(0, 0, 0, 0.08);
    color: #94a3b8;
}

[data-bs-theme="light"] .gs-footer-action kbd {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

[data-bs-theme="light"] .gs-empty {
    color: #94a3b8;
}

[data-bs-theme="light"] .gs-recent-item {
    color: #64748b;
}

[data-bs-theme="light"] .gs-recent-item:hover {
    background: rgba(107, 91, 149, 0.06);
    color: #1e293b;
}

[data-bs-theme="light"] .global-search-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
    .global-search-modal {
        top: 5%;
        width: 96%;
    }

    .gs-results {
        max-height: 55vh;
    }

    .gs-footer {
        display: none;
    }
}
