/**
 * Mega Autocomplete Styles - v1.1.8
 */

/* --- Results Dropdown --- */
.autocomplete-results {
    position: absolute;
    right: 0;
    left: 0;
    top: 100%;
    margin-top: 10px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 500px;
    display: none; 
    z-index: 9999;
    direction: rtl; /* Crucial for RTL layout */
    text-align: right;
}

/* --- Selectable Rows --- */
.autocomplete-item {
    padding: 12px 16px;
    display: flex;
    flex-direction: row; 
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    color: #1e293b;
    text-decoration: none !important;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* --- Hover & Active (Keyboard Navigation) --- */
.autocomplete-item:hover, 
.autocomplete-item.active {
    background: #eef2ff;
    color: #6366f1;
    outline: none;
    text-decoration: none;
}

/* --- Icon (Placed on Right via RTL) --- */
.item-icon {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #64748b;
    margin-left: 12px; /* Gap between icon and text */
}

.autocomplete-item.active .item-icon {
    background: #e0e7ff;
    color: #6366f1;
}

/* --- Text Content --- */
.flex-grow-1 {
    flex: 1;
    font-size: 0.95rem;
    text-align: right;
}

/* --- Score Pill (Left side in RTL) --- */
.score-pill {
    background: #ef4444;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 12px; /* Gap from text */
    flex-shrink: 0;
    display: inline-block;
}

/* Defensive hide if empty */
.score-pill:empty {
    display: none !important;
}

/* --- Load More Item --- */
.load-more-item {
    background-color: #f8fafc;
    font-size: 0.9rem;
    color: #475569;
}

/* --- Text Highlighting --- */
.highlight {
    background: #fef08a;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
    color: #000;
}