/* Figure styles */
.figure {
    display: block;
    margin: .8rem auto;
    text-align: center;
    max-width: 1080px;
    padding: 12px 6px;
    border: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

.figure img {
    width: 100%;
}

.figure figcaption {
    margin-top: 1rem;
    font-size: 14px;
    color: #666;
    line-height: 1;
    text-align: center;
}

/* TOC Sidebar styles */
.toc-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateX(100%) translateY(-50%);
    width: 300px;
    max-height: 80vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    border-left: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
    z-index: 1000;
    border-radius: 8px 0 0 8px;
}

.toc-sidebar.toc-sidebar-open {
    transform: translateX(0) translateY(-50%);
}

.toc-sidebar-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.toc-sidebar-toggle:hover {
    background: #f8f9fa;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
}

.toc-sidebar-toggle i {
    font-size: 18px;
    color: #495057;
    transition: transform 0.3s ease;
}

.toc-sidebar.toc-sidebar-open .toc-sidebar-toggle i {
    transform: rotate(180deg);
}

.toc-sidebar-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 80vh;
}

.toc-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.toc-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar-item {
    margin-bottom: 0.5rem;
}

.toc-sidebar-item a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toc-sidebar-item a:hover {
    background-color: #f8f9fa;
    color: #0056b3;
    padding-left: 1rem;
}

.toc-sidebar-item.active > a {
    background-color: #e7f3ff;
    color: #0056b3;
    font-weight: 500;
    border-left: 3px solid #0056b3;
    padding-left: 0.75rem;
}

.toc-sidebar-item.toc-sidebar-item-h3 {
    padding-left: 0;
}

.toc-sidebar-item.toc-sidebar-item-h4 {
    padding-left: 1rem;
}

.toc-sidebar-item.toc-sidebar-item-h5 {
    padding-left: 2rem;
}

.toc-sidebar-item.toc-sidebar-item-h6 {
    padding-left: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .toc-sidebar {
        width: 280px;
    }
    
    .toc-sidebar-toggle {
        left: -35px;
        width: 32px;
        height: 32px;
    }
}

/* Alert boxes styles */
.alert-info {
    background-color: #e7f3ff !important;
    border-color: #b3d9ff !important;
    color: #004085 !important;
}

.alert-info strong {
    color: #002752 !important;
}

.alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffd700 !important;
    color: #856404 !important;
}

.alert-warning strong {
    color: #533f03 !important;
}

.media-viewer-icon {
    font-size: 16px;
    width: 40px;
    height: 40px;
    background-color: #0056b3;
}