/* ============================================
   СТИЛИ ДЛЯ СТРАНИЦЫ НОВОСТЕЙ
   ============================================ */

.news-section {
    padding: 4rem 0;
    margin: 2rem 0;
    min-height: 60vh;
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.news-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.news-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 3rem 0;
}

/* Фильтры по категориям */
.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(24px) saturate(180%);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Список новостей */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Карточка новости */
.news-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.news-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.news-card-category {
    padding: 0.375rem 0.875rem;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #a5b4fc;
}

.news-card-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-preview {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Загрузка */
.news-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.news-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Пустое состояние */
.news-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    gap: 1.5rem;
}

.news-empty svg {
    color: var(--text-muted);
    opacity: 0.5;
}

.news-empty h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.news-empty p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 400px;
}

/* Модальное окно */
.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.news-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
}

.news-modal-content {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.news-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.news-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.news-modal-header {
    padding: 2.5rem 2.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.news-modal-category {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #a5b4fc;
    margin-bottom: 1rem;
}

.news-modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.news-modal-date {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

.news-modal-body {
    padding: 2rem 2.5rem 2.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.0625rem;
}

.news-modal-body p {
    margin: 0 0 1.5rem 0;
}

.news-modal-body p:last-child {
    margin-bottom: 0;
}

.news-modal-body h1,
.news-modal-body h2,
.news-modal-body h3 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.news-modal-body h1:first-child,
.news-modal-body h2:first-child,
.news-modal-body h3:first-child {
    margin-top: 0;
}

.news-modal-body ul,
.news-modal-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.news-modal-body li {
    margin: 0.5rem 0;
}

.news-modal-body a {
    color: #667eea;
    text-decoration: underline;
}

.news-modal-body a:hover {
    color: #a5b4fc;
}

/* Адаптивность */
@media (max-width: 968px) {
    .news-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .news-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .news-section {
        padding: 2rem 0;
    }
    
    .news-container {
        padding: 0 1rem;
    }
    
    .news-title {
        font-size: 2rem;
    }
    
    .news-subtitle {
        font-size: 1rem;
    }
    
    .news-list {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .news-card {
        padding: 1.5rem;
    }
    
    .news-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
    
    .news-modal-content {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .news-modal-header {
        padding: 2rem 1.5rem 1rem;
    }
    
    .news-modal-title {
        font-size: 1.5rem;
    }
    
    .news-modal-body {
        padding: 1.5rem;
        font-size: 1rem;
    }
    
    .news-modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

