/* ============================================================
   Omnilution Quick Search - CSS v3.0
   Matches the Great Wall Header (Inter, red accents)
   ============================================================ */

:root {
    --oqs-red: #ff1f2d;
    --oqs-red-soft: #ffeaea;
    --oqs-ink: #171717;
    --oqs-muted: #6f6f6f;
    --oqs-faint: #9a9a9a;
    --oqs-line: #ececec;
    --oqs-soft: #f7f7f7;
    --oqs-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --oqs-font-ar: "Noto Sans Arabic", "Inter", system-ui, sans-serif;
}

/* --- Trigger bar (shortcode) --- */
.omni-qs-trigger-container {
    position: relative;
    max-width: 620px;
    cursor: pointer;
    font-family: var(--oqs-font);
}

.omni-qs-bar {
    display: flex;
    align-items: center;
    width: 100%;
    background: #faf9f9;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    padding: 3px 5px;
    height: 48px;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.omni-qs-trigger-container:hover .omni-qs-bar { border-color: #d6d6d6; box-shadow: 0 2px 10px rgba(0,0,0,.05); }

.omni-qs-bar input {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
    box-shadow: none !important;
    padding: 0 15px !important;
    pointer-events: none;
}

.omni-qs-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #666;
    font-size: 22px;
}

body.omni-qs-lock { overflow: hidden !important; }

/* ============================================================
   POPUP
   ============================================================ */

#omni-qs-popup-overlay,
#omni-qs-popup-overlay * { box-sizing: border-box; }

#omni-qs-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: flex-start;
    justify-content: center;
    padding: 90px 16px 16px;
    background: rgba(15, 15, 15, .42);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-family: var(--oqs-font);
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transition: opacity .2s ease;
}

#omni-qs-popup-overlay.omni-qs-rtl { font-family: var(--oqs-font-ar); }

#omni-qs-popup-overlay.omni-qs-popup-visible { display: flex; }
#omni-qs-popup-overlay.omni-qs-popup-open { opacity: 1; }
#omni-qs-popup-overlay.omni-qs-popup-closing { opacity: 0 !important; pointer-events: none; }
#omni-qs-popup-overlay.omni-qs-popup-closing #omni-qs-popup-box { opacity: 0 !important; transform: translateY(-12px) scale(.97) !important; }

#omni-qs-popup-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0,0,0,.04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(.98);
    transition: opacity .22s ease, transform .26s cubic-bezier(.2,.8,.2,1);
}

#omni-qs-popup-overlay.omni-qs-popup-open #omni-qs-popup-box { opacity: 1; transform: none; }

/* Top row */
#omni-qs-popup-top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 68px;
    padding: 0 18px 0 22px;
    border-bottom: 1px solid var(--oqs-line);
}

.omni-qs-rtl #omni-qs-popup-top { padding: 0 22px 0 18px; }

.omni-qs-search-icon { font-size: 22px; color: var(--oqs-red); flex: 0 0 auto; }

#omni-qs-popup-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    line-height: normal !important;
    border-radius: 0 !important;
    font-family: inherit !important;
    font-size: 17px !important;
    color: var(--oqs-ink) !important;
    caret-color: var(--oqs-red);
    -webkit-appearance: none;
    appearance: none;
}

#omni-qs-popup-input::placeholder { color: var(--oqs-faint); }
#omni-qs-popup-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

#omni-qs-popup-clear,
#omni-qs-popup-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

#omni-qs-popup-clear[hidden] { display: none; }
#omni-qs-popup-clear:hover { background: var(--oqs-red-soft); color: var(--oqs-red); }

#omni-qs-popup-close { display: none; background: #1e1e1e; color: #fff; }

#omni-qs-popup-esc {
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: #6b6b6b;
    border: 1px solid #dcdcdc;
    border-radius: 7px;
    padding: 4px 9px;
    background: #fafafa;
    cursor: pointer;
    letter-spacing: .03em;
    line-height: 1.4;
    transition: background .15s ease, border-color .15s ease;
}

#omni-qs-popup-esc:hover { background: #f2f2f2; border-color: #bdbdbd; }

#omni-qs-popup-overlay :focus-visible { outline: 2px solid var(--oqs-red); outline-offset: 2px; }

/* Results area */
#omni-qs-popup-results {
    flex: 1 1 auto;
    min-height: 0;
    display: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#omni-qs-popup-results.omni-qs-has-results { display: block; }

.omni-qs-grid { display: grid; grid-template-columns: 1fr; }
.omni-qs-grid.omni-qs-cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.omni-qs-results-col { min-width: 0; padding: 10px; }
.omni-qs-cols-2 .omni-qs-results-col + .omni-qs-results-col { border-inline-start: 1px solid var(--oqs-line); }

.omni-qs-group + .omni-qs-group { margin-top: 8px; }

.omni-qs-section-header,
.omni-qs-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #7a7a7a;
}

.omni-qs-section-header i { font-size: 16px; color: var(--oqs-red); }

.omni-qs-count {
    margin-inline-start: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #f2f2f2;
    color: #777;
    font-size: 11px;
    letter-spacing: 0;
}

/* Result row */
.omni-qs-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 12px;
    color: var(--oqs-ink) !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .12s ease;
}

.omni-qs-popup-item.omni-qs-focused { background: var(--oqs-soft); }

.omni-qs-item-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f3f3f3;
    color: #444;
    font-size: 19px;
    overflow: hidden;
    transition: background .15s ease, color .15s ease;
}

.omni-qs-type-university .omni-qs-item-icon { border-radius: 50%; }

.omni-qs-type-article .omni-qs-item-icon { flex-basis: 56px; width: 56px; height: 42px; border-radius: 8px; }
.omni-qs-item-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.omni-qs-focused .omni-qs-item-icon { background: var(--oqs-red-soft); color: var(--oqs-red); }

.omni-qs-item-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.omni-qs-popup-item-text {
    font-size: 14.5px;
    line-height: 1.35;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.omni-qs-popup-item-text mark { background: none; color: var(--oqs-red); font-weight: 600; padding: 0; }

.omni-qs-item-meta { font-size: 12px; color: var(--oqs-faint); }

.omni-qs-item-arrow {
    flex: 0 0 auto;
    font-size: 17px;
    color: #b5b5b5;
    opacity: 0;
    transition: opacity .15s ease, translate .2s ease, color .15s ease;
}

.omni-qs-focused .omni-qs-item-arrow { opacity: 1; color: var(--oqs-red); translate: 2px 0; }
.omni-qs-rtl .omni-qs-item-arrow,
.omni-qs-rtl .omni-qs-all i { transform: scaleX(-1); }
.omni-qs-rtl .omni-qs-focused .omni-qs-item-arrow { translate: -2px 0; }

.omni-qs-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 10px 4px;
    color: var(--oqs-red) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
}

.omni-qs-all i { font-size: 17px; transition: translate .2s ease; }
.omni-qs-all:hover i { translate: 3px 0; }

/* Idle: popular searches */
.omni-qs-idle { padding: 12px 12px 16px; }
.omni-qs-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 0; }

.omni-qs-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.omni-qs-chip i { font-size: 16px; color: #777; transition: color .15s ease; }
.omni-qs-chip:hover { border-color: var(--oqs-red-soft); background: var(--oqs-red-soft); color: var(--oqs-red); }
.omni-qs-chip:hover i { color: var(--oqs-red); }

/* Loading skeleton */
.omni-qs-skeleton { padding: 16px 20px; display: grid; gap: 14px; }
.omni-qs-skel-row { display: flex; align-items: center; gap: 12px; }
.omni-qs-skel-row span {
    display: block;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f1f1f1 25%, #e7e7e7 50%, #f1f1f1 75%);
    background-size: 200% 100%;
    animation: omni-qs-shimmer 1.1s linear infinite;
}
.omni-qs-skel-row span:first-child { flex: 0 0 38px; height: 38px; border-radius: 10px; }
.omni-qs-skel-row span:last-child { flex: 0 1 55%; }
.omni-qs-skel-row:nth-child(2) span:last-child { flex-basis: 40%; }
.omni-qs-skel-row:nth-child(4) span:last-child { flex-basis: 48%; }

@keyframes omni-qs-shimmer { to { background-position: -200% 0; } }

/* Empty / error */
.omni-qs-popup-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 34px 20px;
    font-size: 14px;
    color: var(--oqs-faint);
    text-align: center;
}

.omni-qs-popup-state i { font-size: 30px; color: #c9c9c9; }

/* Bottom bar */
#omni-qs-popup-bottom {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 0 20px;
    border-top: 1px solid var(--oqs-line);
    background: #fcfcfc;
}

#omni-qs-popup-hint { font-size: 13px; color: var(--oqs-faint); }

#omni-qs-popup-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: auto;
    font-size: 12.5px;
    color: #8a8a8a;
}

#omni-qs-popup-nav span { margin-inline-end: 8px; }

#omni-qs-popup-nav kbd {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border: 1px solid #dedede;
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 11px;
    color: #666;
}

/* Hover only on devices with a mouse */
@media (hover: hover) {
    .omni-qs-popup-item:hover .omni-qs-popup-item-text { color: var(--oqs-red); }
}

@media (prefers-reduced-motion: reduce) {
    #omni-qs-popup-overlay, #omni-qs-popup-overlay * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* Tablet + mobile */
@media (max-width: 768px) {
    #omni-qs-popup-overlay { padding: 12px; }

    #omni-qs-popup-box {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 18px;
    }

    #omni-qs-popup-top { height: 60px; padding: 0 10px 0 16px; gap: 10px; }
    .omni-qs-rtl #omni-qs-popup-top { padding: 0 16px 0 10px; }

    #omni-qs-popup-input { font-size: 16px !important; }

    #omni-qs-popup-esc { display: none; }
    #omni-qs-popup-close { display: grid; }

    .omni-qs-grid.omni-qs-cols-2 { grid-template-columns: 1fr; }
    .omni-qs-cols-2 .omni-qs-results-col + .omni-qs-results-col { border-inline-start: 0; border-top: 1px solid var(--oqs-line); }
    .omni-qs-results-col { padding: 6px; }

    #omni-qs-popup-nav { display: none; }
    #omni-qs-popup-bottom { min-height: 0; padding: 0; border-top: 0; }
    #omni-qs-popup-hint:not(:empty) { padding: 12px 16px; display: block; }
}
