/* ========================================
   Autocomplete Search Styles (Professional)
   ======================================== */

.autocomplete-results,
.search-autocomplete,
.location-autocomplete {
    position: absolute;
    top: calc(100% + 15px);
    left: -20px;
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    min-width: 350px;
}

.autocomplete-results.active,
.search-autocomplete.active,
.location-autocomplete.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.autocomplete-results::-webkit-scrollbar,
.search-autocomplete::-webkit-scrollbar,
.location-autocomplete::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-track,
.search-autocomplete::-webkit-scrollbar-track,
.location-autocomplete::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.autocomplete-results::-webkit-scrollbar-thumb,
.search-autocomplete::-webkit-scrollbar-thumb,
.location-autocomplete::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.autocomplete-results::-webkit-scrollbar-thumb:hover,
.search-autocomplete::-webkit-scrollbar-thumb:hover,
.location-autocomplete::-webkit-scrollbar-thumb:hover {
    background: #c1c1c1;
}

/* List Structure */
.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Headers */
.autocomplete-header,
.autocomplete-category {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #8898aa;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #eee;
}

/* Items */
.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f6f9fc;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f0f7ff;
}

/* Icons */
.autocomplete-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: #f6f9fc;
    color: #525f7f;
    transition: all 0.2s ease;
}

.autocomplete-item:hover .autocomplete-icon,
.autocomplete-item.active .autocomplete-icon {
    transform: scale(1.05);
}

/* Icon Colors */
.autocomplete-item[data-type="clinic"] .autocomplete-icon {
    background: #fff3e0;
    color: #ff9800;
}

.autocomplete-item[data-type="doctor"] .autocomplete-icon {
    background: #e6f7f0;
    color: #28a745;
}

.autocomplete-item[data-type="specialty"] .autocomplete-icon {
    background: #e8f4fd;
    color: #0066cc;
}

.autocomplete-item[data-type="location"] .autocomplete-icon {
    background: #fce4ec;
    color: #e91e63;
}

/* Title & Subtitle */
.autocomplete-label {
    flex: 1;
    min-width: 0;
}

.autocomplete-title {
    font-weight: 600;
    color: #32325d;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-subtitle {
    font-size: 12px;
    color: #8898aa;
}

.autocomplete-label strong {
    color: #0066cc;
    font-weight: 700;
}

/* States */
.autocomplete-loading {
    padding: 25px;
    text-align: center;
    color: #8898aa;
    font-size: 14px;
}

.autocomplete-loading:before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e9ecef;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: text-bottom;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.autocomplete-no-results,
.autocomplete-empty {
    padding: 25px;
    text-align: center;
    color: #8898aa;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 768px) {
    .autocomplete-results,
    .search-autocomplete,
    .location-autocomplete {
        left: -15px;
        right: -15px;
        min-width: auto;
        border-radius: 12px;
        max-height: 350px;
    }
}