/* Custom Global Search - Sidebar + Grid Layout */

/* Backdrop */
.fi-global-search-custom-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Main Modal */
.fi-global-search-custom {
    position: relative;
    width: 100%;
    max-width: 1400px;
    max-height: 85vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.fi-gs-modal-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* allow scrolling inside modal */
    overflow-y: auto;
}

/* Search Header */
.fi-gs-search-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.fi-gs-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fi-gs-search-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.fi-gs-search-input:focus {
    border-color: rgb(var(--primary-500));
    box-shadow: 0 0 0 3px rgba(var(--primary-500), 0.1);
}

.fi-gs-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: #6b7280;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}

.fi-gs-close-btn:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Layout - Sidebar + Content */
.fi-gs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 500px;
    max-height: calc(85vh - 100px);
    overflow: auto;
}

/* Left Sidebar */
.fi-gs-sidebar {
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 1rem;
}

.fi-gs-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.fi-gs-sidebar-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.fi-gs-count {
    background: rgb(var(--primary-500));
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Category Buttons */
.fi-gs-categories {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.fi-gs-category-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.fi-gs-category-btn:hover {
    background: #f3f4f6;
    border-color: rgb(var(--primary-300));
    transform: translateX(2px);
}

.fi-gs-category-btn.active {
    background: rgba(var(--primary-50), 1);
    border-color: rgb(var(--primary-500));
    box-shadow: 0 0 0 3px rgba(var(--primary-500), 0.1);
}

.fi-gs-category-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.fi-gs-category-count {
    background: #e5e7eb;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.fi-gs-category-btn.active .fi-gs-category-count {
    background: rgb(var(--primary-500));
    color: white;
}

/* Right Content Area */
.fi-gs-content {
    padding: 1.5rem;
    overflow-y: auto;
    background: white;
}

/* Section */
.fi-gs-section {
    margin-bottom: 2.5rem;
}

.fi-gs-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fi-gs-section-count {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
}

/* Results Grid - 3 columns like screenshot */
.fi-gs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Result Card */
.fi-gs-result-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.fi-gs-result-card:hover {
    border-color: rgb(var(--primary-400));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.fi-gs-result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.fi-gs-result-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fi-gs-detail-item {
    font-size: 0.75rem;
    color: #6b7280;
}

.fi-gs-detail-label {
    font-weight: 500;
    color: #9ca3af;
}

.fi-gs-detail-value {
    color: #6b7280;
    margin-left: 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .fi-gs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .fi-gs-layout {
        grid-template-columns: 1fr;
    }

    .fi-gs-sidebar {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 200px;
    }

    .fi-gs-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Theme */
.dark .fi-gs-modal-content {
    background: #1e293b;
}

.dark .fi-gs-search-header {
    background: #0f172a;
    border-color: #334155;
}

.dark .fi-gs-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .fi-gs-sidebar {
    background: #0f172a;
    border-color: #334155;
}

.dark .fi-gs-sidebar-header,
.dark .fi-gs-category-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .fi-gs-category-name,
.dark .fi-gs-result-title {
    color: #f1f5f9;
}

.dark .fi-gs-content {
    background: #1e293b;
}

.dark .fi-gs-result-card {
    background: #0f172a;
    border-color: #334155;
}

.dark .fi-gs-result-card:hover {
    border-color: rgb(var(--primary-500));
}

.dark .fi-gs-close-btn {
    color: #9ca3af;
}

.dark .fi-gs-close-btn:hover {
    background-color: #334155;
    color: #f1f5f9;
}
