/* -----------------------------------------------------------
   GLOBAL VARIABLES (Light Mode Defaults)
----------------------------------------------------------- */
:root {
    --search-bg: #ffffff;
    --search-text: #1a1a1a;
    --search-placeholder: #6b6b6b;

    --search-border: #d0d7de;
    --search-border-focus: #3b82f6;

    --dropdown-bg: #ffffff;
    --dropdown-border: #d0d7de;

    --item-bg: #ffffff;
    --item-hover-bg: #f1f5f9;
    --item-text: #111111;

    --group-title: #596573;

    --clear-btn-color: #7a7a7a;
    --clear-btn-hover-bg: #e5e7eb;
}

/* -----------------------------------------------------------
   WRAPPER
----------------------------------------------------------- */
#fuzzyWrapper {
    position: relative;
    width: 90%; /* original 100*/
    max-width: 650px; /* original 650*/
    margin: 0 auto;
    isolation: isolate;
    z-index: 999999 !important;
}

#fuzzyWrapper:focus-within,
#fuzzyWrapper.search-active {
    z-index: 9999999 !important;
}

.fuzzy-search-host-active {
    position: relative !important;
    z-index: 9999998 !important;
}

/* -----------------------------------------------------------
   SEARCH INPUT (WHITE + NEON GLOW ONLY)
----------------------------------------------------------- */
#fuzzyInput {
    width: 100%;
    padding: 12px 64px 12px 24px;
    font-size: 16px;

    border-radius: 9999px;

    /* FIXED WHITE BACKGROUND */
    background: #ffffff;

    /* NEON BORDER */
    border: 1.5px solid rgba(0, 234, 255, 0.6);

    color: #111111;
    outline: none;

    /* ALWAYS GLOW */
    box-shadow:
        0 0 0 1px rgba(0, 234, 255, 0.25),
        0 0 14px rgba(0, 234, 255, 0.18);
}

#fuzzyInput::placeholder {
    color: #6b6b6b;
}

#fuzzyWrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    pointer-events: none;
    opacity: 0;
    border: 2px solid #00eaff;
    box-shadow:
        0 0 0 2px rgba(0, 234, 255, 0.45),
        0 0 20px rgba(0, 234, 255, 0.35);
    transition: opacity 0.25s ease;
    z-index: 10;
}

#fuzzyWrapper:focus-within::after {
    opacity: 1;
}

/* -----------------------------------------------------------
   CLEAR BUTTON
----------------------------------------------------------- */
#clearSearchBtn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
    cursor: pointer;
    display: none;
    color: var(--clear-btn-color);
    padding: 4px 8px;
    border-radius: 50%;
    transition: 0.2s ease;
    z-index: 9999999 !important;
}

#clearSearchBtn:hover {
    background: var(--clear-btn-hover-bg);
}

/* -----------------------------------------------------------
   DROPDOWN
----------------------------------------------------------- */
#fuzzyResults {
    position: absolute;
    width: 100%;
    top: 60px;
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 26px rgba(0,0,0,0.15);
    display: none;
    z-index: 9999999 !important;

    max-height: min(420px, calc(100vh - 130px));
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
}

#fuzzyResults.show {
    display: block;
}

/* -----------------------------------------------------------
   DROPDOWN ITEMS
----------------------------------------------------------- */
.fuzzy-item {
    padding: 12px 14px;
    background: var(--item-bg);
    border-radius: 10px;
    color: var(--item-text);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.17s ease, transform 0.15s ease;
    margin-bottom: 6px;
}

.fuzzy-item:hover,
.fuzzy-item.active {
    background: var(--item-hover-bg);
    transform: translateX(6px);
}

.fuzzy-item.active {
    border-color: var(--search-border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.16);
}

/* -----------------------------------------------------------
   GROUP TITLES
----------------------------------------------------------- */
.results-group-title,
.no-match,
.related-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--group-title);
    margin: 8px 4px;
}

.no-match {
    text-align: center;
    font-weight: 500;
    margin-bottom: 12px;
}

/* -----------------------------------------------------------
   MOBILE
----------------------------------------------------------- */
@media (max-width: 420px) {
    #fuzzyInput {
        font-size: 15px;
        padding: 10px 56px 10px 18px;
    }

    .fuzzy-item {
        padding: 14px;
        font-size: 16px;
    }
}
