/* Улучшенный поиск - основные стили */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 500px;
    overflow: hidden;
    display: none;
    margin-top: 0.25rem;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.suggestions-tabs {
    display: flex;
    gap: 0.5rem;
}

.suggestions-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    color: #6c757d;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestions-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.suggestions-tab.active {
    background: #007bff;
    color: white;
}

.suggestions-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.suggestions-close:hover {
    background: #e9ecef;
    color: #495057;
}

.suggestions-content {
    max-height: 400px;
    overflow-y: auto;
}

/* Группы предложений */
.suggestion-group {
    border-bottom: 1px solid #f1f3f4;
}

.suggestion-group:last-child {
    border-bottom: none;
}

.suggestion-group-header {
    padding: 0.75rem 1rem 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.suggestion-group-items {
    padding: 0.5rem 0;
}

/* Элементы предложений */
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #f8f9fa;
    border-left-color: #007bff;
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.suggestion-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.375rem;
}

.suggestion-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.25rem;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-description {
    color: #6c757d;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-meta {
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.download-count {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Быстрые результаты */
.quick-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.results-count {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.view-all-link {
    color: #007bff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.view-all-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.quick-results-list {
    padding: 0.5rem 0;
}

.quick-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.quick-result-item:hover,
.quick-result-item.selected {
    background: #f8f9fa;
    border-left-color: #007bff;
}

.result-icon {
    width: 50px;
    height: 50px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.app-icon-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.5rem;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-description {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.result-category {
    font-size: 0.625rem !important;
}

.result-rating {
    margin-left: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.rating-stars {
    margin-bottom: 0.25rem;
}

/* Пустые состояния */
.no-suggestions,
.no-results {
    text-align: center;
    padding: 2rem 1rem;
}

.no-suggestions i,
.no-results i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Футер предложений */
.suggestions-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-tips {
    text-align: center;
}

.search-tips kbd {
    background: #e9ecef;
    color: #495057;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

/* Мобильный поиск */
.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
}

.mobile-search-content {
    background: white;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    margin-top: 2rem;
}

.mobile-search-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.mobile-search-input-group {
    display: flex;
    gap: 0.5rem;
}

.mobile-search-input {
    flex: 1;
}

.mobile-search-close {
    flex-shrink: 0;
}

.mobile-search-results {
    max-height: 60vh;
    overflow-y: auto;
}

.mobile-results-list {
    padding: 0.5rem 0;
}

.mobile-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.mobile-result-item:hover {
    background: #f8f9fa;
    color: inherit;
    text-decoration: none;
}

.mobile-result-icon {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mobile-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.375rem;
}

.mobile-icon-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.25rem;
}

.mobile-result-content {
    flex: 1;
    min-width: 0;
}

.mobile-result-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.mobile-no-results {
    text-align: center;
    padding: 2rem 1rem;
}

.mobile-no-results i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .search-suggestions {
        left: -1rem;
        right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .suggestion-item,
    .quick-result-item {
        padding: 1rem;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .result-rating {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Анимации */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-suggestions {
    animation: slideDown 0.2s ease-out;
}

/* Улучшения для существующего поиска */
.search-input-group {
    position: relative;
}

.search-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    border-color: #86b7fe !important;
}

/* Стили для мобильного поиска в нижней панели */
@media (max-width: 768px) {
    .mobile-bottom-nav-item .mobile-bottom-nav-link[href="#"] {
        position: relative;
    }
    
    .mobile-bottom-nav-item .mobile-bottom-nav-link[href="#"]:after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0.5rem;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .mobile-bottom-nav-item .mobile-bottom-nav-link[href="#"]:active:after {
        opacity: 1;
    }
}

/* Улучшения скроллбара */
.suggestions-content::-webkit-scrollbar,
.mobile-search-results::-webkit-scrollbar {
    width: 6px;
}

.suggestions-content::-webkit-scrollbar-track,
.mobile-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.suggestions-content::-webkit-scrollbar-thumb,
.mobile-search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.suggestions-content::-webkit-scrollbar-thumb:hover,
.mobile-search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}