/* Menu Fuzzy Search - Frontend Styles */

/* ── Main container ── */
.mfs-search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0 16px;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mfs-search-container:focus-within {
    border-color: rgba(201, 162, 39, 0.55);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.10);
}

/* ── Arrow icon ── */
.mfs-search-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #c9a227;
}

.mfs-search-icon svg {
    width: 17px;
    height: 17px;
}

/* ── Input ── */
.mfs-search-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #1a1a1a !important;
    font-size: 15px;
    padding: 13px 0;
    width: 100%;
}

.mfs-search-input::placeholder {
    color: #a0aec0;
}

/* ── Results dropdown ── */
.mfs-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
    z-index: 9999;
    display: none;
}

.mfs-results.mfs-show {
    display: block;
}

.mfs-results::-webkit-scrollbar { width: 5px; }
.mfs-results::-webkit-scrollbar-track { background: transparent; }
.mfs-results::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

.mfs-result-item {
    padding: 11px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.15s ease;
}

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

.mfs-result-item:hover,
.mfs-result-item.mfs-active {
    background-color: #f0f1f3;
}

.mfs-result-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    font-size: 14px;
}

.mfs-result-description {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 2px;
}

.mfs-result-url {
    font-size: 11px;
    color: #a0aec0;
}

.mfs-result-highlight {
    background-color: rgba(201, 162, 39, 0.18);
    color: #a07c10;
    font-weight: 600;
    padding: 1px 3px;
    border-radius: 2px;
}

.mfs-no-results,
.mfs-loading {
    padding: 18px;
    text-align: center;
    color: #a0aec0;
    font-size: 14px;
}

.mfs-loading::after {
    content: '...';
    animation: mfs-dots 1.5s steps(4, end) infinite;
}

@keyframes mfs-dots {
    0%, 20%  { content: '.'; }
    40%      { content: '..'; }
    60%, 100%{ content: '...'; }
}

/* ── Floating Action Button (FAB) mode ── */

.mfs-fab-wrap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* The circular FAB button */
.mfs-fab-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    color: #c9a227;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.mfs-fab-btn:hover {
    transform: scale(1.08);
    border-color: rgba(201, 162, 39, 0.55);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.10);
}

.mfs-fab-btn svg {
    width: 22px;
    height: 22px;
}

/* The search bar panel above the FAB */
.mfs-search-container.mfs-fab-bar {
    width: 340px;
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: bottom right;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
}

.mfs-search-container.mfs-fab-bar.mfs-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Results open UPWARD in FAB mode */
.mfs-fab-bar .mfs-results {
    top: auto;
    bottom: calc(100% + 8px);
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.10);
}

/* ── Collapsible / nav-trigger mode ── */

.mfs-nav-trigger {
    position: relative;
    display: inline-block;
}

.mfs-trigger-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    color: #c9a227;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mfs-trigger-btn:hover,
.mfs-trigger-btn.mfs-active {
    border-color: rgba(201, 162, 39, 0.55);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.10);
}

.mfs-trigger-btn svg {
    width: 18px;
    height: 18px;
}

.mfs-search-container.mfs-collapsible {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 500px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
}

.mfs-search-container.mfs-collapsible.mfs-expanded {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .mfs-search-container.mfs-collapsible {
        min-width: calc(100vw - 30px);
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-6px);
    }

    .mfs-search-container.mfs-collapsible.mfs-expanded {
        transform: translateX(-50%) translateY(0);
    }
}
