/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Стили для сообщения об ошибке */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.error-message p {
    margin: 0;
    font-size: 1.1rem;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* Основной контент */
.main {
    padding: 2rem 0;
}

/* Блок новостей */
.news-section {
    margin-bottom: 3rem;
}

.news-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.news-card a
{
    text-decoration: none;
}

.news-card.visible {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

.news-card.hidden {
    display: none;
}

.news-card.show {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-image {
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
}

.news-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.news-content p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.news-date {
    color: #999;
    font-size: 0.85rem;
}

.more-news-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    font-weight: 600;
}

.more-news-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.more-news-btn:active {
    transform: translateY(0);
}

.more-news-btn.hidden {
    display: none;
}

/* Панель с курсами и погодой */
.info-panel {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Курсы валют */
.currency-card,
.weather-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.currency-card h3,
.weather-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.3rem;
}

.currency-list {
    margin-bottom: 1rem;
}

.currency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
}

.currency-item:last-child {
    border-bottom: none;
}

.currency-name {
    font-weight: 500;
}

.currency-rate {
    font-weight: 600;
}

.currency-change {
    font-size: 0.9rem;
    font-weight: 600;
}

.currency-item.up .currency-change {
    color: #27ae60;
}

.currency-item.down .currency-change {
    color: #e74c3c;
}

.currency-item.same .currency-change {
    color: #7f8c8d;
}

.update-time {
    font-size: 0.85rem;
    color: #999;
    text-align: center;
}

/* Погода */
.weather-today {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.current-weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.weather-icon {
    font-size: 3rem;
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.weather-desc {
    color: #666;
    font-size: 1.1rem;
}

.weather-forecast {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.forecast-item:hover {
    background-color: #f8f9fa;
}

.day {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.forecast-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.forecast-temp {
    font-weight: 600;
    color: #2c3e50;
}

/* Подвал */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    margin-left: 1rem;
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

/* Стили для состояния загрузки */
.currency-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Анимация для обновления данных */
.currency-item {
    transition: all 0.3s ease;
}

.currency-item.updating {
    background-color: #fff3cd;
}

/* Стили для сообщения об ошибке в блоке валют */
.currency-error {
    text-align: center;
    padding: 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    margin: 0.5rem 0;
}

/* Стили для состояния загрузки погоды */
.weather-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Анимация появления погодных данных */
.weather-today,
.weather-forecast {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav a {
        margin: 0 1rem;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
    
    .weather-forecast {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .social-links a {
        margin: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .weather-forecast {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 15px;
    }
    
    .news-section h2 {
        font-size: 1.5rem;
    }
}

/* Стили для графика инфляции */
.inflation-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.inflation-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Адаптивность для графика */
@media (max-width: 768px) {
    .chart-container {
        height: 350px;
    }
    
    .legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 300px;
    }
    
    .inflation-section {
        padding: 1.5rem;
    }
    
    .inflation-section h2 {
        font-size: 1.5rem;
    }
}

.article-section {
    margin-bottom: 3rem;
}

.article-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    line-height: 1.3;
}

.article-date {
    color: #999;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: block;
}

.article-fulltext {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
}

.article-fulltext p {
    margin-bottom: 1rem;
}

.loading, .error-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}
@media (max-width: 480px) {
    .article-title {
        font-size: 1.5rem;
    }
    .article-card {
        padding: 1.5rem;
    }
}
