/* ==========================================================================
   Articles Styles - Premium дизайн для статей о финансах
   Интеграция с финансовыми карточками и двухтемная поддержка
   ========================================================================== */

/* CSS переменные для статей */
:root {
    --article-max-width: 1200px;
    --article-content-width: 900px;
    --article-title-gradient: linear-gradient(135deg, var(--primary-color, #4caf50) 0%, #66bb6a 100%);
    --article-card-bg: var(--card-bg, linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%));
    --article-shadow: var(--card-shadow, 0 4px 20px rgba(76, 175, 80, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8) inset);
    
    /* Дополнительные переменные для совместимости с finance-main */
    --card-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    --border-color: rgba(0, 127, 129, 0.15);
    --border-light: rgba(0, 127, 129, 0.1);
    --shadow-strong: 0 8px 32px rgba(0, 127, 129, 0.15);
    --spacing-xl: 2rem;
    --spacing-lg: 1.5rem;
    --spacing-md: 1rem;
    --radius-xl: 20px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --article-card-bg: linear-gradient(145deg, rgba(26, 32, 44, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    --article-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(76, 175, 80, 0.1) inset;
    --article-title-gradient: linear-gradient(135deg, var(--primary-color-light, #66bb6a) 0%, #81c784 100%);
    
    /* Дополнительные переменные для темной темы */
    --card-bg: linear-gradient(145deg, #2a2d3a 0%, #1f2328 100%);
    --border-color: rgba(77, 182, 172, 0.2);
    --border-light: rgba(77, 182, 172, 0.1);
    --shadow-strong: 0 8px 32px rgba(15, 15, 15, 0.6);
}

/* Основной контейнер статьи */
.article-container {
    max-width: var(--article-max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Основной фрейм статьи в стиле balance */
.frame-article {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 900px;
    margin: 0 auto;
}

/* Хедер статьи в карточке */
.frame-article .article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light, rgba(76, 175, 80, 0.1));
}

/* Хлебные крошки */
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.article-breadcrumb a {
    color: var(--primary-color, #4caf50);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.article-breadcrumb a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color, #4caf50);
    transition: width 0.3s ease;
}

.article-breadcrumb a:hover::after {
    width: 100%;
}

.breadcrumb-separator {
    color: var(--text-muted, #94a3b8);
}

.current-page {
    color: var(--text-primary);
    font-weight: var(--fw-semibold, 600);
}

/* Заголовок статьи с премиум градиентом */
.article-title.finance-card-title {
    font-size: 2.5rem;
    font-weight: var(--fw-bold, 700);
    margin-bottom: 1rem;
    line-height: 1.2;
    background: var(--article-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.article-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Контент статьи - интеграция с finance-card */
.article-content.finance-card {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    padding: 2rem;
    margin-bottom: 2rem;
}

.article-content h2,
.finance-card .finance-card-title {
    font-size: 1.8rem;
    font-weight: var(--fw-semibold, 600);
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color, #4caf50);
}

.article-content h3 {
    font-size: 1.4rem;
    font-weight: var(--fw-semibold, 600);
    color: var(--text-primary);
    margin: 1.5rem 0 1rem 0;
}

.article-content p {
    margin-bottom: 1.2rem;
}

.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Цитаты с премиум градиентом */
.article-content blockquote {
    background: linear-gradient(145deg, 
        rgba(76, 175, 80, 0.05) 0%, 
        rgba(102, 187, 106, 0.05) 100%);
    border-left: 4px solid var(--primary-color, #4caf50);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 12px;
    font-style: italic;
    color: var(--text-primary);
    box-shadow: var(--shadow-light, 0 2px 8px rgba(0, 0, 0, 0.05));
}

/* Выделенные блоки в стиле карточек */
.article-content .highlight-box,
.finance-card .highlight-box {
    background: var(--article-card-bg);
    border: 1px solid var(--card-border, rgba(76, 175, 80, 0.15));
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.highlight-box:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* Футер статьи и теги */
.article-footer-card {
    margin-top: 2rem;
}

.article-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-label.finance-card-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Теги с градиентом */
.tag {
    background: linear-gradient(135deg, var(--primary-color, #4caf50) 0%, #66bb6a 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: var(--fw-medium, 500);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Похожие статьи в стиле stat-card */
.related-articles-card {
    margin-top: 2rem;
}

.related-articles .global-stats-deck {
    gap: 1.5rem;
}

.related-article-item.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-article {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
}

.related-article i {
    font-size: 2rem;
    color: var(--primary-color, #4caf50);
    margin-bottom: 0.5rem;
}

.related-article .stat-label {
    font-size: 0.95rem;
    line-height: 1.4;
}

.related-article-item.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* Темная тема для статей */
[data-theme="dark"] .article-content blockquote {
    background: linear-gradient(145deg, 
        rgba(76, 175, 80, 0.1) 0%, 
        rgba(102, 187, 106, 0.1) 100%);
    border-left-color: var(--primary-color-light, #66bb6a);
}

[data-theme="dark"] .tag {
    background: linear-gradient(135deg, var(--primary-color-light, #66bb6a) 0%, #81c784 100%);
}

[data-theme="dark"] .article-breadcrumb a {
    color: var(--primary-color-light, #66bb6a);
}

[data-theme="dark"] .article-breadcrumb a::after {
    background: var(--primary-color-light, #66bb6a);
}

/* Дополнительные стили для карточек статей */
.finance-card.intro-card,
.finance-card.budget-card,
.finance-card.safety-fund-card,
.finance-card.debt-management-card,
.finance-card.investments-card,
.finance-card.goals-card,
.finance-card.conclusion-card {
    margin-bottom: 2rem;
}

/* Стили для шагов */
.steps-container ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-item {
    display: flex;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(76, 175, 80, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.step-item:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: translateX(4px);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color, #4caf50);
    color: white;
    border-radius: 50%;
    font-weight: var(--fw-bold);
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: var(--fw-semibold);
    display: block;
    margin-bottom: 0.25rem;
}

.step-text {
    color: var(--text-secondary);
}

/* Переключатель периодов для целей */
.goals-content .goal-period {
    display: none;
}

.goals-content .goal-period.active {
    display: block;
}

/* Лист советов */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.tips-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tips-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color, #4caf50);
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .related-articles .global-stats-deck {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .article-container {
        padding: 1.5rem 1rem;
    }
    
    .related-articles .global-stats-deck {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-container {
        padding: 1rem;
    }
    
    .frame-article {
        padding: var(--spacing-lg, 1.5rem);
        margin: 0 1rem;
    }
    
    .article-title.finance-card-title {
        font-size: 2rem;
    }
    
    .article-subtitle {
        font-size: 1.1rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-content.finance-card {
        padding: 1.5rem;
    }
    
    .related-articles .global-stats-deck {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .finance-card h2,
    .finance-card .finance-card-title {
        font-size: 1.5rem;
    }
    
    /* Мобильные вкладки */
    .finance-tabs .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .frame-article {
        padding: var(--spacing-md, 1rem);
        margin: 0 0.5rem;
        border-radius: var(--radius-lg, 16px);
    }
    
    .article-title.finance-card-title {
        font-size: 1.75rem;
    }
    
    .article-breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    
    .step-item {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-bottom: 0.5rem;
    }
    
    .tags-container {
        justify-content: center;
    }
}

/* Кнопки навигации в статьях */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-buttons .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Стили для стратегий */
.strategy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.strategy-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(76, 175, 80, 0.1);
}

.strategy-list li:last-child {
    border-bottom: none;
}

/* Дополнительные стили для темной темы */
[data-theme="dark"] .step-item {
    background: rgba(76, 175, 80, 0.1);
}

[data-theme="dark"] .step-item:hover {
    background: rgba(76, 175, 80, 0.15);
}

[data-theme="dark"] .step-number {
    background: var(--primary-color-light, #66bb6a);
}

[data-theme="dark"] .highlight-box {
    background: rgba(26, 32, 44, 0.5);
    border-color: rgba(76, 175, 80, 0.2);
}

[data-theme="dark"] .strategy-list li {
    border-bottom-color: rgba(76, 175, 80, 0.2);
}

[data-theme="dark"] .tips-list li::before {
    color: var(--primary-color-light, #66bb6a);
}

/* Анимации при загрузке */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.finance-card {
    animation: fadeIn 0.6s ease-out;
}

.finance-card:nth-child(2) {
    animation-delay: 0.1s;
}

.finance-card:nth-child(3) {
    animation-delay: 0.2s;
}

.finance-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Утилитарные классы */
.mt-3 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

/* Переопределение для статей */
.frame-article {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 900px;
    margin: 0 auto;
}

/* Темная тема для frame-article */
[data-theme="dark"] .frame-article {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-strong);
} 