/* ===== Table of Contents & Share Features ===== */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Note Detail Container - FULL WIDTH Layout (No TOC) */
.note-detail-container {
    display: flex;
    gap: 0;
    /* No gap since TOC is hidden */
    max-width: none;
    /* Remove width limit */
    width: 100%;
    /* Full viewport width */
    margin: 0;
    /* No centering */
    padding: 0;
    /* Container has no padding */
}

/* TOC Sidebar - HIDDEN (User request: tidak perlu) */
.toc-sidebar {
    display: none !important;
    /* Hide TOC completely */
}

.toc-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    transition: all var(--transition);
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    background: var(--bg-hover);
    border-radius: var(--radius);
}

.toc-link.active {
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    background: var(--bg-hover);
    font-weight: 600;
}

.toc-link.level-2 {
    padding-left: 1.25rem;
    font-size: 0.85rem;
}

.toc-link.level-3 {
    padding-left: 1.75rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Note Content Wrapper - FULL WIDTH (No TOC) */
.note-content-wrapper {
    flex: 1;
    min-width: 0;
    max-width: none;
    /* Remove max-width constraint */
    width: 100%;
    /* Full width! */
    margin: 0;
    /* No auto-centering */
    padding: 2rem;
    /* Internal padding for content */

    /* Visual border to show content area clearly */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Share Actions - Improved Layout */
.share-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-share i {
    font-style: normal;
    font-size: 1.1rem;
}

.btn-share:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-share:active {
    transform: translateY(0);
}

/* Mobile TOC Toggle Button */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: var(--bg-body);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all var(--transition);
}

.toc-mobile-toggle:hover {
    transform: scale(1.1);
}

/* Responsive Adjustments - Multi-Breakpoint */

/* Large Desktop (1400px+) - Full width with generous spacing */
@media (min-width: 1400px) {
    .note-detail-container {
        padding: 2.5rem 3rem;
    }
}

/* Desktop (1024px - 1400px) - Standard desktop */
@media (max-width: 1400px) {
    .note-detail-container {
        max-width: 1200px;
        padding: 2rem;
    }

    .note-content-wrapper {
        max-width: 900px;
    }
}

/* Tablet Landscape (768px - 1024px) - Smaller TOC, narrower content */
@media (max-width: 1024px) {
    .note-detail-container {
        max-width: 100%;
        padding: 1.5rem;
    }

    .toc-sidebar {
        flex: 0 0 200px;
    }

    .note-content-wrapper {
        max-width: 750px;
    }
}

/* Tablet Portrait & Mobile (up to 768px) - Proper padding */
@media (max-width: 768px) {
    .note-detail-container {
        flex-direction: column;
        padding: 0;
        max-width: 100%;
    }

    /* TOC already hidden globally */
    .toc-mobile-toggle {
        display: none !important;
    }

    /* Share buttons - grid auto-adapts on mobile */
    .share-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .btn-share {
        width: 100%;
    }

    /* Note content - proper padding to avoid touching edges */
    .note-content-wrapper {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 1.5rem;
        /* Generous padding for mobile readability */
        border-radius: 0;
        /* Remove border radius on mobile for full width */
    }

    /* Back button spacing on mobile */
    .note-header-actions {
        margin-bottom: 1.5rem !important;
        margin-top: 0 !important;
        /* Remove top margin so button doesn't touch top edge */
    }

    /* Note header spacing */
    .note-header {
        margin-bottom: 1.5rem;
    }
}

/* Small Mobile (up to 480px) - Optimal spacing */
@media (max-width: 480px) {
    .note-detail-container {
        padding: 0;
    }

    .note-content-wrapper {
        padding: 1.25rem;
        /* Balanced padding for small screens */
    }
}

/* Empty TOC State */
.toc-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* Smooth Scroll Enhancement */
html {
    scroll-behavior: smooth;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    scroll-margin-top: 2rem;
}