/**
 * Стили для блога криптообменника
 *
 * ВАЖНО: Этот файл НЕ переопределяет стили из style.css!
 * Все базовые компоненты (.card, .btn, .badge и т.д.) наследуются из style.css
 * Здесь только специфичные для блога стили с использованием CSS-переменных
 */

/* ================================
   BLOG HERO SECTION
   ================================ */

.blog-hero {
    background: linear-gradient(135deg,
        rgba(30, 64, 175, 0.95) 0%,
        rgba(99, 102, 241, 0.95) 50%,
        rgba(139, 92, 246, 0.95) 100%
    );
    color: white;
    padding: 60px 0 40px;
    margin-bottom: 3rem;
    box-shadow: 0 8px 25px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(217, 119, 6, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(5, 150, 105, 0.3) 0%, transparent 50%);
    z-index: 1;
}

.blog-hero > * {
    position: relative;
    z-index: 2;
}

.blog-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.blog-hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.blog-hero-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.blog-hero-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.blog-hero-icon i {
    font-size: 1.25rem;
    color: var(--crypto-accent);
}

/* ================================
   FEATURED SECTION
   ================================ */

.featured-section {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.featured-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--crypto-accent),
        var(--primary-color),
        var(--success-color)
    );
}

.featured-section .section-title {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-section .section-title i {
    color: var(--crypto-accent);
}

/* Featured badge на карточке */
.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: linear-gradient(135deg, var(--crypto-accent), #ea580c);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ================================
   BLOG CARDS - ДОПОЛНЕНИЯ
   ================================ */

/* Дополняем стандартные карточки из style.css специфичными стилями для блога */
.blog-content .card {
    position: relative; /* Для featured-badge */
}

.blog-content .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-content .card:hover .card-img-top {
    transform: scale(1.05);
}

.blog-content .card-body {
    display: flex;
    flex-direction: column;
}

.blog-content .card-title {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.blog-content .card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-content .card-title a:hover {
    color: var(--primary-color);
}

/* Мета-информация на карточках */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.card-meta .badge {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.card-meta-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ================================
   POST DETAIL PAGE
   ================================ */

/* Breadcrumbs - дополнение к Bootstrap */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Featured изображение */
.featured-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px var(--shadow-color);
}

/* Мета-информация статьи */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta-item i {
    color: var(--primary-color);
    font-size: 1rem;
}

.post-meta-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-meta-item a:hover {
    color: var(--primary-color);
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

/* ================================
   TABLE OF CONTENTS (TOC)
   ================================ */

.toc {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.toc h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc h2 i {
    color: var(--primary-color);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.75rem;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.toc a:hover {
    color: var(--primary-color);
    background: var(--bg-color);
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

/* ================================
   POST CONTENT
   ================================ */

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
    scroll-margin-top: 100px; /* Для якорных ссылок */
}

.post-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post-content a:hover {
    border-bottom-color: var(--primary-color);
}

.post-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.post-content em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Списки */
.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-content ul li {
    position: relative;
}

.post-content ul li::marker {
    color: var(--primary-color);
}

/* Blockquote */
.post-content blockquote {
    background: var(--surface-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.post-content blockquote::before {
    content: '\f10d'; /* FontAwesome quote icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 1rem;
    left: -12px;
    font-size: 1.5rem;
    color: var(--primary-color);
    background: var(--bg-color);
    padding: 4px;
    border-radius: 50%;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
.post-content code {
    background: var(--surface-color);
    color: var(--danger-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    border: 1px solid var(--border-color);
}

.post-content pre {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.post-content pre code {
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    border: none;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Таблицы */
.post-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    background: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.post-content table th,
.post-content table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.post-content table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.post-content table tr:last-child td {
    border-bottom: none;
}

.post-content table tr:hover {
    background: var(--bg-color);
}

/* Изображения */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* ================================
   POST TAGS
   ================================ */

.post-tags {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.post-tags-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-tag-link {
    display: inline-block;
    padding: 6px 14px;
    margin: 0 6px 6px 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.post-tag-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.post-tag-link i {
    font-size: 0.75rem;
    margin-right: 4px;
}

/* Специальные теги с акцентами */
.post-tag-link[data-tag="bitcoin"],
.post-tag-link[href*="bitcoin"] {
    border-color: var(--crypto-accent);
    color: var(--crypto-accent);
}

.post-tag-link[data-tag="bitcoin"]:hover,
.post-tag-link[href*="bitcoin"]:hover {
    background: var(--crypto-accent);
    color: white;
}

.post-tag-link[data-tag="ethereum"],
.post-tag-link[href*="ethereum"] {
    border-color: var(--primary-color);
}

.post-tag-link[data-tag="usdt"],
.post-tag-link[href*="usdt"] {
    border-color: var(--success-color);
    color: var(--success-color);
}

.post-tag-link[data-tag="usdt"]:hover,
.post-tag-link[href*="usdt"]:hover {
    background: var(--success-color);
    color: white;
}

/* ================================
   RELATED POSTS
   ================================ */

.related-posts {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--border-color);
}

.related-posts-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* ================================
   BLOG SIDEBAR
   ================================ */

/* Sticky позиционирование для всего sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

.blog-sidebar .card {
    margin-bottom: 2rem;
}

.blog-sidebar .card-header {
    background: var(--surface-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
}

.blog-sidebar .list-group-item {
    background: transparent;
    border: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-sidebar .list-group-item:last-child {
    border-bottom: none;
}

.blog-sidebar .list-group-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-sidebar .list-group-item a:hover {
    color: var(--primary-color);
}

.blog-sidebar .category-count {
    background: var(--surface-color);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Популярные статьи в sidebar */
.popular-post-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-post-item:last-child {
    border-bottom: none;
}

.popular-post-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--crypto-accent), #ea580c);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.popular-post-content {
    flex: 1;
}

.popular-post-title {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.popular-post-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.popular-post-title a:hover {
    color: var(--primary-color);
}

.popular-post-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ================================
   PAGINATION
   ================================ */

/* Дополнение к Bootstrap pagination */
.pagination {
    margin-top: 3rem;
}

.pagination .page-link {
    color: var(--text-secondary);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    color: var(--primary-color);
    background: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--surface-color);
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 992px) {
    .blog-sidebar {
        position: static;
        top: auto;
    }

    .toc {
        position: static;
        top: auto;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 40px 0 30px;
        border-radius: 0 0 16px 16px;
    }

    .blog-hero-title {
        font-size: 2rem;
    }

    .blog-hero-subtitle {
        font-size: 1rem;
    }

    .blog-hero-icons {
        gap: 1rem;
    }

    .blog-content .card-img-top {
        height: 180px;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
    }

    .post-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .featured-section {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .blog-hero-title {
        font-size: 1.75rem;
    }

    .blog-content .card-img-top {
        height: 150px;
    }

    .post-content blockquote {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .post-content table {
        font-size: 0.875rem;
    }

    .post-content table th,
    .post-content table td {
        padding: 0.5rem;
    }
}

/* ================================
   ТЕМНАЯ ТЕМА - ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   ================================ */

[data-theme="dark"] .blog-hero {
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.98) 0%,
        rgba(30, 41, 59, 0.98) 50%,
        rgba(51, 65, 85, 0.98) 100%
    );
}

[data-theme="dark"] .post-content img {
    opacity: 0.95;
}

[data-theme="dark"] .post-content code {
    background: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .featured-badge {
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.6);
}
