/**
 * Autocomplete Styles
 * Styling for the autocomplete dropdown functionality
 */

/* Autocomplete Container */
.autocomplete-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: none;
}

/* Autocomplete List */
.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

/* Autocomplete Items */
.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8f9fa;
    color: #333;
}

.autocomplete-item:active {
    background-color: #e9ecef;
}

/* Search Input Container */
.pokemon-search-form {
    position: relative;
}

/* Loading State */
.autocomplete-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* No Results State */
.autocomplete-container.no-results .autocomplete-list::after {
    content: 'No suggestions found';
    display: block;
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .autocomplete-container {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 8px 8px 0 0;
        max-height: 50vh;
    }
    
    .autocomplete-list {
        max-height: 50vh;
    }
    
    .autocomplete-item {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* Focus States */
.autocomplete-item:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

/* Accessibility */
.autocomplete-item[aria-selected="true"] {
    background-color: #007cba;
    color: white;
}

/* Smooth Transitions */
.autocomplete-container {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.autocomplete-container.show {
    opacity: 1;
    transform: translateY(0);
}

.autocomplete-container.hide {
    opacity: 0;
    transform: translateY(-10px);
} 