/* --- GŁÓWNE STYLE --- */
body { background-color: #f0f2f5; color: #333; }
.article-card { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 25px rgba(0,0,0,0.05); margin-bottom: 40px; position: relative; }
.article-content h2 { margin-top: 40px; margin-bottom: 20px; font-weight: 700; color: #198754; }
.article-content img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin: 20px 0; }
@media (max-width: 768px) { .article-card { padding: 20px; } h1 { font-size: 1.8rem; } }

/* SIDEBAR */
.sidebar-wrapper { position: sticky; top: 20px; }
.category-link { display: block; padding: 12px 15px; background: #fff; border-radius: 8px; margin-bottom: 10px; text-decoration: none; color: #2c3e50; font-weight: 600; transition: all 0.2s; border-left: 4px solid transparent; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.category-link:hover { background: #e9f7ef; border-left: 4px solid #198754; color: #198754; transform: translateX(5px); }

/* NAPRAWA SIDEBAR HOT ARTICLES (Miniatura) */
.hot-article-item {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    border: 1px solid #eee;
    transition: 0.2s;
    overflow: hidden;
}
.hot-article-item:hover { background-color: #f8f9fa; border-color: #198754; }

/* Kluczowe: !important wymusza rozmiar */
.hot-img {
    width: 65px !important;
    height: 65px !important;
    min-width: 65px !important;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    display: block;
}

.hot-info h6 { font-size: 13px; margin: 0 0 4px 0; line-height: 1.3; font-weight: 600; word-wrap: break-word; }
.hot-views { font-size: 11px; color: #999; }

/* STICKY LIKE BUTTON (Prawy dolny róg + Animacja) */
.sticky-like-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-like-floating {
    width: 65px;
    height: 65px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(25, 135, 84, 0.3); 
    border: 3px solid #198754;
    color: #198754;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse-float 2.5s infinite; /* Pulsowanie */
}

.btn-like-floating:hover {
    transform: scale(1.1);
    background-color: #198754;
    color: #fff;
    animation: none;
}

.btn-like-floating.liked {
    background-color: #198754;
    color: #fff;
    border-color: #146c43;
}

.like-count-badge {
    background: #2c3e50;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 15px;
    margin-top: 8px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0.9;
}

/* Animacja */
@keyframes pulse-float {
    0% { transform: translateY(0); box-shadow: 0 8px 20px rgba(25, 135, 84, 0.3); }
    50% { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(25, 135, 84, 0.2); }
    100% { transform: translateY(0); box-shadow: 0 8px 20px rgba(25, 135, 84, 0.3); }
}

@media (max-width: 768px) {
    .sticky-like-wrapper { bottom: 20px; right: 20px; }
    .btn-like-floating { width: 55px; height: 55px; font-size: 24px; }
}

/* MENU MOBILE */
.offcanvas-fullscreen { background-color: #198754; color: white; }
.mobile-nav-link { font-size: 24px; color: white; text-decoration: none; display: block; padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 700; }

/* --- TABLE OF CONTENTS (SPIS TREŚCI) --- */
.toc-card {
    background-color: #f8f9fa; /* Lekko szare tło */
    border-left: 5px solid #198754; /* Zielony akcent */
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative; /* Ważne dla pozycjonowania elementów wewnątrz */
}

.toc-card h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- NOWE: Wrapper do zwijania/rozwijania --- */
.toc-wrapper {
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    position: relative;
}

/* Stan ZWINIĘTY (domyślny) */
.toc-wrapper.collapsed {
    max-height: 85px; /* Wysokość na ok. 2-3 pozycje */
}

/* Efekt zanikania (Gradient) w stanie zwiniętym */
.toc-wrapper.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    /* Gradient musi przechodzić w kolor tła .toc-card (#f8f9fa) */
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0), rgba(248, 249, 250, 1));
    pointer-events: none;
}

/* Stan ROZWINIĘTY */
.toc-wrapper.expanded {
    max-height: 2500px; /* Wystarczająco dużo, by pokazać całość */
}

/* Przycisk rozwijania */
.btn-toc-toggle {
    background: none;
    border: none;
    color: #198754;
    font-weight: 700;
    font-size: 0.9rem;
    padding-top: 15px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    display: block;
}

.btn-toc-toggle:hover { color: #146c43; }
.btn-toc-toggle:focus { outline: none; }

/* --- STYLIZACJA LISTY (Twoja oryginalna) --- */
.toc-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.2s;
    display: block;
    padding: 5px 0;
}

.toc-list a:hover {
    color: #198754;
    padding-left: 5px; /* Efekt przesunięcia przy hover */
}

/* Wcięcia dla nagłówków niższego rzędu */
.toc-indent-2 { margin-left: 0px; font-weight: 600; }
.toc-indent-3 { margin-left: 20px; font-size: 0.95em; border-left: 2px solid #e9ecef; padding-left: 10px; }
.toc-indent-4 { margin-left: 40px; font-size: 0.9em; border-left: 2px solid #e9ecef; padding-left: 10px; color: #666; }

/* --- KARTY ARTYKUŁU --- */
.article-header-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.article-body-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    position: relative;
}

@media (max-width: 768px) {
    .toc-card, .article-header-card, .article-body-card { padding: 20px; }
}

/* --- NOWE: READING PROGRESS BAR --- */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 99999; /* Zawsze na wierzchu */
}

.reading-progress-bar {
    height: 4px;
    background: #198754; /* Twój zielony */
    width: 0%;
    transition: width 0.1s;
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.5);
}

/* --- BACK TO TOP BUTTON (Podniesiony wyżej) --- */
.btn-back-to-top {
    position: fixed;
    /* Zmieniono z 115px na 165px */
    bottom: 165px; 
    right: 40px;
    width: 45px;
    height: 45px;
    background-color: #fff;
    color: #198754;
    border: 2px solid #198754;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 9998;
    font-size: 14px;
    font-weight: bold;
    flex-direction: column;
    line-height: 1;
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.btn-back-to-top:hover {
    background-color: #198754;
    color: #fff;
    transform: translateY(-3px);
}

/* Mały napis UP w środku */
.btn-back-to-top span {
    font-size: 10px;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .btn-back-to-top {
        right: 28px;
        /* Zmieniono z 100px na 150px */
        bottom: 150px; 
        width: 40px;
        height: 40px;
    }
}