/* === ОСНОВНИЙ КОНТЕЙНЕР === */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === НАВІГАЦІЯ === */
.article-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f4;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary, #14b8a6);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.nav-back:hover {
    background: rgba(0,128,128,0.1);
    border-color: rgba(0,128,128,0.2);
    transform: translateX(-2px);
    text-decoration: none;
}

.nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9em;
    color: #6b7280;
}

.nav-breadcrumb a {
    color: var(--primary, #14b8a6);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-breadcrumb a:hover {
    color: var(--primary-dark, #0f766e);
    text-decoration: underline;
}

.nav-breadcrumb i {
    font-size: 0.75em;
    color: #d1d5db;
}

/* === ЗАГОЛОВОК СТАТТІ === */
.article-header {
    margin-bottom: 50px;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: #6b7280;
    font-weight: 500;
}

.article-category {
    background: linear-gradient(135deg, var(--primary, #14b8a6), var(--primary-light, #2dd4bf));
    color: white !important;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: clamp(2em, 5vw, 2.8em);
    color: #1f2937;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
    background: linear-gradient(135deg, #1f2937, #374151);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-description {
    font-size: 1.25em;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 400;
}

/* === ЗАСТЕРЕЖЕННЯ === */
.article-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-left: 5px solid #f59e0b;
    border-radius: 12px;
    margin: 30px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.warning-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1em;
}

.warning-content {
    padding: 20px 24px;
    color: #92400e;
    line-height: 1.6;
}

/* === КОНТЕНТ СТАТТІ === */
.article-body {
    line-height: 1.8;
    font-size: 1.1em;
    color: #374151;
    margin: 40px 0;
}

/* Заголовки */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: var(--primary, #14b8a6);
    margin: 40px 0 20px 0;
    font-weight: 700;
    line-height: 1.3;
}

.article-body h1 {
    font-size: 2.5em;
    border-bottom: 4px solid var(--primary, #14b8a6);
    padding-bottom: 12px;
    margin: 50px 0 30px 0;
}

.article-body h2 {
    font-size: 2em;
    border-bottom: 3px solid var(--primary-light, #2dd4bf);
    padding-bottom: 10px;
    margin: 45px 0 25px 0;
}

.article-body h3 {
    font-size: 1.6em;
    border-left: 5px solid var(--primary, #14b8a6);
    padding-left: 20px;
    margin: 35px 0 20px 0;
}

.article-body h4 {
    font-size: 1.4em;
    color: #1f2937;
    margin: 30px 0 15px 0;
}

.article-body h5 {
    font-size: 1.2em;
    color: #374151;
    margin: 25px 0 12px 0;
}

.article-body h6 {
    font-size: 1.1em;
    color: #6b7280;
    margin: 20px 0 10px 0;
}

/* Параграфи */
.article-body p {
    margin-bottom: 20px;
    text-align: justify;
    text-justify: inter-word;
}

/* Списки */
.article-body ul,
.article-body ol {
    margin: 24px 0;
    padding-left: 0;
}

.article-body ul {
    list-style: none;
}

.article-body ul li::before {
    content: "▶";
    color: var(--primary, #14b8a6);
    font-weight: bold;
    display: inline-block;
    width: 1.5em;
    margin-left: 0;
}

.article-body ol {
    counter-reset: custom-counter;
    list-style: none;
}

.article-body ol li {
    counter-increment: custom-counter;
    position: relative;
    padding-left: 2.5em;
}

.article-body ol li::before {
    content: counter(custom-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary, #14b8a6);
    color: white;
    width: 1.8em;
    height: 1.8em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.article-body li {
    margin-bottom: 12px;
    line-height: 1.7;
    padding-left: 1.5em;
}

/* Посилання */
.article-body a {
    color: var(--primary, #14b8a6);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.article-body a:hover {
    color: var(--primary-dark, #0f766e);
    border-bottom-color: var(--primary-light, #2dd4bf);
}

.article-body a[href^="http"]::after {
    content: "↗";
    font-size: 0.8em;
    color: #6b7280;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.article-body a[href^="http"]:hover::after {
    transform: translate(2px, -2px);
}

/* Код */
.article-body code {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9em;
    color: #dc2626;
    font-weight: 600;
}

.article-body pre {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 32px 0;
    border-left: 5px solid var(--primary, #14b8a6);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
}

.article-body pre::before {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 20px 0 0 #f59e0b, 40px 0 0 #10b981;
}

.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.95em;
}

/* Цитати */
.article-body blockquote {
    border-left: 5px solid var(--primary, #14b8a6);
    margin: 32px 0;
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    font-style: italic;
    border-radius: 0 12px 12px 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.article-body blockquote::before {
    content: """;
    font-size: 5em;
    color: rgba(0,128,128,0.2);
    position: absolute;
    top: -10px;
    left: 15px;
    font-family: Georgia, serif;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Таблиці */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.article-body th,
.article-body td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.article-body th {
    background: linear-gradient(135deg, var(--primary, #14b8a6), var(--primary-light, #2dd4bf));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.article-body tr:nth-child(even) {
    background: #f8fafc;
}

.article-body tr:hover {
    background: #ecfdf5;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Горизонтальна лінія */
.article-body hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary, #14b8a6), transparent);
    margin: 40px 0;
    border-radius: 2px;
}

/* Зображення */
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin: 32px auto;
    display: block;
    transition: transform 0.3s ease;
}

.article-body img:hover {
    transform: scale(1.02);
}

/* Виділення тексту */
.article-body mark,
.article-body .highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.article-body strong,
.article-body b {
    font-weight: 700;
    color: #1f2937;
}

.article-body em,
.article-body i {
    font-style: italic;
    color: #6b7280;
}

/* Спеціальні блоки */
.article-body .info-box {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-left: 5px solid #3b82f6;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.article-body .warning-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 5px solid #f59e0b;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.article-body .success-box {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left: 5px solid #10b981;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.article-body .danger-box {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left: 5px solid #ef4444;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* === КОРИСНІ ПОСИЛАННЯ === */
.useful-links {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 24px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.useful-links h4 {
    color: #065f46;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    font-weight: 700;
}

.useful-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.useful-links li {
    margin-bottom: 12px;
    padding: 0;
}

.useful-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #047857;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.useful-links a:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    transform: translateX(4px);
}

/* === ФУТЕР СТАТТІ === */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 50px 0 30px 0;
    padding: 24px 0;
    border-top: 2px solid #f1f3f4;
    flex-wrap: wrap;
    gap: 20px;
}

.article-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tags-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9em;
}

.tag {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #374151;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tag:hover {
    background: linear-gradient(135deg, var(--primary, #14b8a6), var(--primary-light, #2dd4bf));
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,128,128,0.3);
}

.article-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.edit-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: rgba(217, 119, 6, 0.3);
}

/* === ПАГІНАЦІЯ === */
.article-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 50px 0;
}

.pagination-prev,
.pagination-next {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
    min-height: 80px;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: linear-gradient(135deg, var(--primary, #14b8a6), var(--primary-light, #2dd4bf));
    color: white;
    border-color: var(--primary, #14b8a6);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,128,128,0.2);
}

.pagination-content {
    flex: 1;
}

.pagination-label {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.pagination-title {
    font-weight: 600;
    line-height: 1.3;
}

.pagination-next {
    text-align: right;
    flex-direction: row-reverse;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .article-container {
        margin: 10px;
        padding: 16px;
        border-radius: 8px;
    }

    .article-nav {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .nav-breadcrumb {
        font-size: 0.8em;
        flex-wrap: wrap;
    }

    .article-meta {
        gap: 16px;
        flex-direction: column;
        align-items: center;
    }

    .article-title {
        font-size: 2em;
        text-align: left;
    }

    .article-body {
        font-size: 1em;
    }

    .article-body h1 { font-size: 2em; }
    .article-body h2 { font-size: 1.6em; }
    .article-body h3 { font-size: 1.4em; }

    .article-body pre {
        padding: 16px;
        font-size: 0.9em;
        margin: 24px -16px;
        border-radius: 0;
    }

    .article-body table {
        font-size: 0.9em;
        margin: 24px -16px;
        border-radius: 0;
    }

    .article-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .article-pagination {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pagination-prev,
    .pagination-next {
        padding: 16px;
        min-height: auto;
    }
}

/* === СТИЛІ ДЛЯ ДРУКУ === */
@media print {
    .article-nav,
    .article-footer,
    .article-pagination {
        display: none;
    }

    .article-container {
        box-shadow: none;
        padding: 0;
        max-width: none;
    }

    .article-body {
        color: black;
    }

    .article-body a {
        color: black;
        text-decoration: underline;
    }

    .article-body pre {
        background: #f5f5f5;
        color: black;
        border: 1px solid #ddd;
    }
}

/* === АНІМАЦІЇ === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-container {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scroll для заголовків */
html {
    scroll-behavior: smooth;
}

/* Виділення при anchor навігації */
.article-body h1:target,
.article-body h2:target,
.article-body h3:target,
.article-body h4:target,
.article-body h5:target,
.article-body h6:target {
    background: rgba(0,128,128,0.1);
    padding: 10px;
    border-radius: 8px;
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0% { background: rgba(0,128,128,0.3); }
    100% { background: rgba(0,128,128,0.1); }
}
