/* Single Post Styles */

/* Post Title Responsive */
.post-title {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h1, .post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6 {
    color: #ffffff !important;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    scroll-margin-top: 100px; /* Khoảng cách khi scroll đến heading */
}

.post-thumbnail:hover img {
    transform: scale(1.02);
}

.related-item:hover {
    background: rgba(255,255,255,0.1)!important;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

.related-item a:hover {
    color: #ffc107!important;
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

/* Table of Contents Styles */
.table-of-contents {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.toc-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.toc-list::-webkit-scrollbar {
    width: 6px;
}

.toc-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.toc-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.toc-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.toc-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.toc-item:hover {
    background: rgba(255,255,255,0.08) !important;
    transform: translateX(6px);
    border-left: 2px solid #cccccc;
}

/* Active item highlight */
.toc-item.active-item {
    background: rgba(255,255,255,0.15) !important;
    border-left: 3px solid #ffffff;
}

.toc-item.active-item:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateX(8px);
    border-left: 3px solid #ffffff;
}

.toc-item:last-child {
    border-bottom: none;
}

.toc-link {
    color: #999999 !important; /* Màu xám mặc định */
    text-decoration: none;
    line-height: 1.5;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Font size riêng cho từng level */
.toc-item.level-1 .toc-link,
.toc-item.level-2 .toc-link {
    font-size: 1rem;
    font-weight: 600;
}

.toc-item.level-3 .toc-link {
    font-size: 0.85rem;
    font-weight: 500;
}

.toc-item.level-4 .toc-link,
.toc-item.level-5 .toc-link,
.toc-item.level-6 .toc-link {
    font-size: 0.8rem;
    font-weight: 400;
}

.toc-link:hover {
    color: #cccccc !important; /* Màu xám sáng khi hover */
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.toc-link.active {
    color: #ffffff !important; /* Màu trắng khi active */
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Active state cho chấm tròn */
.toc-item:has(.toc-link.active)::before {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255,255,255,0.6);
}

/* Inactive state cho chấm tròn */
.toc-item::before {
    color: #999999 !important;
    transition: all 0.3s ease;
}

/* Hover state cho chấm tròn */
.toc-item:hover::before {
    color: #cccccc !important;
}

/* Tạo indent cho các level heading khác nhau */
.toc-item.level-1 { 
    padding-left: 20px; 
    font-size: 1rem;
    position: relative;
    font-weight: 600;
}
.toc-item.level-2 { 
    padding-left: 20px; 
    font-size: 1rem;
    position: relative;
    font-weight: 600;
}
.toc-item.level-3 { 
    padding-left: 40px; 
    font-size: 0.85rem;
    position: relative;
    font-weight: 500;
}
.toc-item.level-4 { 
    padding-left: 55px; 
    font-size: 0.8rem;
    position: relative;
    font-weight: 400;
}
.toc-item.level-5 { 
    padding-left: 70px; 
    font-size: 0.75rem;
    position: relative;
    font-weight: 400;
}
.toc-item.level-6 { 
    padding-left: 85px; 
    font-size: 0.7rem;
    position: relative;
    font-weight: 400;
}

/* Icon cho các level khác nhau - Dùng chấm tròn inline */
.toc-item.level-1::before { 
    content: "●"; 
    color: #ffffff; 
    font-size: 1.1rem;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}
.toc-item.level-2::before { 
    content: "●"; 
    color: #ffffff; 
    font-size: 1.1rem;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}
.toc-item.level-3::before { 
    content: "●"; 
    color: #ffffff; 
    font-size: 0.8rem;
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
}
.toc-item.level-4::before { 
    content: "●"; 
    color: #ffffff; 
    font-size: 0.7rem;
    position: absolute;
    left: 43px;
    top: 50%;
    transform: translateY(-50%);
}
.toc-item.level-5::before { 
    content: "●"; 
    color: #ffffff; 
    font-size: 0.6rem;
    position: absolute;
    left: 58px;
    top: 50%;
    transform: translateY(-50%);
}
.toc-item.level-6::before { 
    content: "●"; 
    color: #ffffff; 
    font-size: 0.5rem;
    position: absolute;
    left: 73px;
    top: 50%;
    transform: translateY(-50%);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .post-title {
        font-size: 1.8rem !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 767.98px) {
    .post-title {
        font-size: 1.5rem !important;
        line-height: 1.5 !important;
    }
    
    .post-header {
        padding: 1rem !important;
    }
    
    .post-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    .social-share {
        flex-wrap: wrap !important;
    }
}

@media (max-width: 575.98px) {
    .post-title {
        font-size: 1.3rem !important;
        line-height: 1.6 !important;
    }
}
