/**
 * C24 Autocomplete Styles
 * Matches the original PHP site styling
 */

/* Dropdown container */
.c24-autocomplete-dropdown {
    position: absolute;
    z-index: 99999;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* All items base style */
.c24-autocomplete-item {
    padding: 0.75rem 1rem;
    font-size: 15px;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
}

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

/* State headers - non-clickable */
.c24-autocomplete-header {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
    cursor: default;
    padding: 0.6rem 1rem;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

/* City items - clickable */
.c24-autocomplete-city {
    cursor: pointer;
    padding-left: 1.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: background-color 0.15s ease;
    color: #333;
}

.c24-autocomplete-city:hover,
.c24-autocomplete-city.c24-autocomplete-highlighted {
    background-color: #f8a913;
    color: #000;
}

.c24-autocomplete-city-name {
    font-weight: 400;
}

.c24-autocomplete-city-state {
    margin-left: 0.5rem;
    font-size: 13px;
    color: #888;
}

.c24-autocomplete-city:hover .c24-autocomplete-city-state,
.c24-autocomplete-city.c24-autocomplete-highlighted .c24-autocomplete-city-state {
    color: #333;
}

/* No results message */
.c24-autocomplete-no-results {
    color: #dc3545;
    font-weight: 500;
    text-align: center;
    padding: 1rem;
    cursor: default;
}

/* Loading state on input */
.c24-autocomplete-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cstyle%3E.spinner{transform-origin:center;animation:rotate .75s linear infinite}@keyframes rotate{100%{transform:rotate(360deg)}}%3C/style%3E%3Cg class='spinner'%3E%3Ccircle cx='12' cy='12' r='8' fill='none' stroke='%23f8a913' stroke-width='2' stroke-dasharray='40 20'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

/* Scrollbar styling */
.c24-autocomplete-dropdown {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.c24-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.c24-autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.c24-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.c24-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Instruction message */
.c24-autocomplete-instruction {
    color: #666;
    font-size: 14px;
    text-align: left;
    padding: 0.875rem 1rem;
    cursor: default;
    background-color: #fafafa;
}

/* Popular locations header */
.c24-autocomplete-examples-header {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
    cursor: default;
    padding: 0.5rem 1rem;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-top: 1px solid #e5e5e5;
}

/* Example/popular location items */
.c24-autocomplete-example {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* City info wrapper - stacked name and state */
.c24-autocomplete-city-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: left;
    align-items: flex-start;
}

.c24-autocomplete-example .c24-autocomplete-city-name {
    font-weight: 500;
    line-height: 1.2;
}

.c24-autocomplete-example .c24-autocomplete-city-state {
    margin-left: 0;
    font-size: 12px;
    line-height: 1.2;
}

/* Vehicle count badge */
.c24-autocomplete-vehicle-count {
    margin-left: auto;
    font-size: 12px;
    color: #888;
    background-color: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    flex-shrink: 0;
    font-weight: 500;
}

.c24-autocomplete-city:hover .c24-autocomplete-vehicle-count,
.c24-autocomplete-city.c24-autocomplete-highlighted .c24-autocomplete-vehicle-count {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .c24-autocomplete-dropdown {
        max-height: 280px;
    }
    
    .c24-autocomplete-item {
        padding: 0.6rem 0.75rem;
    }
    
    .c24-autocomplete-city {
        padding-left: 1rem;
        min-height: 48px;
    }
    
    .c24-autocomplete-instruction {
        font-size: 13px;
        padding: 0.75rem;
    }
    
    .c24-autocomplete-vehicle-count {
        font-size: 10px;
    }
}
