﻿/* ==========================================
   1. MAIN CONTAINER & INPUT BAR
   ========================================== */
.gsearch-container {
    position: relative;
    width: 100%;
    max-width: 460px; /* Wider search bar */
}

.gsearch-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 14px; /* FIX: Vertical padding 0 ki taaki height constraint kaam kare */
    height: 44px; /* Bigger search bar */
    gap: 10px;
    cursor: text;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

    .gsearch-input-wrapper:hover {
        border-color: #cbd5e1;
        background: #ffffff;
    }

    .gsearch-input-wrapper:focus-within {
        border-color: #059669;
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14), 0 4px 14px rgba(5, 150, 105, 0.06);
    }

.gsearch-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
    flex-shrink: 0;
}

.gsearch-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
    height: 100%;
}

    .gsearch-input::placeholder {
        color: #94a3b8;
    }

.gsearch-right-badge {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* FIX: Badges overflow/squeeze na ho */
}

.gsearch-clear-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    padding: 2px;
}

    .gsearch-clear-btn:hover {
        color: #0f172a;
    }

.gsearch-kbd-badge {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-family: monospace;
    white-space: nowrap; /* FIX: "Ctrl + K" hamesha single line mein rahega */
    flex-shrink: 0; /* FIX: Narrow screens pe width break nahi hogi */
    line-height: 1;
}

/* ==========================================
   2. DROPDOWN & TABS
   ========================================== */
.gsearch-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 780px;
    max-width: 92vw;
    height: 480px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gsearch-tabs-bar {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.gsearch-tabs-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Close button ko tab-list ke baad flush-right push karta hai. */
.gsearch-close-btn {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .gsearch-close-btn:hover {
        background-color: #f1f5f9;
        color: #0f172a;
    }

    .gsearch-close-btn:focus-visible {
        outline: 2px solid #059669;
        outline-offset: 1px;
    }

.gsearch-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .gsearch-tab-btn:hover {
        background-color: #f8fafc;
        color: #0f172a;
    }

    .gsearch-tab-btn.active {
        background-color: #ECFDF5;
        color: #059669;
        font-weight: 600;
    }

.gsearch-tab-count {
    font-size: 11px;
    opacity: 0.75;
}

/* ==========================================
   3. SPLIT GRID & LEFT COLUMN
   ========================================== */
.gsearch-split-grid {
    display: grid;
    grid-template-columns: 1fr 250px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.gsearch-left-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border-right: 1px solid #f1f5f9;
    background-color: #ffffff;
}

.gsearch-results-scroll {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
}

    .gsearch-results-scroll::-webkit-scrollbar,
    .gsearch-right-col::-webkit-scrollbar {
        width: 5px;
    }

    .gsearch-results-scroll::-webkit-scrollbar-thumb,
    .gsearch-right-col::-webkit-scrollbar-thumb {
        background-color: #cbd5e1;
        border-radius: 4px;
    }

/* Result Groups & Empty State */
.gsearch-group {
    margin-bottom: 12px;
}

.gsearch-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    margin-bottom: 4px;
}

.gsearch-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.gsearch-dot {
    width: 6px;
    height: 6px;
    background-color: #059669;
    border-radius: 50%;
}

.gsearch-group-count {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

.gsearch-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gsearch-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    text-align: center;
    color: #64748b;
}

.gsearch-empty-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.gsearch-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.gsearch-empty-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Result Cards Layout */
.gsearch-result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

    .gsearch-result-card:hover {
        background-color: #f8fafc;
        border-color: #cbd5e1;
    }

.gsearch-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gsearch-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue {
    background: #ECFDF5;
    color: #047857;
}

.icon-red {
    background: #fef2f2;
    color: #ef4444;
}

.icon-green {
    background: #f0fdf4;
    color: #16a34a;
}

.gsearch-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gsearch-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

/* Text Highlighting */
.gsearch-highlight {
    background-color: #fef08a;
    color: #854d0e;
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px;
}

.gsearch-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
    line-height: 1;
}

.gsearch-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gsearch-status-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-draft {
    background: #f1f5f9;
    color: #64748b;
}

.status-approved {
    background: #dcfce7;
    color: #15803d;
}

.gsearch-jump-btn {
    display: none;
    align-items: center;
    gap: 4px;
    background-color: #059669;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.gsearch-result-card:hover .gsearch-jump-btn {
    display: flex;
}

.gsearch-result-card:hover .gsearch-arrow-icon {
    display: none;
}

/* Left Footer */
.gsearch-left-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: #475569;
    flex-shrink: 0;
}

.gsearch-footer-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gsearch-footer-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.gsearch-enter-badge {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: monospace;
    color: #475569;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* ==========================================
   4. RIGHT SIDEBAR
   ========================================== */
.gsearch-right-col {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    background-color: #f8fafc;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gsearch-sec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.gsearch-sec-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
}

.gsearch-clear-all {
    background: transparent;
    border: none;
    color: #059669;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.gsearch-recent-list,
.gsearch-quick-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gsearch-recent-item,
.gsearch-quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .gsearch-recent-item:hover,
    .gsearch-quick-item:hover {
        background-color: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

.gsearch-quick-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #1e293b;
}

    .gsearch-quick-left svg {
        color: #64748b;
        flex-shrink: 0;
    }

.gsearch-quick-cat {
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    background-color: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
}

.gsearch-remove-item {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
}

    .gsearch-remove-item:hover {
        color: #ef4444;
    }

.gsearch-no-recent {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    padding: 4px;
}

/* Bottom Right Tip Box */
.gsearch-tip-box {
    margin-top: auto;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 11px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
    
.gsearch-tip-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gsearch-learn-more {
    color: #059669;
    font-weight: 600;
    text-decoration: none;
}

    .gsearch-learn-more:hover {
        text-decoration: underline;
    }
