/*  search.css — styles for the Moom help search feature  */
/*  Works in conjunction with search.js                    */

/* ── Search result highlights (injected into page content) ────── */

mark.search-highlight {
    background-color: #ffe135;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
    /* Subtle pulse on first load to catch the eye */
    animation: search-highlight-pulse 1.2s ease-out 0.4s 1;
}

@keyframes search-highlight-pulse {
    0%   { background-color: #ff9800; }
    100% { background-color: #ffe135; }
}

/* ── Wrapper (sits inside .togglenav) ─────────────────────────── */

#search-wrapper {
    position: absolute;
    right: 70px;              /* left of the Many Tricks logo (34px + 20px gap) */
    top: 50%;
    transform: translateY(-50%);
    width: 210px;
    z-index: 1001;
}

/* On narrow screens where the logo is hidden, push right in */
@media (max-width: 650px) {
    #search-wrapper {
        right: 14px;
        width: 170px;
    }
}

/* ── Search input ──────────────────────────────────────────────── */

#search-input {
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 9px center;
    background-size: 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 20px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    padding: 5px 10px 5px 30px;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s;
    /* Remove the native 'x' clear button in WebKit */
    -webkit-appearance: none;
    appearance: none;
}

#search-input:focus {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.65);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.60);
}

/* Remove native search decorations in WebKit */
#search-input::-webkit-search-decoration,
#search-input::-webkit-search-cancel-button,
#search-input::-webkit-search-results-button,
#search-input::-webkit-search-results-decoration {
    display: none;
}

/* ── Results dropdown ──────────────────────────────────────────── */

#search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    overflow-y: auto;
    max-height: 420px;
    z-index: 9999;
}

/* On narrow screens, allow dropdown to overflow left */
@media (max-width: 650px) {
    #search-dropdown {
        width: 280px;
        right: -14px;
    }
}

/* ── Individual result ─────────────────────────────────────────── */

.search-result-item {
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.1s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: #eef8ff;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

.search-result-page {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    line-height: 1.3;
}

/* ── No-results message ────────────────────────────────────────── */

.search-no-results {
    padding: 12px 14px;
    font-size: 13px;
    color: #888;
    font-style: italic;
}
