:root {
    --primary: #9b1c5a;
    --primary-dark: #7a1347;
    --primary-light: #c0256e;
    --accent: #e91e8c;
    --radius: 12px;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* ── Hero ── */
.expert-hero {
    background: linear-gradient(135deg, #7a1347 0%, #c0256e 60%, #e91e8c 100%);
  padding: 28px 0;
  position: sticky;
  top: 86px;
  z-index: 100;
}

.search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 1.1rem;
    z-index: 2;
}

#expertSearchInput {
    border: none;
    border-radius: 50px;
    padding: 14px 160px 14px 48px;
    font-size: 1rem;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    outline: none;
}

.btn-discover {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 26px;
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-discover:hover {
    background: var(--primary-dark);
}

/* ── Layout ── */
.expert-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px 4vw 40px;
    margin: auto;
}

/* ── Sidebar ── */
.filter-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: sticky;
    top: 235px;
}

.filter-sidebar-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-sidebar-header .clear-all-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: none;
}

.filter-sidebar-header .clear-all-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.filter-sidebar-header .clear-all-btn.visible {
    display: inline-block;
}

.filter-group {
    border-bottom: 1px solid #f0f0f0;
}

.filter-group-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.filter-group-toggle:hover {
    background: #fdf0f6;
}

.filter-group-toggle .toggle-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group-toggle .bi-chevron-down {
    transition: transform 0.2s;
    font-size: 0.8rem;
    color: #999;
}

.filter-group-toggle[aria-expanded="false"] .bi-chevron-down {
    transform: rotate(-90deg);
}

/* Active count badge on group header */
.filter-group-active-count {
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    display: none;
}

.filter-group-active-count.visible {
    display: inline-block;
}

.filter-group-body {
    padding: 4px 18px 12px;
    max-height: 220px;
    overflow-y: auto;
}

.filter-group-body::-webkit-scrollbar {
    width: 4px;
}

.filter-group-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #444;
    border-radius: 4px;
    transition: background 0.1s;
}

.filter-item:hover {
    background: #fdf0f6;
    padding-left: 4px;
}

.filter-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-item .filter-label {
    flex: 1;
    line-height: 1.3;
}

.filter-item .filter-count {
    font-size: 0.75rem;
    color: #999;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 1px 7px;
    flex-shrink: 0;
    transition:
        background 0.2s,
        color 0.2s;
}

/* When item is checked, count badge turns pink */
.filter-item input:checked ~ .filter-label {
    color: var(--primary);
    font-weight: 600;
}

.filter-item input:checked ~ .filter-count {
    background: #fde8f2;
    color: var(--primary);
}

/* ── Active Filter Tags ── */
#activeFiltersBar {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 24px;
    background: #fdf5f9;
    border-bottom: 1px solid #f0e0ea;
}

#activeFiltersBar.visible {
    display: flex;
}

#activeFiltersBar .bar-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

.active-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: 4px 12px 4px 14px;
    font-size: 0.8rem;
    font-weight: 500;
}

.active-tag .tag-section {
    font-size: 0.68rem;
    opacity: 0.75;
    margin-right: 2px;
}

.active-tag button {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background 0.15s;
}

.active-tag button:hover {
    background: rgba(255, 255, 255, 0.5);
}

.clear-all-tags {
    background: none;
    border: 1px solid #ccc;
    color: #888;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s;
}

.clear-all-tags:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Results Panel ── */
.results-panel {
    flex: 1;
    min-width: 0;
}

.results-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.results-count {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.results-count .query-time {
    background: #fff3e0;
    color: #e65100;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-right label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.toolbar-right select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    background: #fff;
    color: #333;
}

.toolbar-right select:focus {
    outline: none;
    border-color: var(--primary);
}
/* ── Expert Cards ── */
#expertResults {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.expert-header{
    position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}
.expert-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #f0f0f0;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}
.expert-card:hover {
    box-shadow: 0 6px 24px rgba(155, 28, 90, 0.13);
    transform: translateY(-2px);
}

.expert-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.expert-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0e0ea;
    flex-shrink: 0;
    background: #f5e6f0;
}

.expert-avatar-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #f0dcea;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #e8cfe0;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.expert-avatar-placeholder i {
    font-size: 1.8rem;
    color: var(--primary);
}

.expert-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 3px;
    line-height: 1.25;
    word-break: break-word;
}

.expert-designation {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.expert-since {
    font-size: 0.78rem;
    color: #aaa;
}

/* ── Subject Badge: full width pill ── */
.expert-badges {
    margin-bottom: 0;
}

.expert-subject-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 14px;
    background: #fdf0f6;
    border: 1px solid #f0c8e0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expert-subject-badge i {
    font-size: 0.82rem;
    color: var(--primary);
    flex-shrink: 0;
}

/* ── Divider ── */
.expert-divider {
    height: 1px;
    background: #f5f5f5;
    margin: 10px 0;
}

/* ── Meta rows ── */
.expert-meta {
    font-size: 0.85rem;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom:10px;
}

.expert-meta .meta-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.expert-meta .meta-row i {
    color: var(--primary);
    font-size: 0.85rem;
    margin-top: 1px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* ── Footer ── */
.expert-vidwan {
    font-size: 0.82rem;
    color: #aaa;
}

.expert-vidwan span {
    color: var(--primary);
    font-weight: 700;
}

.expert-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-full-profile {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.04em;
    transition: gap 0.2s;
}

.btn-full-profile:hover {
    gap: 8px;
    color: var(--primary-dark);
}
/* ── Sticky Pagination Bar ── */
/* ── Pagination bar ─────────────────────────────────────────────────────────
           position:sticky + bottom:16px  →  pure CSS, zero JS needed.
           - While the bar's natural in-flow position is BELOW the viewport:
             it sticks to viewport bottom (16px gap), exactly like position:fixed.
           - Once the user scrolls far enough that the bar's natural position
             enters the viewport: it simply sits there in the flow.
           The parent (.results-panel) must NOT have overflow:hidden/auto.
           ──────────────────────────────────────────────────────────────────────── */
#stickyPagination {
    display: none;
    align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  padding: 12px 20px;
  margin-top: 24px;
  position: sticky;
  bottom: 16px;
  z-index: 50;
}

#stickyPagination.visible {
    display: flex;
}

/* Left: showing info */
.pagination-info {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    min-width: 160px;
}

.pagination-info strong {
    color: var(--primary);
}

/* Center: page buttons */
#paginationWrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #444;
    font-size: 0.88rem;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
    padding: 0 10px;
    font-weight: 500;
}

.page-btn:hover {
    background: #fdf0f6;
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Right: scroll-to-top */
.btn-scroll-top {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #333;
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}

.btn-scroll-top:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Loading / Empty ── */
.loading-overlay {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loading-overlay .spinner-border {
    color: var(--primary);
    width: 2.5rem;
    height: 2.5rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state i {
    font-size: 3rem;
    color: #e0c0d0;
}

@media (max-width: 768px) {
    .expert-layout {
        flex-direction: column;
    }

    .filter-sidebar {
        width: 100%;
        position: static;
    }

    #expertResults {
        grid-template-columns: 1fr;
    }

    .toolbar-right {
        margin-left: 0;
    }
}
