/* Professional Single Blog Styles */

/* Table of Contents Hero Section */
.toc-container-hero {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    backdrop-filter: blur(10px);
}

.toc-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: space-between;
}

.toc-toggle-btn:hover {
    color: var(--primary-color);
}

.toc-preview {
    text-align: center;
    opacity: 0.8;
}

.toc-preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Professional TOC Widget */
.toc-widget {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(20px);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.widget-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
    color: white;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-icon {
    font-size: 18px;
}

/* Progress Circle */
.toc-progress-circle {
    position: relative;
    width: 30px;
    height: 30px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.3s ease;
    stroke: rgba(255, 255, 255, 0.8);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: 600;
    color: white;
}

/* TOC List */
.toc-list-professional {
    padding: 20px;
}

.toc-item {
    position: relative;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.toc-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.toc-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.1));
    border-left: 3px solid var(--primary-color);
}

.toc-item.active .toc-progress-indicator {
    width: 100%;
}

.toc-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.toc-item:hover .toc-link {
    color: white;
}

.toc-item.active .toc-link {
    color: white;
    font-weight: 500;
}

.toc-number {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
    flex-shrink: 0;
}

.toc-item.active .toc-number {
    background: var(--primary-color);
    color: white;
}

.toc-text {
    flex: 1;
    margin: 0 10px;
}

.toc-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.toc-progress-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
}

/* TOC Level Styles */
.toc-level-1 {
    margin-left: 0;
}

.toc-level-2 {
    margin-left: 15px;
}

.toc-level-2 .toc-number {
    background: rgba(147, 51, 234, 0.2);
}

.toc-level-3 {
    margin-left: 30px;
}

.toc-level-3 .toc-number {
    background: rgba(6, 182, 212, 0.2);
}

/* Reading Progress */
.toc-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.progress-label {
    font-weight: 500;
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

/* Mobile TOC Overlay */
.mobile-toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mobile-toc-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-toc-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, rgba(13, 16, 25, 0.95), rgba(26, 26, 46, 0.95));
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-toc-overlay.active .mobile-toc-content {
    transform: translateY(0);
}

.mobile-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.mobile-toc-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.mobile-toc-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.mobile-toc-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-toc-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.mobile-toc-item {
    margin-bottom: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-toc-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-toc-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.1));
    border-left: 3px solid var(--primary-color);
}

.mobile-toc-link {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.mobile-toc-item:hover .mobile-toc-link,
.mobile-toc-item.active .mobile-toc-link {
    color: white;
}

.mobile-toc-number {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
    flex-shrink: 0;
}

.mobile-toc-item.active .mobile-toc-number {
    background: var(--primary-color);
    color: white;
}

.mobile-toc-text {
    flex: 1;
}

/* Empty State */
.toc-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Hide TOC container in desktop */
@media (min-width: 992px) {
    .toc-container-hero {
        display: none;
    }
}

/* Breadcrumb Styles */
.breadcrumb-modern {
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-modern .glass-badge {
    display: inline-flex;
    white-space: nowrap;
    min-width: max-content;
}

@media (max-width: 768px) {
    .breadcrumb-modern {
        padding-bottom: 5px;
    }
    
    .breadcrumb-modern::-webkit-scrollbar {
        height: 4px;
    }
    
    .breadcrumb-modern::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }
    
    .breadcrumb-modern::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
}

/* Enhanced Single Post Styles */
.single-post-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-badge-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 12px;
    font-weight: 600;
    border: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.category-badge-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.post-meta-modern .meta-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.post-meta-modern .meta-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.meta-icon {
    font-size: 14px;
}

.author-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.author-link:hover {
    color: var(--secondary-color);
}

/* Content Enhancements */
.content-wrapper {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3 {
    color: white;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    position: relative;
    scroll-margin-top: 100px;
}

.content-wrapper h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-wrapper h2 {
    font-size: 1.5rem;
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
}

.content-wrapper h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.content-wrapper p {
    margin-bottom: 1.5rem;
}

.content-wrapper ul,
.content-wrapper ol {
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.content-wrapper li {
    margin-bottom: 0.5rem;
}

.content-wrapper blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-right: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.content-wrapper code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-color);
}

.content-wrapper pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-wrapper pre code {
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Reading Time Indicator */
.reading-time-indicator {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.reading-time-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-icon {
    font-size: 16px;
}

.word-count {
    font-size: 12px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toc-widget {
        position: static;
        max-height: none;
    }
    
    .single-post-title {
        font-size: 1.5rem;
    }
    
    .post-meta-modern {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px !important;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .post-meta-modern .meta-item {
        font-size: 11px;
        padding: 6px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Hide reading time in mobile */
    .post-meta-modern .meta-item:nth-child(3) {
        display: none;
    }
    
    .post-meta-modern::-webkit-scrollbar {
        height: 4px;
    }
    
    .post-meta-modern::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }
    
    .post-meta-modern::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
    
    .content-wrapper {
        font-size: 15px;
    }
    
    .content-wrapper h1 {
        font-size: 1.5rem;
    }
    
    .content-wrapper h2 {
        font-size: 1.25rem;
    }
    
    .content-wrapper h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .toc-container-hero {
        padding: 12px 15px;
    }
    
    .mobile-toc-content {
        max-height: 90vh;
    }
    
    .mobile-toc-body {
        max-height: 70vh;
    }
}

/* Smooth Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toc-item,
.mobile-toc-item {
    animation: fadeInUp 0.3s ease forwards;
}

.toc-item:nth-child(1) { animation-delay: 0.1s; }
.toc-item:nth-child(2) { animation-delay: 0.2s; }
.toc-item:nth-child(3) { animation-delay: 0.3s; }
.toc-item:nth-child(4) { animation-delay: 0.4s; }
.toc-item:nth-child(5) { animation-delay: 0.5s; }

/* Scrollbar Styling */
.toc-widget::-webkit-scrollbar,
.mobile-toc-body::-webkit-scrollbar {
    width: 6px;
}

.toc-widget::-webkit-scrollbar-track,
.mobile-toc-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.toc-widget::-webkit-scrollbar-thumb,
.mobile-toc-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.toc-widget::-webkit-scrollbar-thumb:hover,
.mobile-toc-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}