/* ==========================================================================
   Resume Search - Meilisearch integration styles
   Consistent with AdminLTE 4 / Bootstrap 5 design system
   ========================================================================== */

/* Search Bar Card */
.meili-search-card .card-body {
    padding: 0.625rem 1rem;
}

.meili-search-card .input-group {
    border-radius: 8px;
    overflow: hidden;
}

.meili-search-card .input-group-text {
    background: #F8F9FA;
    border-color: #DEE2E6;
    color: #64748B;
}

.meili-search-card .form-control {
    border-color: #DEE2E6;
    font-size: 0.925rem;
}

.meili-search-card .form-control:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.meili-search-card .btn-outline-secondary {
    border-color: #DEE2E6;
    color: #94A3B8;
}

.meili-search-card .btn-outline-secondary:hover {
    background: #F1F5F9;
    color: #64748B;
}

/* Results Header */
.meili-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.meili-results-count {
    font-size: 0.825rem;
    color: #64748B;
}

.meili-results-count strong {
    color: #1E293B;
}

/* Results Table */
.meili-results-table {
    margin-bottom: 0;
}

.meili-results-table thead th {
    background: #F8F9FA;
    color: #64748B;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
    padding: 10px 8px;
    white-space: nowrap;
}

.meili-results-table tbody tr {
    cursor: pointer;
    transition: all 0.15s ease;
}

.meili-results-table tbody tr:hover {
    background: #F8FAFC;
}

.meili-results-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    font-size: 0.8rem;
    border-color: #F1F5F9;
}

/* Highlighted search terms from Meilisearch */
.meili-results-table em,
.meili-results em {
    font-style: normal;
    background: rgba(37, 99, 235, 0.12);
    color: #1E40AF;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* Facets Sidebar */
.meili-facet-group {
    background: #FAFBFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
}

.meili-facet-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748B;
    margin-bottom: 0.5rem;
}

.meili-facet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.5rem;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #475569;
    transition: all 0.15s ease;
}

.meili-facet-item:hover {
    background: #E2E8F0;
}

.meili-facet-item.active {
    background: #2563EB;
    color: white;
}

.meili-facet-item.active .badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white;
}

.meili-facet-item .badge {
    font-size: 0.65rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

/* Load More Button */
#meili-load-more {
    border-radius: 50px;
    padding: 0.375rem 1.25rem;
    font-size: 0.8rem;
}

/* Search Results Container */
#meili-results {
    min-height: 100px;
}

/* ==========================================================================
   Semantic Search — tab switcher + search bar + results
   ========================================================================== */

/* Search Mode Tabs */
.search-mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.search-mode-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
}
.search-mode-tab:hover { color: #334155; }
.search-mode-tab.active[data-mode="keyword"] { color: #2563eb; border-bottom-color: #2563eb; }
.search-mode-tab.active[data-mode="semantic"] { color: #7c3aed; border-bottom-color: #7c3aed; }

/* Semantic Search Bar */
.semantic-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.semantic-search-bar .semantic-icon { color: #7c3aed; font-size: 18px; }
.semantic-search-bar .form-control { border-color: #c084fc; }
.semantic-search-bar .form-control:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.15);
}
.btn-semantic-search {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.btn-semantic-search:hover { opacity: 0.9; color: #fff; }
.btn-semantic-search:disabled { opacity: 0.6; cursor: wait; }
.semantic-search-hint { margin-bottom: 12px; }

/* Semantic Results Table */
.semantic-results-table { width: 100%; border-collapse: collapse; }
.semantic-results-table th {
    padding: 8px 10px;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    text-align: left;
}
.semantic-results-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.semantic-results-table tr:hover { background: #faf5ff; }

.semantic-score { font-weight: 700; font-size: 13px; }
.semantic-score-green { color: #16a34a; }
.semantic-score-yellow { color: #ca8a04; }
.semantic-score-red { color: #dc2626; }

.semantic-snippet {
    color: #6b7280;
    font-style: italic;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.semantic-skill-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin: 1px;
    background: #ede9fe;
    color: #5b21b6;
}

.semantic-no-results { text-align: center; padding: 40px 20px; color: #94a3b8; }
.semantic-no-results i { font-size: 36px; display: block; margin-bottom: 8px; }

/* Responsive adjustments */
@media (max-width: 991.98px) {
    #meili-facets {
        margin-top: 1rem;
    }

    .meili-facet-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.625rem;
    }

    .meili-facet-title {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .meili-facet-item {
        flex: 0 0 auto;
        padding: 0.25rem 0.625rem;
    }
}
