/**
 * AJAX Live Search Dropdown Styles
 * Optimized for fast, clean display
 */

.ajax-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    margin-top: -1px;
}

.ajax-search-results {
    padding: 0;
    margin: 0;
}

.ajax-search-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.ajax-search-item:hover,
.ajax-search-item.selected {
    background-color: #f5f5f5;
}

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

.ajax-search-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.ajax-search-title mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    font-weight: 600;
}

.ajax-search-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.ajax-search-category {
    font-size: 11px;
    color: #999;
    display: inline-block;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
}

.ajax-search-loading {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.ajax-search-no-results {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.ajax-search-footer {
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    padding: 10px 16px;
    text-align: center;
}

.ajax-search-view-all {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.ajax-search-view-all:hover {
    color: #004499;
    text-decoration: underline;
}

/* Loading animation */
.ajax-search-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

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

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

.ajax-search-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ajax-search-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ajax-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ajax-search-dropdown {
        max-height: 300px;
        font-size: 13px;
    }

    .ajax-search-item {
        padding: 10px 12px;
    }

    .ajax-search-title {
        font-size: 13px;
    }
}

/* Ensure proper z-index stacking */
.ajax-search-dropdown {
    z-index: 10000 !important;
}

/* Fix for Remui theme if needed */
.search-input-form .ajax-search-dropdown {
    min-width: 300px;
}
