/**
 * @file: news.css
 * @description: Стили для страницы новостей с фильтрами, сортировкой и AJAX подгрузкой
 * @created: 2025-01-20
 */

/* ============================================
   ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ НОВОСТЕЙ
   ============================================ */

.news {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   INFINITE SCROLL ИНДИКАТОРЫ
   ============================================ */

.infinite-scroll-indicator {
    text-align: center;
    padding: 30px 0;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.infinite-scroll-indicator .spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 15px auto;
    border: 3px solid #e3e3e3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.infinite-scroll-indicator p {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
}

.infinite-scroll-indicator .remaining-count {
    color: #3498db;
    font-weight: 600;
    margin-top: 8px;
    font-size: 0.9rem;
}

.infinite-scroll-indicator .remaining-count #remaining-number {
    color: #e74c3c;
    font-weight: 700;
}

.no-more-news {
    text-align: center;
    padding: 25px 0;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px dashed #dee2e6;
}

.no-more-news p {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
}

.loading-indicator {
    text-align: center;
    padding: 20px 0;
    margin: 15px 0;
}

.loading-indicator .spinner {
    width: 24px;
    height: 24px;
    margin: 0 auto 10px auto;
    border: 2px solid #e3e3e3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-indicator p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

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

/* ============================================
   ИНДИКАТОР БЕСКОНЕЧНОЙ ПРОКРУТКИ
   ============================================ */

.infinite-scroll-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    text-align: center;
    min-width: 200px;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.3s ease-out;
}

.infinite-scroll-indicator .spinner {
    width: 24px;
    height: 24px;
    margin: 0 auto 10px auto;
    border: 2px solid #e3e3e3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.infinite-scroll-indicator p {
    color: #2c3e50;
    font-size: 0.9rem;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.infinite-scroll-indicator .remaining-count {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}

.infinite-scroll-indicator .remaining-count #remaining-number {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Коллективы: индикатор автоподгрузки должен быть внутри потока страницы, а не fixed в углу */
.news #groups-container + .infinite-scroll-indicator {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 30px 0 0 0 !important;
    z-index: auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.news #groups-container + .infinite-scroll-indicator .remaining-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Новости и афиши: индикатор автоподгрузки тоже должен быть в потоке страницы */
.news #news-container + .infinite-scroll-indicator,
.news #poster-container + .infinite-scroll-indicator {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 30px 0 0 0 !important;
    z-index: auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.news #news-container + .infinite-scroll-indicator .remaining-count,
.news #poster-container + .infinite-scroll-indicator .remaining-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.view-toggle {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.view-toggle-btn {
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.view-toggle-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-color: #3498db;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.view-toggle-btn i {
    font-size: 1rem;
}

.news h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 15px;
}

.news h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 2px;
}

/* ============================================
   ФИЛЬТРЫ И СОРТИРОВКА
   ============================================ */

.news-filters {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e8ecef;
}

/* Индикатор статуса фильтров */
.filter-status {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-status-label {
    font-weight: 600;
    color: #1976d2;
    font-size: 0.9rem;
}

.filter-status-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-status-item {
    background: #ffffff;
    border: 1px solid #90caf9;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.85rem;
    color: #1976d2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-status-item .filter-status-remove {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.filter-status-item .filter-status-remove:hover {
    opacity: 1;
}

.filter-status-clear {
    background: #f44336;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.filter-status-clear:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.news-filters-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-search-row {
    display: flex;
    justify-content: center;
}

.filter-search-full {
    max-width: 600px;
    flex: 1;
}

.filter-controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group.filter-buttons {
    flex-direction: row;
    gap: 12px;
    align-self: flex-end;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #495057;
    font-family: inherit;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-group input[type="date"] {
    cursor: pointer;
}

.filter-group input[type="search"] {
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-direction: row;
    justify-content: flex-start;
}

.filter-submit,
.filter-reset {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-submit {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.3);
}

.filter-submit:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

.filter-submit:active {
    transform: translateY(0);
}

.filter-reset {
    background: #6c757d;
    color: #ffffff;
}

.filter-reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ============================================
   КОНТЕЙНЕР НОВОСТЕЙ
   ============================================ */

/* Переопределяем старые стили из main.css */
.news .items__news {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 30px !important;
    margin-bottom: 40px !important;
}

/* Вид карточек (по умолчанию) */
.items__news,
.items__news-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Вид списка */
.items__news-list {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 20px !important;
}

.news .items__news.items__news-list {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 20px !important;
}

.items__news-list .news-item,
.news .items__news.items__news-list .news-item {
    display: flex !important;
    flex-direction: row !important;
    max-width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e8ecef !important;
}

.items__news-list .news-item .news-image,
.news .items__news.items__news-list .news-item .news-image {
    width: 300px !important;
    min-width: 300px !important;
    height: 200px !important;
    flex-shrink: 0 !important;
    max-width: 300px !important;
}

.items__news-list .news-item .news-content,
.news .items__news.items__news-list .news-item .news-content {
    flex: 1 !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    -webkit-box-orient: vertical !important;
    -webkit-box-direction: normal !important;
    -webkit-flex-direction: column !important;
    -ms-flex-direction: column !important;
}

.items__news-list .news-item .news__title,
.news .items__news.items__news-list .news-item .news__title {
    font-size: 1.3rem !important;
    margin-bottom: 10px !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

.items__news-list .news-item .news__text,
.news .items__news.items__news-list .news-item .news__text {
    flex-grow: 1 !important;
    margin-bottom: 15px !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

.items__news-list .news-item .news__button,
.news .items__news.items__news-list .news-item .news__button {
    align-self: flex-start !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
}

/* Переопределяем старые стили для article */
/* Важно: переопределяем #group-news, который в старом CSS имеет grid-template-columns: 1fr 2fr */
/* Это может ограничивать отображение новостей */
#group-news,
.news .items__news #group-news {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    -ms-grid-columns: none !important;
    margin: 0 !important;
}

.news .items__news article.news-item,
.news .items__news .news-item,
#group-news.news-item,
.news-item {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #e8ecef !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e8ecef !important;
}

.news-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8ecef;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Переопределяем старые стили для изображения */
.news .items__news article .news-image,
.news .items__news .news-item .news-image,
.news-item .news-image,
.news-image {
    width: 100% !important;
    height: 220px !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    position: relative !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: auto !important;
}

.news-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

.news__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news__img {
    transform: scale(1.05);
}

/* Переопределяем старые стили для контента */
.news .items__news article .news-content,
.news .items__news .news-item .news-content,
.news-item .news-content,
.news-content {
    padding: 20px !important;
    display: flex !important;
    flex: 1 !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    gap: 12px !important;
    -webkit-box-orient: vertical !important;
    -webkit-box-direction: normal !important;
    -webkit-flex-direction: column !important;
    -ms-flex-direction: column !important;
    padding-right: 20px !important;
    -webkit-box-flex: 1 !important;
    -webkit-flex: 1 !important;
    -ms-flex: 1 !important;
}

/* Переопределяем старые стили для даты */
.news .items__news article .news-content .news__date,
.news .items__news .news-item .news-content .news__date,
.news-item .news-content .news__date,
.news__date {
    font-size: 0.85rem !important;
    color: #6c757d !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    text-align: left !important;
    padding: 0 !important;
}

.news .items__news article .news-content time,
.news-item .news-content time {
    background: none !important;
    padding-left: 0 !important;
}

.news__date img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.news__date time {
    font-style: italic;
}

/* Стили кнопок переопределяются в main.css как на главной */

/* Переопределяем старые стили для заголовка */
.news .items__news article .news-content .news__title,
.news .items__news .news-item .news-content .news__title,
.news-item .news-content .news__title,
.news__title {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    transition: color 0.3s ease !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

.news-item:hover .news__title {
    color: #3498db;
}

/* Переопределяем старые стили для текста */
.news .items__news article .news-content .news__text,
.news .items__news .news-item .news-content .news__text,
.news-item .news-content .news__text,
.news__text {
    font-size: 0.95rem !important;
    color: #6c757d !important;
    line-height: 1.6 !important;
    flex-grow: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    text-align: left !important;
}
.no-news {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 1.2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

/* ============================================
   КНОПКА "ЗАГРУЗИТЬ ЕЩЕ"
   ============================================ */

.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
    font-family: inherit;
}

.load-more-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.load-more-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */

.pagination {
    margin: 40px 0;
    text-align: center;
}

.pagination-list {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-list li {
    margin: 0;
}

.pagination-list .pagenav {
    display: block;
    padding: 10px 15px;
    background: #ffffff;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
}

.pagination-list .pagenav:hover {
    background: #3498db;
    color: #ffffff;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.pagination-list li.active .pagenav {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pagination-list li.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-list li.disabled span {
    display: block;
    padding: 10px 15px;
    background: #f8f9fa;
    color: #adb5bd;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    min-width: 44px;
    text-align: center;
}

.pagination p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   ИНДИКАТОР ЗАГРУЗКИ
   ============================================ */

.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 30px 0;
}

.loading-indicator p {
    margin: 0;
    color: #3498db;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.loading-indicator p::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================
   СООБЩЕНИЯ ОБ ОШИБКАХ
   ============================================ */

.error-message {
    background: #fff5f5;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 15px 20px;
    color: #e74c3c;
    font-weight: 600;
    text-align: center;
    margin: 20px 0;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .news {
        padding: 15px;
    }
    
    .news h1 {
        font-size: 2rem;
    }
    
    .view-toggle {
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .view-toggle-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .news-filters-form {
        gap: 15px;
    }
    
    .filter-search-row {
        margin-bottom: 10px;
    }
    
    .filter-search-full {
        max-width: none;
    }
    
    .filter-controls-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-submit,
    .filter-reset {
        width: 100%;
    }
    
    .news .items__news,
    .items__news {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* На мобильных список всегда в одну колонку */
    .items__news-list .news-item {
        flex-direction: column !important;
    }
    
    .items__news-list .news-item .news-image {
        width: 100% !important;
        min-width: 100% !important;
        height: 200px !important;
    }
    
    /* Переопределяем для мобильных */
    .news .items__news article.news-item,
    .news .items__news .news-item,
    #group-news.news-item,
    .news-item {
        display: flex !important;
        flex-direction: column !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
    }
    
    .news .items__news article .news-image,
    .news-item .news-image,
    .news-image {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .news-image {
        height: 200px;
    }
    
    .pagination-list {
        gap: 3px;
    }
    
    .pagination-list .pagenav {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .news h1 {
        font-size: 1.5rem;
    }
    
    .news-filters {
        padding: 15px;
    }
    
    .news-content {
        padding: 15px;
    }
    
    .news__title {
        font-size: 1.2rem;
    }
    
    .load-more-btn {
        padding: 12px 30px;
        font-size: 0.9rem;
    }
}

/* ============================================
   АНИМАЦИИ ПРИ ЗАГРУЗКЕ
   ============================================ */

.news-item {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Задержка анимации для каждого элемента */
.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.2s; }
.news-item:nth-child(3) { animation-delay: 0.3s; }
.news-item:nth-child(4) { animation-delay: 0.4s; }
.news-item:nth-child(5) { animation-delay: 0.5s; }
.news-item:nth-child(n+6) { animation-delay: 0.6s; }

/* ============================================
   УЛУЧШЕНИЯ ДЛЯ ХЛЕБНЫХ КРОШЕК
   ============================================ */

.breadcrumb {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

.breadcrumb ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #6c757d;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #adb5bd;
    margin: 0 5px;
}

/* ============================================
   ИНФОРМАЦИОННЫЙ БЛОК ДЛЯ ПОЛЬЗОВАТЕЛЕЙ
   ============================================ */

/* Информационный блок с инструкциями */
.news-info-block {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.info-icon {
    font-size: 2rem;
    flex-shrink: 0;
    margin-top: 5px;
}

.info-text h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.info-text p {
    margin: 10px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.info-text ul {
    margin: 15px 0;
    padding-left: 20px;
}

.info-text li {
    margin: 8px 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-text strong {
    color: #495057;
}

.tip {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px;
    border-radius: 0 6px 6px 0;
    margin-top: 15px;
}

/* Адаптивность для информационных блоков */
@media (max-width: 768px) {
    .info-content {
        flex-direction: column;
        text-align: center;
    }
    
    .info-icon {
        align-self: center;
        margin-bottom: 10px;
    }
    
    .info-text ul {
        text-align: left;
    }
    
    .news-info-block {
        padding: 15px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .info-text h3 {
        font-size: 1.1rem;
    }
    
    .info-text p,
    .info-text li {
        font-size: 0.85rem;
    }
}

/* ============================================
   AJAX ФИЛЬТРАЦИЯ ДЛЯ НОВОСТЕЙ
   ============================================ */

/* Индикатор загрузки фильтров */
.filter-loading-indicator {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
    color: #6c757d;
}

.filter-loading-indicator .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Счетчик новостей в блоке фильтров */
.news-count-container {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-count-label {
    font-weight: 600;
    color: #1976d2;
}

.news-count-info {
    color: #1976d2;
    font-weight: 500;
}

/* Блок для сообщения "Новости не найдены" */
.no-news-found {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    margin: 20px 20px 20px 0;
    color: #6c757d;
    /* Занимает всю ширину сетки */
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.no-news-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.no-news-found h3 {
    color: #495057;
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.no-news-found p {
    margin: 10px 0;
    font-size: 1rem;
}

.no-news-found ul {
    text-align: left;
    display: inline-block;
    margin: 15px 0;
    padding: 0;
}

.no-news-found li {
    margin: 8px 0;
    color: #6c757d;
}

.no-news-found button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.no-news-found button:hover {
    background: #2980b9;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ AJAX ФИЛЬТРОВ
   ============================================ */

@media (max-width: 768px) {
    .news-count-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .no-news-found {
        margin: 20px 10px;
        padding: 30px 15px;
    }
    
    .filter-loading-indicator {
        margin: 15px 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .news-count-container {
        padding: 8px 12px;
    }
    
    .no-news-found {
        margin: 15px 5px;
        padding: 25px 10px;
    }
    
    .no-news-found ul {
        font-size: 0.9rem;
    }
}
