/* =====================================================================
   GLOBAL SMART SEARCH (header .pop-search autocomplete)
   Lives in its own file (loaded after theme-overrides.css) since it's a
   self-contained feature, not a small override -- see global-search.js
   for the behaviour this styles.
   ===================================================================== */

.sm-smart-search .inn {
    position: relative;
}

/* The theme's own ".pop-search .inn input" rule (style.css) still supplies the visible text
   field's look (border, size, color) -- this wrapper only adds room for the icon/spinner/clear
   controls that sit on top of it. */
.sm-search-box {
    position: relative;
}

.sm-search-box input {
    padding-right: 60px !important;
}

.sm-search-box .sm-search-spinner,
.sm-search-box .sm-search-clear {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 4px;
}

/* Loading ring -- shown only while a request for the current keystroke is in flight
   (global-search.js toggles the "is-loading" class), never the site-wide #preloader, so typing
   doesn't flash a full-page overlay on every character. */
.sm-search-spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #f6af04;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

.sm-search-box.is-loading .sm-search-spinner {
    opacity: 1;
    animation: sm-search-spin 0.7s linear infinite;
}

@keyframes sm-search-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.sm-search-clear {
    right: 30px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out, background 0.15s ease-in-out;
}

.sm-search-clear:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sm-search-box.has-text .sm-search-clear {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Results dropdown ------------------------------------------------ */

.sm-search-results {
    display: none;
    position: absolute;
    left: 50px;
    right: 50px;
    top: 100%;
    margin-top: 14px;
    max-height: min(60vh, 560px);
    overflow-y: auto;
    background: rgba(19, 28, 51, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 10px;
    z-index: 5;
    animation: sm-search-fade-in 0.18s ease-out;
}

@keyframes sm-search-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.sm-search-results.is-open {
    display: block;
}

.sm-search-group + .sm-search-group {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sm-search-group__title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 4px 10px 6px;
}

.sm-search-group__title i {
    color: #f6af04;
}

.sm-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: 10px;
    border: none;
    background: none;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease-in-out;
}

.sm-result-item:hover,
.sm-result-item.is-active {
    background: rgba(246, 175, 4, 0.14);
}

.sm-result-item__avatar {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.sm-result-item__icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.16);
    color: #2196f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sm-result-item__body {
    min-width: 0;
    flex: 1;
}

.sm-result-item__title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-result-item__title mark {
    background: rgba(246, 175, 4, 0.35);
    color: #FFF;
    border-radius: 3px;
    padding: 0 1px;
}

.sm-result-item__meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left:5px;
}

.sm-result-item__badge {
    flex: none;
    color: #4caf50;
    font-size: 15px;
}

.sm-search-empty {
    padding: 28px 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
}

.sm-search-viewall {
    display: block;
    text-align: center;
    margin-top: 4px;
    padding: 10px;
    border-radius: 10px;
    color: #2196f3;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.sm-search-viewall:hover {
    background: rgba(33, 150, 243, 0.12);
}

@media (max-width: 767px) {
    .sm-search-results {
        left: 20px;
        right: 20px;
    }
}
