/* --- Modern Design System - Bootstrap 5 Customizations --- */

:root {
    --bs-primary: #0d6efd; /* Accent color */
    --bs-primary-rgb: 13, 110, 253;
    --bs-body-bg: #F8F9FA; /* Main content background */
    --sidebar-bg: #FFFFFF; /* Sidebar background */
    --sidebar-text-color: #212529; /* Sidebar text */
    --sidebar-hover-bg: #e9ecef;
    --code-block-bg: #f6f8fa;
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --bs-card-cap-bg: #FFFFFF;
}

body {
    font-family: var(--bs-font-sans-serif);
    color: #212529;
}

/* --- Layout: Sidebar + Main Content --- */

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
    transition: transform 0.3s ease-in-out;
    z-index: 1045; /* Bootstrap's offcanvas z-index */
}

.main-content {
    margin-left: 280px;
    padding: 2rem 3rem;
    width: calc(100% - 280px);
    transition: margin-left 0.3s ease-in-out;
}

/* --- Sidebar Components --- */

.sidebar .logo-container {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    background-color: #FFFFFF; /* Ensures white background for logo */
}

.sidebar .logo-container img {
    max-width: 80%;
    height: auto;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text-color);
    padding: 0.9rem 1.5rem;
    border-left: 4px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--bs-primary);
}

.sidebar-nav .nav-link.active {
    color: var(--bs-primary);
    font-weight: 600;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-left-color: var(--bs-primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* --- Main Content Typography & Elements --- */

h1, h2, h3, h4 {
    color: #343a40;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 2rem; margin-top: 2.5rem; border-bottom: 1px solid #dee2e6; padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; margin-top: 2rem; }

.doc-section {
    display: none;
    animation: fadeIn 0.4s;
    background-color: #FFFFFF;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 2rem;
}
.doc-section:last-child {
    margin-bottom: 0;
}
.doc-section.active {
    display: block;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Code Block Styling (CRITICAL REQUIREMENT) --- */

div.code-block-wrapper {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

pre {
    /* O background e a cor do texto agora são controlados pelo tema do highlight.js (atom-one-dark) */
    /* Aprimorando com um fundo mais escuro e borda sutil */
    background-color: #1e1e1e !important;
    border: 1px solid #2c2c2c;
    border-radius: 0.375rem;
    padding: 1.5rem 1rem 1rem 1rem;
    overflow-x: auto;
    font-size: 0.9em;
}

/* Garante que o container do código dentro do <pre> se comporte corretamente */
pre code.hljs {
    padding: 0;
    background: none;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    cursor: pointer;
    background-color: #3e4451; /* Cor de fundo escura */
    border: 1px solid #5c6370; /* Borda sutil */
    color: #abb2bf; /* Cor do ícone */
    transition: background-color 0.2s ease;
}
.copy-btn:hover {
    background-color: #5c6370; /* Cor mais clara no hover */
}

/* --- Card & Table Modernization --- */

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(0,0,0,.125);
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.table {
    background-color: #FFFFFF;
}

.table th {
    background-color: #f8f9fa; /* Lighter header for light theme */
}

/* --- Responsiveness --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
    /* Bootstrap's .offcanvas-lg.show handles showing the sidebar */
}