﻿/* wwwroot/css/buysell-autocomplete.css */

/* =============================
   AUTOCOMPLETE DROPDOWN
   ============================= */
/* Suggestions container */
.autocomplete-suggestions,
#suggestionsBanner {
    position: absolute; /* relative to .relative parent */
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.2s ease-in-out;
}

/* Sticky state for dropdown */
.home-search.sticky .autocomplete-suggestions,
.home-search.sticky #suggestionsBanner {
    position: fixed !important; /* JS recalculates top/left/width */
    border-radius: 0 0 8px 8px;
    max-width: 700px; /* match form */
}

/* Single suggestion */
.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

    .autocomplete-suggestion:hover {
        background: #f7f7f7;
    }

    /* Section headers */
    .autocomplete-suggestion i {
        width: 16px;
        text-align: center;
    }

/* =============================
   SCROLLBAR STYLING
   ============================= */
.autocomplete-suggestions::-webkit-scrollbar,
#suggestionsBanner::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-track,
#suggestionsBanner::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb,
#suggestionsBanner::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}

    .autocomplete-suggestions::-webkit-scrollbar-thumb:hover,
    #suggestionsBanner::-webkit-scrollbar-thumb:hover {
        background: #999;
    }

/* =============================
   STICKY SEARCH BAR - CLEAN VERSION
   ============================= */
.home-search.sticky {
    position: fixed;
    top: 10px; /* Small gap from top */
    left: 50%;
    transform: translateX(-50%);
    width: 90%; /* Match banner width */
    max-width: 700px; /* Same as banner */
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Keep shadow for depth */
    animation: slideDown 0.3s ease;
}

    /* Make sure the form inside keeps its styling */
    .home-search.sticky form {
        background: white;
        border: 2px solid #ef4444;
        border-radius: 9999px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

/* =============================
   ANIMATIONS
   ============================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* =============================
   RESPONSIVE ADJUSTMENTS
   ============================= */
@media (max-width: 768px) {
    .home-search.sticky {
        width: 95%;
        top: 5px;
    }

    .autocomplete-suggestions,
    #suggestionsBanner {
        max-height: 250px;
    }

    .autocomplete-suggestion {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .autocomplete-suggestions,
    #suggestionsBanner {
        max-height: 200px;
    }

    .autocomplete-suggestion {
        padding: 7px 10px;
        font-size: 12px;
    }
}

/* =============================
   ACCESSIBILITY
   ============================= */
.autocomplete-suggestion:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .autocomplete-suggestions,
    #suggestionsBanner {
        border: 2px solid currentColor;
    }

    .autocomplete-suggestion:hover {
        background-color: #e5e7eb;
    }
}
