/* ═══════════════════════════════════════════════════════════════
   Desklog Global Search — Command Palette Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Trigger Bar (Header) ─────────────────────────────────── */
.global-search-trigger-wrapper {
    display: flex !important;
    align-items: center;
    height: 50px;
}
.global-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 11px;
    margin: 0 10px;
    background: #e6f4f9  !important;
    border: 1px solid #c7d7dd !important;
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s;
    width: 35px;
    height: 35px;
    border-radius: 30px;
    /* overflow: hidden; */
}
.global-search-trigger:hover {
    background: #e3e8ed;
    border-color: #c8cfd6;
}
.global-search-trigger-icon {
    font-size: 13px;
    color: #004073;
    flex-shrink: 0;
    position: relative;
    top: -1px;
}
.global-search-trigger-text {
    flex: 1;
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.global-search-trigger-kbd {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    color: #aaa;
    font-family: monospace;
    flex-shrink: 0;
    line-height: 1.6;
}

/* ─── Overlay ──────────────────────────────────────────────── */
.global-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

/* ─── Modal ────────────────────────────────────────────────── */
.global-search-modal {
    width: 620px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 70px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: gsSlideDown 0.15s ease-out;
    display: flex;
    flex-direction: column;
}

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

/* ─── Header / Input ───────────────────────────────────────── */
.global-search-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.global-search-input-icon {
    color: #999;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}
.global-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #333;
}
.global-search-input::placeholder {
    color: #aaa;
}
.global-search-kbd {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: #999;
    font-family: monospace;
    flex-shrink: 0;
}

/* ─── Result Count ────────────────────────────────────────── */
.gs-result-count {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    margin-right: 10px;
    white-space: nowrap;
}

/* ─── Results ──────────────────────────────────────────────── */
.global-search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 6px 0;
    flex: 1;
}

/* Custom scrollbar */
.global-search-results::-webkit-scrollbar {
    width: 6px;
}
.global-search-results::-webkit-scrollbar-track {
    background: transparent;
}
.global-search-results::-webkit-scrollbar-thumb {
    background: #d0d5da;
    border-radius: 3px;
}
.global-search-results::-webkit-scrollbar-thumb:hover {
    background: #b0b5ba;
}

/* Group */
.gs-group {
    padding: 4px 0;
}
.gs-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 16px 4px;
}

/* Result Item */
.gs-result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    margin: 1px 6px;
    transition: background 0.1s, border-color 0.1s;
    border-left: 3px solid transparent;
    position: relative;
}
.gs-result-item:hover {
    background: #f0f4f8;
    text-decoration: none;
    color: #333;
}
.gs-result-item.active {
    background: #f0f7e6;
    border-left-color: #81B504;
    text-decoration: none;
    color: #333;
}
.gs-result-icon {
    width: 28px;
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
    text-align: center;
}
.gs-result-label {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gs-highlight {
    background: #fff3cd;
    font-weight: 600;
    border-radius: 2px;
    padding: 0 1px;
}

/* ─── Result Type Dot ─────────────────────────────────────── */
.gs-result-type-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
}
.gs-result-type-dot--page {
    background: #045ba0;
}
.gs-result-type-dot--setting {
    background: #81B504;
}
.gs-result-type-dot--project {
    background: #e67e22;
}

/* ─── Inline Category Label ───────────────────────────────── */
.gs-result-category {
    font-size: 11px;
    color: #aaa;
    margin-left: auto;
    padding-left: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Right Arrow on Hover ────────────────────────────────── */
.gs-result-arrow {
    font-size: 12px;
    color: #ccc;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.gs-result-item:hover .gs-result-arrow,
.gs-result-item.active .gs-result-arrow {
    opacity: 1;
}

/* ─── No Results / Empty State ─────────────────────────────── */
.global-search-no-results {
    text-align: center;
    padding: 40px 16px;
    color: #999;
}
.global-search-no-results i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}
.global-search-empty-state {
    text-align: center;
    padding: 36px 16px 28px;
    color: #bbb;
}
.global-search-empty-icon {
    font-size: 36px;
    color: #d0d5da;
    margin-bottom: 14px;
    display: block;
}
.global-search-empty-state p {
    margin-bottom: 6px;
    font-size: 15px;
    color: #999;
}
.global-search-empty-tips {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 0;
}
.global-search-empty-tips code {
    background: #f0f2f5;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 12px;
    color: #888;
}

/* ─── Persistent Footer ──────────────────────────────────── */
.global-search-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #aaa;
    flex-shrink: 0;
}
.global-search-footer kbd {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: monospace;
    color: #888;
}

 /* Global Search New Feature Styles */
    .global-search-new-feature {
        position: relative;
        border-radius: 25px;
        background: linear-gradient(45deg, rgba(94, 185, 42, 0.1), rgba(47, 126, 216, 0.1));
        border: 2px solid transparent;
        background-clip: padding-box;
        animation: pulseGlow 2s infinite;
        transition: all 0.3s ease;
    }
    

    
    .global-search-new-badge {
        position: absolute;
        top: -10px;
        right: -16px;
        background: linear-gradient(45deg, #a0c34e, #82b900);
        color: white;
        font-size: 9px;
        font-weight: bold;
        padding: 1px 5px;
        border-radius: 10px;
        animation: bounce 1.5s infinite;
        z-index: 10;
    }


    
    @keyframes bounce {
        0%, 20%, 50%, 80%, 100% {
            transform: translateY(0);
        }
        40% {
            transform: translateY(-4px);
        }
        60% {
            transform: translateY(-2px);
        }
    }
    
    .global-search-new-feature:hover {
        animation-play-state: paused;
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(94, 185, 42, 0.6);
    }
    
    .global-search-new-feature:hover .global-search-new-badge {
        animation-play-state: paused;
        transform: scale(1.1);
    }

/* ─── Tablet ───────────────────────────────────────────────── */
@media (max-width: 991px) {
    .global-search-trigger {
        width: auto;
        min-width: auto;
        padding: 5px 10px;
    }
    .global-search-trigger-text {
        display: none;
    }
}

/* ─── Mobile ───────────────────────────────────────────────── */
@media (max-width: 576px) {
    .global-search-trigger {
        margin: 8px 0 0 5px;
        padding: 5px 8px;
    }
    .global-search-trigger-text,
    .global-search-trigger-kbd {
        display: none;
    }
    .global-search-overlay { padding-top: 5vh; }
    .global-search-modal { width: 95vw; border-radius: 10px; }
    .global-search-results { max-height: 60vh; }
    .global-search-footer {
        gap: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }
    .gs-result-category { display: none; }
}
