/* ============================================
   УЛУЧШЕННЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ БЛОГ-ПОСТА
   ============================================ */

@import url('index.css');

/* Прогресс-бар чтения */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 9999;
    overflow: hidden;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    position: relative;
}

.reading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Hero секция */
.blog-post-hero {
    padding: 40px 0;
    position: relative;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
}

.blog-post-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.blog-post-main {
    min-width: 0;
}

/* Навигация */
.blog-post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.blog-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.blog-back-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    transform: translateX(-3px);
}

.blog-post-share {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-label {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.share-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Заголовок */
.blog-post-header {
    margin-bottom: 40px;
}

.blog-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.blog-category-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.blog-post-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--light);
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

/* Мета информация */
.blog-post-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.author-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--primary);
}

.date-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    color: #10b981;
}

.views-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    color: var(--warning);
}

.time-icon {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.2));
    color: var(--secondary);
}

.meta-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--light);
}

/* Изображение */
.blog-post-featured-image {
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--dark-light);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-wrapper:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
}

.image-zoom-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    opacity: 0;
}

.image-wrapper:hover .image-zoom-btn {
    opacity: 1;
}

.image-zoom-btn:hover {
    background: rgba(99, 102, 241, 0.8);
    transform: scale(1.1);
}

/* Контент статьи */
.blog-post-content {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 50px;
    margin-bottom: 40px;
    position: relative;
}

.content-wrapper {
    font-size: 18px;
    line-height: 1.9;
    color: var(--light);
}

.content-wrapper h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 40px 0 20px;
    color: var(--light);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--glass-border);
}

.content-wrapper h3 {
    font-size: 26px;
    font-weight: 600;
    margin: 30px 0 15px;
    color: var(--light);
}

.content-wrapper h4 {
    font-size: 22px;
    font-weight: 600;
    margin: 25px 0 12px;
    color: var(--light);
}

.content-wrapper p {
    margin-bottom: 20px;
}

.content-wrapper ul,
.content-wrapper ol {
    margin: 20px 0;
    padding-left: 30px;
}

.content-wrapper li {
    margin-bottom: 10px;
}

.content-wrapper a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.content-wrapper a:hover {
    color: var(--secondary);
}

.content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
}

.content-wrapper blockquote {
    border-left: 4px solid var(--primary);
    padding: 20px 30px;
    margin: 30px 0;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-style: italic;
}

.content-wrapper code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.content-wrapper pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.content-wrapper pre code {
    background: none;
    padding: 0;
}

/* Теги */
.blog-post-tags {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
}

.tags-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--light);
}

.tags-header i {
    color: var(--primary);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.blog-tag:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Блок автора */
.blog-author-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    margin-top: 40px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    flex-shrink: 0;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 5px;
}

.author-bio {
    font-size: 14px;
    color: var(--gray);
}

/* Навигация между постами */
.blog-post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.nav-post {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.nav-post:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.next-post:hover {
    transform: translateX(-5px);
}

.nav-post-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.nav-post-content {
    flex: 1;
    min-width: 0;
}

.nav-post-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-post-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.next-post {
    flex-direction: row-reverse;
    text-align: right;
}

/* Похожие статьи */
.blog-similar-posts {
    margin-bottom: 40px;
}

.similar-posts-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.similar-posts-header i {
    font-size: 24px;
    color: var(--primary);
}

.similar-posts-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--light);
    margin: 0;
}

.similar-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.similar-post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.similar-post-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.similar-post-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background: var(--dark-light);
}

.similar-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.similar-post-card:hover .similar-post-image img {
    transform: scale(1.1);
}

.similar-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}

.similar-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.similar-post-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-post-excerpt {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-post-date {
    font-size: 12px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Боковая панель */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-widget {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid var(--glass-border);
    font-size: 16px;
    font-weight: 600;
    color: var(--light);
}

.widget-header i {
    color: var(--primary);
    font-size: 18px;
}

.widget-content {
    padding: 20px;
}

/* Содержание */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-item a {
    display: block;
    padding: 8px 12px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.5;
}

.toc-item a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    transform: translateX(5px);
}

.toc-level-3 {
    font-size: 13px;
}

.toc-level-4 {
    font-size: 12px;
}

/* Популярные статьи */
.popular-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.popular-post-item:last-child {
    margin-bottom: 0;
}

.popular-post-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(5px);
}

.popular-post-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.popular-post-info {
    flex: 1;
    min-width: 0;
}

.popular-post-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-meta {
    font-size: 12px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Подписка */
.subscribe-widget .widget-content p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subscribe-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subscribe-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--light);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.subscribe-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.subscribe-input::placeholder {
    color: var(--gray);
}

.subscribe-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.subscribe-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.subscribe-btn:hover::before {
    width: 300px;
    height: 300px;
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.subscribe-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.subscribe-btn span {
    position: relative;
    z-index: 1;
}

.subscribe-message {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscribe-message.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.subscribe-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.subscribe-message.warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

/* Модальное окно изображения */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-zoom-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-zoom-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-zoom-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
}

.image-zoom-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.image-zoom-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .blog-post-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .blog-sidebar {
        position: static;
        max-height: none;
    }
    
    .blog-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .blog-post-hero {
        padding: 30px 0;
    }
    
    .blog-post-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .blog-post-title {
        font-size: 28px;
    }
    
    .blog-post-meta {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .blog-post-content {
        padding: 30px 20px;
    }
    
    .content-wrapper {
        font-size: 16px;
    }
    
    .content-wrapper h2 {
        font-size: 24px;
    }
    
    .content-wrapper h3 {
        font-size: 20px;
    }
    
    .content-wrapper h4 {
        font-size: 18px;
    }
    
    .blog-post-navigation {
        grid-template-columns: 1fr;
    }
    
    .similar-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-post-title {
        font-size: 24px;
    }
    
    .blog-post-meta {
        grid-template-columns: 1fr;
    }
    
    .meta-item {
        justify-content: flex-start;
    }
    
    .blog-post-content {
        padding: 20px 15px;
    }
    
    .content-wrapper {
        font-size: 15px;
    }
    
    .blog-author-card {
        flex-direction: column;
        text-align: center;
    }
    
    .subscribe-input-wrapper {
        gap: 8px;
    }
    
    .subscribe-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .subscribe-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .subscribe-message {
        font-size: 12px;
        padding: 10px 14px;
    }
}

