/* css/news.css */



/* =========================================
   ОБЩИЕ СТИЛИ ЛЕНТЫ НОВОСТЕЙ
   ========================================= */

/* Основная обертка страницы */
.news-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 50px;
    box-sizing: border-box;
    min-height: 80vh;
}

/* Секция заголовка */
.news-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.news-title-section h1 {
    font-size: 2rem;
    color: var(--text-color);
    text-shadow: 0 2px 10px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}

.news-title-section h1 i { color: var(--primary-color); }

.news-action-buttons {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 45px; height: 45px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1em;
    transition: var(--transition);
    text-decoration: none;
}

.control-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(106, 90, 255, 0.3);
}

/* Layout (Grid + Sidebar) */
.news-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.news-grid-wrapper { flex: 1; }

/* --- Сайдбар с фильтрами --- */
.news-filters-container {
    width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px 25px;
    position: sticky;
    top: 20px;
    flex-shrink: 0;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    align-self: flex-start;
}

.news-filters-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.news-filter-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex; align-items: center; gap: 10px;
}

.news-filter-title i { color: var(--primary-color); }

.news-filters-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-filter-group { margin-bottom: 0; }

.news-filter-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 2px;
}

/* Инпуты и поиск */
.news-input-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.news-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(106, 90, 255, 0.15);
}

.news-input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.news-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 12px 12px 40px;
    color: var(--text-color);
    font-family: 'Minecraft', sans-serif;
    outline: none;
}

.news-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0 10px;
    cursor: pointer;
}
.news-clear-btn:hover { color: var(--error-color); }

/* Селекты */
.news-select-wrapper { position: relative; }

.news-select-wrapper select {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 15px;
    color: var(--text-color);
    font-family: 'Minecraft', sans-serif;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}

.news-select-wrapper select option {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 10px;
}

.news-select-wrapper select:focus { outline: none; border-color: var(--primary-color); }

.news-select-arrow {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

/* Кнопки действий */
.news-filter-actions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-apply-btn {
    width: 100%;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-weight: 600;
    font-family: 'Minecraft', sans-serif;
    cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    transition: var(--transition);
}

.news-apply-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px var(--shadow-color); }

.news-reset-link {
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s;
}
.news-reset-link:hover { color: var(--text-color); }

.news-filter-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 25px 0;
}

/* Виджет популярных новостей */
.news-widget-title {
    font-size: 0.95rem; color: var(--text-color); margin-bottom: 15px;
    display: flex; align-items: center; gap: 8px; opacity: 0.8;
}
.news-widget-title i { color: var(--warning-color, #FF9F43); }

.news-popular-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-popular-item {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: var(--transition);
}

.news-popular-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-color);
    transform: translateX(5px);
}

.popular-num {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color); /* Было rgba(255,255,255,0.1) */
    opacity: 0.2;             /* Делаем текст бледным через прозрачность */
    min-width: 20px;
    text-align: center;
    transition: all 0.3s;
}
.news-popular-item:hover .popular-num {
    color: var(--primary-color);
    opacity: 1; /* При наведении делаем ярким */
}

.popular-details { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.popular-headline { color: var(--text-color); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popular-stats { font-size: 0.75rem; color: var(--text-muted); }

/* --- Сетка новостей --- */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    display: flex;
    height: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    opacity: 0; transform: translateY(20px);
}

.news-card.visible { opacity: 1; transform: translateY(0); }

.news-card:hover {
    background: var(--hover-bg-color);
    border-color: var(--hover-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.news-card-img-wrap {
    width: 320px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.news-card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.news-card:hover .news-card-img-wrap img { transform: scale(1.1); }

.news-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent 70%);
    display: flex; flex-direction: column; justify-content: flex-end; padding: 15px; pointer-events: none;
}

.news-badge {
    align-self: flex-start;
    background: var(--primary-color);
    color: white;
    font-size: 0.7em; font-weight: bold; padding: 4px 8px; border-radius: 6px; margin-bottom: 8px; text-transform: uppercase;
}

.news-card-body {
    padding: 25px;
    display: flex; flex-direction: column; flex: 1;
    min-width: 0;
}

.news-card-title {
    font-size: 1.3rem; margin: 0 0 10px 0; line-height: 1.3;
}
.news-card-title a { color: var(--text-color); transition: color 0.3s; }
.news-card-title a:hover { color: var(--primary-color); }

.news-card-excerpt {
    color: var(--text-muted); font-size: 0.95rem; line-height: 1.5;
    flex-grow: 1; margin-bottom: 15px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.news-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 15px; border-top: 1px solid var(--border-color);
    font-size: 0.9em; color: var(--text-muted);
}

.news-read-more {
    color: var(--primary-color); font-weight: 600; display: flex; align-items: center; gap: 5px;
}
.news-read-more:hover { transform: translateX(5px); }

/* Alert если нет новостей */
.news-empty-alert {
    text-align: center; padding: 60px; background: var(--card-bg); border: 1px dashed var(--border-color); border-radius: 16px;
}
.news-empty-alert i { font-size: 3em; color: var(--text-muted); margin-bottom: 20px; }
.news-empty-reset { color: var(--primary-color); cursor: pointer; }

/* Пагинация */
.news-pagination {
    margin-top: 40px; display: flex; justify-content: center; gap: 8px;
}
.page-link {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px;
    color: var(--text-color); transition: var(--transition);
}
.page-link:hover { background: var(--hover-bg-color); }
.page-link.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* =========================================
   АДАПТИВНОСТЬ (MOBILE) - ИСПРАВЛЕННАЯ
   ========================================= */

@media (max-width: 1024px) {
    /* На планшетах переносим фильтры наверх */
    .news-layout { flex-direction: column; }

    .news-filters-container {
        width: 100%;
        position: static;
        margin-bottom: 30px;
    }

    /* Сетка фильтров для планшета: в ряд по 3 элемента */
    .news-filters-form {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
        align-items: end;
    }

    .news-filter-separator { display: none; }
}

@media (max-width: 768px) {
    .news-container { padding: 15px; }

    /* Карточки новостей */
    .news-card { height: auto; flex-direction: column; }
    .news-card-img-wrap { width: 100%; height: 200px; }

    /* ФИЛЬТРЫ: СТРОГО В КОЛОНКУ НА ТЕЛЕФОНЕ */
    .news-filters-form {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 15px !important;
    }

    /* Сбрасываем сетку, если она была */
    .news-filters-form > * {
        width: 100% !important;
        margin: 0 !important;
    }

    .news-filter-group {
        width: 100%;
        display: block;
    }

    /* Инпуты и селекты на всю ширину */
    .news-input-wrapper,
    .news-select-wrapper,
    .news-select-wrapper select,
    .news-input-wrapper input {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Кнопка "Применить" */
    .news-filter-actions {
        width: 100%;
    }
    .news-apply-btn {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* --- ИСПРАВЛЕНИЕ: ВОЗВРАЩАЕМ ЛИНИЮ НА ТЕЛЕФОНЕ --- */
    .news-filter-separator {
        display: block !important; /* Принудительно показываем */
        margin: 30px 0;
        width: 100%;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    }
}