/* Blog Features - Стили для лайков, комментариев, шаринга, навигации */

/* ========== СТАТИСТИКА (просмотры, лайки) - в строке с кнопками ========== */
.blog-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.blog-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 12px;
}

.blog-stat-item .stat-icon {
    font-size: 12px;
}

/* ========== КНОПКА ЛАЙКА ========== */
#blog-like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #666;
}

#blog-like-btn:hover {
    background: #fff0f0;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

#blog-like-btn.liked {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-color: #ff6b6b;
    color: #fff;
}

#blog-like-btn .like-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

#blog-like-btn:hover .like-icon {
    transform: scale(1.2);
}

#blog-like-btn.liked .like-icon {
    animation: likeAnimation 0.5s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ========== ШАРИНГ ========== */
#blog-share {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.share-telegram {
    background: #0088cc;
    color: #fff;
}

.share-vk {
    background: #4a76a8;
    color: #fff;
}

.share-whatsapp {
    background: #25d366;
    color: #fff;
}

.share-copy {
    background: #6c757d;
    color: #fff;
}

/* ========== НАВИГАЦИЯ МЕЖДУ СТАТЬЯМИ ========== */
#blog-navigation {
    margin: 8px 0 !important;
    padding: 12px 15px !important;
    border: none !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
}

#blog-navigation * {
    box-sizing: border-box;
}

.nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.nav-prev, .nav-next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid #e0e0e0;
}

.nav-prev:hover, .nav-next:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.nav-placeholder {
    visibility: hidden;
    min-width: 50px;
}

/* ========== КОММЕНТАРИИ ========== */
#blog-comments {
    margin: 8px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    box-sizing: border-box;
}

#blog-comments * {
    box-sizing: border-box;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.comments-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.comments-count {
    background: #667eea;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Форма комментария */
#blog-comment-form {
    margin-bottom: 15px;
    width: 100%;
}

#blog-comment-form textarea {
    width: 100%;
    max-width: 100%;
    min-height: 70px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

#blog-comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

#blog-comment-form button[type="submit"] {
    margin-top: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#blog-comment-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

.comment-buttons-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: 8px;
}

.login-prompt {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
}

.login-prompt a {
    color: #667eea;
    font-weight: 600;
}

/* Список комментариев */
#blog-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-comment {
    background: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 3px solid #dc2626;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-delete {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.comment-delete:hover {
    color: #dc2626;
}

.comment-text {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .nav-bar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        align-items: stretch;
    }

    .nav-bar > .nav-links {
        display: contents;
    }

    .nav-links {
        justify-content: initial;
        align-items: stretch;
    }

    .nav-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 38px;
        box-sizing: border-box;
        padding: 7px 10px;
        font-size: 13px;
        line-height: 1.2;
        margin: 0;
        text-align: center;
        flex: 0 1 auto;
    }

    .login-button-wrapper {
        display: block;
        margin: 0;
        width: 100%;
    }

    .login-button-inner {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        padding: 7px 12px;
        font-size: 13px;
    }

    .user-info,
    .logout {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 38px;
        box-sizing: border-box;
        margin: 0;
    }

    .logout {
        padding: 7px 10px;
    }

    .nav-bar h2,
    #summary-section-title-logo {
        line-height: 1.3;
    }

    .nav-bar h2 {
        font-size: 18px;
        margin: 0 0 4px;
    }

    #summary-section-title-logo {
        width: 36px;
        height: 36px;
    }

    .blog-article {
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 20px 14px 36px !important;
        font-size: 14px !important;
        line-height: 1.65 !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08) !important;
        overflow: hidden;
    }

    .blog-article h1 {
        font-size: 24px !important;
        line-height: 1.28 !important;
        margin-bottom: 10px !important;
    }

    .blog-article h2 {
        font-size: 20px !important;
        line-height: 1.32 !important;
        margin: 28px 0 14px !important;
    }

    .blog-article h3 {
        font-size: 18px !important;
        line-height: 1.35 !important;
    }

    .blog-article p,
    .blog-article li,
    .blog-article td,
    .blog-article th,
    .blog-article a,
    .blog-article span,
    .blog-article strong {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .blog-meta {
        gap: 8px !important;
        margin-bottom: 18px !important;
        font-size: 12px !important;
    }

    .info-grid,
    .service-grid,
    .feature-grid,
    .gallery-grid,
    .price-grid,
    .comparison-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .info-card,
    .service-card,
    .feature-card,
    .price-card,
    .comparison-card,
    .gallery-item,
    .wip-notice,
    .highlight,
    .highlight-box,
    .note-box,
    .cta-box {
        padding: 14px !important;
        border-radius: 10px !important;
    }

    .blog-article img,
    .gallery-image,
    .gallery-item img,
    .article-image,
    .blog-article iframe,
    .blog-article video,
    .blog-article embed,
    .blog-article object {
        max-width: 100% !important;
        height: auto !important;
    }

    .blog-article iframe {
        width: 100% !important;
    }

    .blog-article table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .comment-buttons-row {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .comment-buttons-row > button,
    .comment-buttons-row > a,
    .comment-buttons-row > div,
    .btn-discount-order,
    #blog-comment-form button[type="submit"],
    #blog-like-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .nav-row {
        flex-direction: column;
        gap: 8px;
    }

    .nav-prev, .nav-next {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .nav-placeholder {
        display: none;
    }

    #blog-share {
        justify-content: center;
    }

    #blog-like-btn {
        width: 100%;
        justify-content: center;
    }

    .blog-stats {
        flex-direction: column;
        gap: 6px;
    }

    #blog-comments {
        padding: 12px 10px;
    }
}

@media (max-width: 420px) {
    .nav-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-article {
        padding: 18px 12px 30px !important;
        font-size: 13px !important;
    }

    .blog-article h1 {
        font-size: 22px !important;
    }

    .blog-article h2 {
        font-size: 18px !important;
    }

    .info-card,
    .service-card,
    .feature-card,
    .price-card,
    .comparison-card,
    .gallery-item,
    .wip-notice,
    .highlight,
    .highlight-box,
    .note-box,
    .cta-box {
        padding: 12px !important;
    }
}
