/* Global Search — full-screen overlay + results list. Vanilla CSS, no deps. */

.vbd-gs-overlay {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start; justify-content: center;
    padding: 10vh 16px 16px;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.vbd-gs-overlay.is-open { display: flex; }

.vbd-gs-panel {
    width: 100%; max-width: 640px;
    background: #fff; color: #0F172A;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: flex; flex-direction: column;
    max-height: 80vh; overflow: hidden;
}

.vbd-gs-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid #E2E8F0;
}
.vbd-gs-icon { color: #64748B; flex: 0 0 auto; }
.vbd-gs-input {
    flex: 1; min-width: 0;
    border: none; outline: none;
    font-size: 16px; /* 16px prevents iOS zoom on focus */
    color: inherit; background: transparent;
    padding: 6px 0;
}
.vbd-gs-close {
    background: transparent; border: none;
    color: #94A3B8; font-size: 28px; line-height: 1;
    cursor: pointer; padding: 0 4px;
}
.vbd-gs-close:hover { color: #0F172A; }

.vbd-gs-status {
    padding: 8px 16px; font-size: 12px;
    color: #64748B; border-bottom: 1px solid #F1F5F9;
    min-height: 18px;
}

.vbd-gs-results {
    list-style: none; margin: 0; padding: 4px 0;
    overflow-y: auto; flex: 1;
}
.vbd-gs-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
}
.vbd-gs-item:hover,
.vbd-gs-item.is-active {
    background: #F1F5F9;
    border-left-color: #38BDF8;
}

.vbd-gs-logo {
    width: 32px; height: 32px; object-fit: contain;
    flex: 0 0 32px;
    background: #F8FAFC;
    border-radius: 6px;
    padding: 2px;
}
.vbd-gs-logo-fallback {
    display: flex; align-items: center; justify-content: center;
    background: #0F172A; color: #fff;
    font-weight: 600; font-size: 14px;
    text-transform: uppercase;
}

.vbd-gs-meta { min-width: 0; flex: 1; }
.vbd-gs-title {
    font-weight: 600; font-size: 14px;
    color: #0F172A;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vbd-gs-cat {
    font-weight: 400; font-size: 11px; color: #64748B;
    margin-left: 6px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.vbd-gs-sub {
    font-size: 12px; color: #475569;
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vbd-gs-elig { color: #64748B; }

.vbd-gs-footer {
    display: flex; gap: 16px; padding: 10px 16px;
    font-size: 11px; color: #64748B;
    border-top: 1px solid #F1F5F9;
    background: #F8FAFC;
}
.vbd-gs-footer kbd {
    display: inline-block;
    padding: 1px 5px; margin-right: 3px;
    background: #fff; border: 1px solid #CBD5E1;
    border-radius: 3px; font-size: 11px;
    box-shadow: 0 1px 0 #CBD5E1;
    font-family: inherit;
}

/* Small-screen tweaks */
@media (max-width: 640px) {
    .vbd-gs-overlay { padding: 0; align-items: stretch; }
    .vbd-gs-panel { max-height: 100vh; border-radius: 0; }
    .vbd-gs-footer { display: none; }
}

/* Dark mode support (matches site convention) */
[data-theme="dark"] .vbd-gs-panel { background: #1E293B; color: #F1F5F9; }
[data-theme="dark"] .vbd-gs-header { border-color: #334155; }
[data-theme="dark"] .vbd-gs-status { border-color: #334155; color: #94A3B8; }
[data-theme="dark"] .vbd-gs-item:hover,
[data-theme="dark"] .vbd-gs-item.is-active { background: #334155; }
[data-theme="dark"] .vbd-gs-title { color: #F1F5F9; }
[data-theme="dark"] .vbd-gs-sub { color: #CBD5E1; }
[data-theme="dark"] .vbd-gs-logo { background: #334155; }
[data-theme="dark"] .vbd-gs-footer { background: #0F172A; border-color: #334155; }

/* Trigger button that pages can include in their header */
.vbd-gs-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid transparent;
    border-radius: 8px;
    color: #475569;
    font-size: 13px; font-family: inherit;
    cursor: pointer;
}
.vbd-gs-trigger:hover { background: rgba(15, 23, 42, 0.1); color: #0F172A; }
.vbd-gs-trigger kbd {
    padding: 1px 5px; margin-left: 4px;
    background: #fff; border: 1px solid #CBD5E1;
    border-radius: 3px; font-size: 10px;
    color: #64748B;
}
[data-theme="dark"] .vbd-gs-trigger { background: rgba(255,255,255,0.1); color: #CBD5E1; }
[data-theme="dark"] .vbd-gs-trigger:hover { color: #fff; }
