/**
 * Search Component Styles
 * Centralized styles for the typeahead search functionality
 */

/* Search Container */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 1;
}

/* Search Input */
.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: none;
    border-radius: 25px;
    background-color: var(--background-light);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    background-color: #333;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Custom Search Dropdown */
#custom-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    margin-top: 5px;
    border: 1px solid #333;
}

/* Scrollbar Styling */
#custom-search-dropdown::-webkit-scrollbar {
    width: 8px;
}

#custom-search-dropdown::-webkit-scrollbar-track {
    background: var(--background-dark);
}

#custom-search-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

#custom-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s ease;
}

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

.search-result-item:hover {
    background-color: var(--background-dark);
}

.search-result-item.keyboard-selected {
    background-color: var(--accent-color) !important;
}

/* Artist Avatar */
.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

/* Artist Info */
.search-result-item .artist-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .artist-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
}

.search-result-item .artist-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* DJ Badge */
.search-result-item .dj-badge {
    background: linear-gradient(45deg, #ff6b35, #dc3545);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 8px;
}

/* Loading State */
.search-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.search-dropdown-loading i {
    font-size: 20px;
    margin-bottom: 8px;
}

/* No Results State */
.search-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.search-dropdown-empty i {
    font-size: 24px;
    opacity: 0.5;
    margin-bottom: 8px;
    display: block;
}

/* Error State */
.search-dropdown-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
}

.search-dropdown-error i {
    margin-right: 8px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
    }
    
    .search-input {
        padding: 10px 15px 10px 40px;
        font-size: 16px;  /* Prevents mobile auto-zoom (WCAG: inputs <16px trigger zoom) */
    }
    
    .search-icon {
        font-size: 14px;
        left: 12px;
    }
    
    #custom-search-dropdown {
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    .search-input {
        border-radius: 20px;
    }
    
    .search-result-item {
        padding: 10px 12px;
    }
    
    .search-result-item img {
        width: 35px;
        height: 35px;
    }
}

/* Keyboard Navigation Focus */
.search-input:focus + .search-icon {
    color: var(--text-primary);
}

/* Animation for dropdown appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#custom-search-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}