/* Основные стили для сайта с поддержкой светлой и темной темы */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Современная тема */
:root {
    /* Цветовая палитра: Indigo/Slate */
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    
    /* Акценты */
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-primary-muted: #e0e7ff;
    
    --accent-orange: #f59e0b;
    --accent-orange-hover: #d97706;
    --accent-orange-muted: #fef3c7;
    
    --border-color: #cbd5e1;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Темная тема */
[data-theme="dark"] {
    --bg-primary: #020617;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --accent-primary: #818cf8;
    --accent-primary-hover: #a5b4fc;
    --accent-primary-muted: #312e81;
    
    --border-color: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .header {
    background-color: rgba(30, 41, 59, 0.8);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-decoration: none;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-link.active {
    color: var(--accent-primary);
}

/* Кнопка переключения темы */
.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle svg {
    display: none;
    transition: transform 0.3s ease;
}

[data-theme="light"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: block; }

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-primary-muted);
    color: var(--accent-primary);
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Main content */
.main {
    min-height: calc(100vh - 300px);
    padding: 3rem 0;
}

/* News page */
.news-page {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 3rem;
    text-align: center;
}

.page-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.news-count {
    color: var(--text-tertiary);
    font-size: 1.125rem;
}

/* News list */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.news-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.news-card:hover::before {
    opacity: 1;
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.25rem;
    gap: 1.5rem;
}

.news-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.news-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.news-title a:hover {
    color: var(--accent-primary);
}

.news-date {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.news-summary {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.news-source {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* News detail */
.news-detail {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-primary);
}

.news-detail-header {
    margin-bottom: 3rem;
}

.news-detail-title {
    font-size: 2.75rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-tertiary);
    font-size: 1rem;
    font-weight: 500;
}

.news-detail-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
}

.news-summary-block {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-primary);
}

.news-summary-block h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
    font-weight: 700;
}

.news-full-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.news-text-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.news-text-content p {
    margin-bottom: 1.5rem;
}

.news-detail-actions {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 4rem;
}

.pagination-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-weight: 600;
    transition: all 0.2s;
}

.pagination-link:hover:not(.disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-muted);
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
}

.pagination-page {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination-page:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pagination-page-active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0;
    margin-top: 6rem;
    text-align: center;
}

.footer p {
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
    }
    
    .nav {
        display: none; /* Can add a mobile menu later */
    }
    
    .news-detail-title {
        font-size: 2rem;
    }
    
    .news-detail-content {
        padding: 1.5rem;
    }
}

