/**
 * Live Search - Frontend Styles
 *
 * @package Live_Search
 * @since 1.0.0
 */

/* Dropdown Container */
.live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    z-index: 1000;
    background: #212121;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    max-height: 450px;
    overflow-y: auto;
    scrollbar-width: 8px;
    scrollbar-color: rgba(255, 172, 5, 0.3) rgba(0, 0, 0, 0.1);
}

/* Scrollbar styling */
.live-search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.live-search-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.live-search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 172, 5, 0.3);
    border-radius: 4px;
}

.live-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 172, 5, 0.5);
}

/* Results Container */
.live-search-results-container {
    padding: 0.5rem;
}

/* Results List */
.live-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Result Item */
.live-search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
    color: inherit;
}

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

.live-search-result-item:hover,
.live-search-result-item:focus {
    background-color: rgba(255, 172, 5, 0.1);
    outline: none;
}

.live-search-result-focused {
    background-color: rgba(255, 172, 5, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 172, 5, 0.3);
}

/* Result Image */
.live-search-result-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 0.25rem;
    background-color: #333;
    overflow: hidden;
}

.live-search-no-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 0.25rem;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-search-no-image::before {
    content: 'photo';
    font-family: 'Material Symbols Outlined';
    font-size: 24px;
    color: rgba(255, 255, 255, 0.3);
}

/* Result Content */
.live-search-result-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Result Title */
.live-search-result-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Result Meta */
.live-search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Result Category */
.live-search-result-category {
    font-size: 0.75rem;
    color: #ffac05;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Result Price */
.live-search-result-price {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 600;
    background: rgba(255, 172, 5, 0.15);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

/* No Results */
.live-search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.live-search-no-results .material-symbols-outlined {
    font-size: 32px;
    opacity: 0.5;
}

/* Loading Spinner */
.live-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Error Message */
.live-search-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .live-search-dropdown {
        left: -1rem !important;
        right: -1rem !important;
        width: auto !important;
        max-width: none !important;
        min-width: 300px !important;
    }

    .live-search-result-item {
        padding: 0.75rem;
    }

    .live-search-result-image {
        width: 40px;
        height: 40px;
    }

    .live-search-no-image {
        width: 40px;
        height: 40px;
    }

    .live-search-result-title {
        font-size: 0.875rem;
    }
}

/* Large mobile/tablet */
@media (max-width: 991px) {
    .live-search-dropdown {
        position: fixed !important;
        top: auto !important;
        left: 1rem !important;
        right: 1rem !important;
        width: calc(100% - 2rem) !important;
        max-width: none !important;
        z-index: 1050 !important;
    }
}
