body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f9fafb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
    overflow-x: hidden;
}

.layout-wrapper {
    max-width: 1440px;
    margin: 40px auto;
    display: flex;
    gap: 32px;
    padding: 0 20px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.article-page {
    flex: 1;
    min-width: 0;
    padding: 40px 48px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid #f3f4f6;
    box-sizing: border-box;
    max-width: 100%;
}

.article-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 12px;
}

.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px 8px 12px;
    background: #f3f4f6;
    border-radius: 999px;
    transition: all 0.2s;
}

.article-back-link:hover {
    color: #111827;
    background: #e5e7eb;
}

.site-title-small {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.site-title-small a {
    color: #111827;
    text-decoration: none;
}

.article-hero {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f3f4f6;
}

.article-title {
    font-size: 2.8rem;
    line-height: 1.25;
    margin: 0 0 24px;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: #111827;
}

.article-meta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    font-size: 0.95rem;
    color: #6b7280;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-category {
    background: #EFF6FF;
    color: #2563eb;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.2s;
}

.article-category:hover {
    background: #DBEAFE;
    color: #1d4ed8;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.article-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.article-tag:hover {
    background: #e5e7eb;
    color: #111827;
}

.article-last-updated {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.article-content::after {
    content: "";
    display: block;
    clear: both;
}

.article-content p {
    margin-bottom: 1.4em;
}

.article-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    border-radius: 14px;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.26);
}

.article-content img.article-medium {
    max-width: 100% !important;
    width: 700px !important;
}

.article-content img.article-thumb {
    max-width: 100% !important;
    width: 300px !important;
}

.article-content img.article-image {
    display: inline-block;
    margin: 1em 0;
    vertical-align: middle;
}

.article-content img[style*="float: left"] {
    margin: 1em 1.5em 1em 0 !important;
}

.article-content img[style*="float: right"] {
    margin: 1em 0 1em 1.5em !important;
}

.article-content img.aligncenter,
.article-content img[style*="margin-left: auto"] {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Боковые изображения CKEditor (side) */
.article-content .image.image-style-side {
    float: right;
    max-width: 260px !important;
    width: 260px !important;
    margin: 0 0 1.5em 1.5em;
}

.article-content .image.image-style-side img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 1.6em;
    margin-bottom: 0.6em;
}

.article-content pre,
.article-content pre[class*="language-"] {
    margin: 1.5em 0;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 100% !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.article-content pre code,
.article-content pre[class*="language-"] code {
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
    display: inline-block;
    min-width: 100%;
    box-sizing: border-box !important;
}

.article-content code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.article-content :not(pre)>code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ef4444;
}

/* Галерея статьи */
.article-gallery {
    margin-top: 40px;
    margin-bottom: 20px;
}

.article-gallery h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #111827;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.gallery-grid-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    background: #f9fafb;
}

.gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-grid-item:hover img {
    transform: scale(1.08);
}

.section-divider {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.comments-section {
    margin-top: 28px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 24px;
}

.comments-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

.comments-count {
    font-size: 1rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 500;
}

.comment-form-wrapper {
    margin-bottom: 32px;
    padding: 20px 24px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.comment-form-wrapper h3 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: #111827;
}

.comment-form-row {
    margin-bottom: 12px;
}

.comment-form-row input,
.comment-form-row textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f9fafb;
}

.comment-form-row input:focus,
.comment-form-row textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.comment-form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-form-hint {
    margin: 4px 0 14px;
    font-size: 0.85rem;
    color: #6b7280;
}

.comment-form-wrapper .btn {
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.comment-form-wrapper .btn:hover {
    background: #1d4ed8;
}

/* Modern Threaded Comments Styles */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-box {
    display: flex;
    gap: 16px;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-avatar.admin {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.comment-content-wrapper {
    flex: 1;
    background: #f9fafb;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    position: relative;
}

.comment-content-wrapper.admin-reply {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #111827;
    font-size: 1.05rem;
}

.admin-badge {
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.comment-date {
    color: #6b7280;
    font-size: 0.85rem;
}

.comment-text {
    color: #374151;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Thread lines */
.comment-replies {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-left: 22px;
    margin-left: 22px;
    border-left: 2px solid #e5e7eb;
    margin-top: -8px;
}

.comment-replies .comment-box {
    position: relative;
}

/* Horizontal connector line for replies */
.comment-replies .comment-box::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 22px;
    width: 24px;
    height: 2px;
    background: #e5e7eb;
}

.no-comments {
    font-size: 1rem;
    color: #6b7280;
    text-align: center;
    padding: 40px 0;
    background: #f9fafb;
    border-radius: 16px;
    border: 1px dashed #d1d5db;
}

/* Sidebar Profile (shared with index.css) */
.sidebar-profile {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    box-sizing: border-box;
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 4px solid #f3f4f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.profile-bio {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 24px;
}

.profile-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    color: #111827;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.contact-link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.contact-link svg {
    color: #6b7280;
    transition: color 0.2s;
}

.contact-link:hover svg {
    color: #111827;
}

.sidebar-cat-link:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}

.sidebar-cat-link.active {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

.sidebar-cat-link.active .cat-count {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.sidebar-section-title {
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    text-align: left;
}

.sidebar-cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 12px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.cat-count {
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.toggle-cats-btn {
    background: none !important;
    border: none !important;
    color: #2563eb !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 8px 14px !important;
    text-align: left !important;
    width: fit-content !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.toggle-cats-btn:hover {
    color: #1d4ed8 !important;
    text-decoration: none !important;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .layout-wrapper {
        flex-direction: column;
        padding: 0 16px;
    }

    .sidebar-profile {
        width: 100%;
        position: static;
        order: -1;
        margin-bottom: 24px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .article-page {
        padding: 24px 20px;
        border-radius: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .article-title {
        font-size: 2rem;
        margin-bottom: 16px;
    }

    .article-content {
        font-size: 1.05rem;
    }

    .article-hero {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    .article-header-nav {
        margin-bottom: 24px;
    }

    .article-content pre,
    .article-content pre[class*="language-"] {
        border-radius: 8px;
        margin: 1em 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .layout-wrapper {
        padding: 0 12px;
        margin: 20px auto;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .article-page {
        padding: 20px 16px;
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .article-title {
        font-size: 1.6rem;
    }

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

    .article-content pre,
    .article-content pre[class*="language-"] {
        margin: 1em 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .comment-form-wrapper {
        padding: 16px;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .comment-box {
        gap: 12px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 1002;
    transition: background 0.3s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.article-icon {
    max-width: 300px;
    max-height: 300px;
    cursor: pointer;
    transition: transform 0.2s;
    border-radius: 8px;
}

.article-icon:hover {
    transform: scale(1.05);
}

.lightbox-image img,
.lightbox-trigger img,
img[data-full-src] {
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox-image img:hover,
.lightbox-trigger img:hover,
img[data-full-src]:hover {
    transform: scale(1.02);
}

/* Related Articles Slider */
.related-articles-section {
    margin-top: 40px;
    margin-bottom: 20px;
}

.related-articles-section h2 {
    font-size: 1.4rem;
    color: #111827;
    margin: 0;
}

.related-articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.related-articles-nav {
    display: flex;
    gap: 8px;
}

.rel-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.2s;
    padding: 0;
}

.rel-nav-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: #111827;
}

.rel-nav-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.related-articles-scroll-container {
    position: relative;
}

.related-articles-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 20px 4px;
    margin: -8px -4px 0 -4px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
}

.related-articles-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.related-article-card {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    max-width: 220px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.related-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.related-article-img-wrap {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.related-article-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.related-article-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-article-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article-date {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: auto;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    border-left: 4px solid #3b82f6;
    max-width: 380px;
}

.toast-notification.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-message {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #111827;
}

/* Custom Checkbox Styles */
.custom-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    color: #4b5563;
    cursor: pointer;
    margin-bottom: 20px;
    line-height: 1.5;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.custom-checkbox-label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.custom-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    margin: 2px 0 0 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    cursor: pointer;
}

.custom-checkbox-label input[type="checkbox"]:hover {
    border-color: #3b82f6;
}

.custom-checkbox-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.custom-checkbox-label input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.custom-checkbox-label input[type="checkbox"]:checked::after {
    content: "";
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.custom-checkbox-label a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.custom-checkbox-label a:hover {
    text-decoration: none;
}

@media (max-width: 480px) {
    .custom-checkbox-label {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

/* Custom Share Buttons */
.custom-share-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none;
    padding: 0;
    font-family: inherit;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.share-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.share-vk {
    background-color: #0077FF;
}

.share-tg {
    background-color: #2AABEE;
}

.share-max {
    background-color: #FF5C00;
    /* Max messenger color */
}

.share-max svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-native {
    background-color: #6366f1;
    /* Indigo color for native share */
}

.share-native svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-copy {
    background-color: #4b5563;
    width: auto;
    border-radius: 999px;
    padding: 0 16px;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 8px;
}

.share-copy svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 18px;
    height: 18px;
}

/* Table of Contents - Premium Redesign */
.toc-container {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 32px;
    overflow: hidden;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.toc-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.toc-toggle {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    padding: 4px;
    border-radius: 6px;
}

.toc-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.toc-toggle.active {
    transform: rotate(180deg);
}

.toc-list {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    max-height: 1000px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid transparent;
}

.toc-list.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.toc-item {
    padding: 0;
    margin: 0;
}

.toc-item.h3 {
    padding-left: 12px;
}

.toc-item a {
    color: #475569;
    text-decoration: none !important;
    /* Remove underline */
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: block;
    padding: 8px 20px;
    line-height: 1.5;
    border-left: 3px solid transparent;
}

.toc-item a:hover {
    color: #2563eb;
    background: #f8fafc;
    padding-left: 24px;
}

.toc-item a.active {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 600;
    border-left-color: #2563eb;
}

/* Article Rating - Premium Card Design */
.article-rating-card {
    margin: 60px 0 40px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.article-rating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3b82f6;
    opacity: 0.8;
}

.rating-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.rating-subtitle {
    font-size: 0.95rem;
    color: #64748b;
}

.rating-actions {
    display: flex;
    gap: 20px;
}

.rating-v-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    box-shadow: none !important;
    outline: none !important;
}

.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.rating-v-btn .count {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
}

.rating-v-btn:hover .icon-circle {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

.rating-v-btn.like:hover .icon-circle {
    background: #ecfdf5;
    border-color: #10b981;
    color: #10b981;
}

.rating-v-btn.dislike:hover .icon-circle {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.rating-v-btn:active .icon-circle {
    transform: scale(0.9);
}

@media (max-width: 640px) {
    .article-rating-card {
        padding: 24px 20px;
    }

    .rating-title {
        font-size: 1.2rem;
    }

    .icon-circle {
        width: 48px;
        height: 48px;
    }
}

/* VK-style Back to Top Button */
#vk-back-to-top {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 120px;
    z-index: 900;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, background-color 0.2s;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

#vk-back-to-top:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

#vk-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.vk-top-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
    transition: color 0.2s;
    position: sticky;
    top: 20px;
}

#vk-back-to-top:hover .vk-top-content {
    color: #111827;
}

.vk-top-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

@media (max-width: 1600px) {
    #vk-back-to-top {
        width: 80px;
    }
}

@media (max-width: 1300px) {
    #vk-back-to-top {
        display: none;
    }
}