/* css/search.css - Стили для системы поиска */

.search-page {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Заголовок поиска */
.search-header {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    text-align: center;
}

.search-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Форма поиска */
.search-form {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1.1rem;
    background: transparent;
    outline: none;
    color: #2c3e50;
}

.search-input::placeholder {
    color: #adb5bd;
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: scale(1.05);
}

.search-btn svg {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Автокомплит */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

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

.suggestion-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.suggestion-title {
    font-weight: 500;
    color: #2c3e50;
}

/* Информация о результатах */
.search-info {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.search-info p {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #495057;
}

/* Фильтры */
.search-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.filter-label {
    font-weight: 600;
    color: #6c757d;
    margin-right: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    text-decoration: none;
    color: #495057;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Результаты поиска */
.search-results{
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-result-item {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.search-result-item:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.2);
}

.result-content {
    flex: 1;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.result-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-title {
    margin: 0;
    flex: 1;
}

.result-title a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
}

.result-title a:hover {
    color: #667eea;
}

.result-excerpt {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #adb5bd;
    margin-bottom: 1rem;
}

.result-url {
    color: #28a745;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f8f9fa;
    color: #6c757d;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid #e9ecef;
}

.result-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Подсветка найденных слов */
mark {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Пагинация */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination-btn {
    padding: 0.8rem 1.2rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination-btn.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Нет результатов */
.no-results {
    background: white;
    padding: 4rem 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.no-results p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.search-suggestions-text {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.search-suggestions-text h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.search-suggestions-text ul {
    margin: 0;
    padding-left: 1.5rem;
}

.search-suggestions-text li {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* Главная страница поиска */
.search-home {
    background: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.search-tips h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.tip-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tip-category {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.tip-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.tip-category h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tip-category p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.tip-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tip-examples a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tip-examples a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Популярные запросы */
.popular-searches {
    text-align: center;
}

.popular-searches h3,
.popular-searches h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.popular-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.popular-query {
    background: white;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-query:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.query-count {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    min-width: 20px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .search-header {
        padding: 1.5rem;
    }

    .search-header h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .search-input-group {
        flex-direction: column;
        border-radius: 15px;
    }

    .search-btn {
        border-radius: 0 0 15px 15px;
        justify-content: center;
    }

    .search-result-item {
        flex-direction: column;
        padding: 1.5rem;
    }

    .result-image {
        width: 100%;
        height: 200px;
        align-self: center;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .tip-categories {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .search-pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .search-header,
    .search-info,
    .search-result-item,
    .no-results,
    .search-home {
        padding: 1rem;
    }

    .search-header h1 {
        font-size: 1.5rem;
    }

    .result-title a {
        font-size: 1.1rem;
    }

    .popular-queries {
        flex-direction: column;
        align-items: center;
    }

    .popular-query {
        width: 100%;
        justify-content: center;
    }
}

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

.search-result-item {
    animation: fadeInUp 0.5s ease-out;
}

.search-result-item:nth-child(2) { animation-delay: 0.1s; }
.search-result-item:nth-child(3) { animation-delay: 0.2s; }
.search-result-item:nth-child(4) { animation-delay: 0.3s; }
.search-result-item:nth-child(5) { animation-delay: 0.4s; }
