/* Стили для автодополнения поиска */

/* Контейнер автодополнения */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    font-family: Arial, sans-serif;
}

/* Элемент предложения */
.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa;
}

/* Контент предложения */
.suggestion-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Обложка трека */
.suggestion-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.suggestion-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Информация о треке */
.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-artist {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Тип совпадения */
.suggestion-type {
    flex-shrink: 0;
}

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.title {
    background-color: #e3f2fd;
    color: #1976d2;
}

.type-badge.artist {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

/* Подсветка совпадений */
.suggestion-title mark,
.suggestion-artist mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: bold;
}

/* Стили для результатов поиска */
.track-result {
    padding: 12px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.track-result:hover {
    background-color: #f8f9fa;
}

.track-result-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-result-cover {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.track-result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-result-info {
    flex: 1;
    min-width: 0;
}

.track-result-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-result-artist {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-result-actions {
    flex-shrink: 0;
}

.play-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.play-button img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.play-button:hover img {
    opacity: 1;
}

/* Состояния загрузки и ошибок */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
}

.no-results h3 {
    margin-bottom: 8px;
    color: #333;
}

.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
}

.error h3 {
    margin-bottom: 8px;
    color: #dc3545;
}

/* Скроллбар для автодополнения */
.autocomplete-suggestions::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.autocomplete-suggestions {
    animation: fadeIn 0.2s ease-out;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .suggestion-content {
        gap: 8px;
    }
    
    .suggestion-cover {
        width: 35px;
        height: 35px;
    }
    
    .suggestion-title {
        font-size: 13px;
    }
    
    .suggestion-artist {
        font-size: 11px;
    }
    
    .type-badge {
        font-size: 9px;
        padding: 1px 6px;
    }
    
    .track-result-cover {
        width: 45px;
        height: 45px;
    }
    
    .play-button {
        padding: 6px;
    }
    
    .play-button img {
        width: 18px;
        height: 18px;
    }
}

/* Темная тема (если поддерживается) */
@media (prefers-color-scheme: dark) {
    .autocomplete-suggestions {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .suggestion-item {
        border-bottom-color: #444;
    }
    
    .suggestion-item:hover,
    .suggestion-item.selected {
        background-color: #3d3d3d;
    }
    
    .suggestion-title {
        color: #fff;
    }
    
    .suggestion-artist {
        color: #ccc;
    }
    
    .track-result {
        border-bottom-color: #444;
    }
    
    .track-result:hover {
        background-color: #3d3d3d;
    }
    
    .track-result-title {
        color: #fff;
    }
    
    .track-result-artist {
        color: #ccc;
    }
    
    .loading,
    .no-results {
        color: #ccc;
    }
    
    .no-results h3 {
        color: #fff;
    }
} 