/* ═══════════════════════════════════════════════════════════════════════════
   AgentEval Documentation - Clean Professional Theme
   Fixes: Large logo, proper navbar, visible sidebar, good contrast
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   CSS Variables
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --ae-primary: #0284c7;
    --ae-primary-dark: #0369a1;
    --ae-primary-light: #38bdf8;
    --ae-accent: #06b6d4;
    
    /* Text - High Contrast */
    --ae-text-dark: #111827;
    --ae-text-medium: #374151;
    --ae-text-light: #6b7280;
    --ae-text-white: #ffffff;
    
    /* Backgrounds */
    --ae-bg-white: #ffffff;
    --ae-bg-gray-50: #f9fafb;
    --ae-bg-gray-100: #f3f4f6;
    --ae-bg-gray-800: #1f2937;
    --ae-bg-gray-900: #111827;
    
    /* Borders */
    --ae-border: #e5e7eb;
    --ae-border-dark: #d1d5db;
}

/* Dark mode */
[data-bs-theme="dark"] {
    --ae-text-dark: #f9fafb;
    --ae-text-medium: #e5e7eb;
    --ae-text-light: #9ca3af;
    --ae-bg-white: #111827;
    --ae-bg-gray-50: #1f2937;
    --ae-bg-gray-100: #374151;
    --ae-border: #374151;
    --ae-border-dark: #4b5563;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Base Styles
   ───────────────────────────────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ae-text-dark);
    background: var(--ae-bg-white);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER / NAVBAR - Clean and Professional
   ───────────────────────────────────────────────────────────────────────────── */
header.bg-body {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%) !important;
    border-bottom: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar {
    padding: 0.75rem 1rem !important;
    min-height: 70px;
}

.container-xxl {
    max-width: 1400px;
}

/* ─── LOGO - BIGGER with AE logo ─── */
.navbar-brand {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin-right: 1.5rem !important;
}

.navbar-brand img#logo,
.navbar-brand img.svg {
    height: 70px !important;
    width: auto !important;
    max-height: 70px !important;
    min-height: 70px !important;
}

/* Hide the default text since logo has it */
.navbar-brand {
    font-size: 0;
    color: transparent;
}

/* ─── SEARCH BOX ─── */
#search {
    margin-left: auto;
}

#search .form-control {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 8px;
    color: #fff !important;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    width: 280px;
    font-size: 0.9rem;
}

#search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#search .form-control:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--ae-accent) !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
    outline: none;
}

#search .bi-search {
    color: rgba(255, 255, 255, 0.7);
}

/* ─────────────────────────────────────────────────────────────────────────────
   MAIN LAYOUT - Sidebar + Content + Affix
   ───────────────────────────────────────────────────────────────────────────── */
main.container-xxl {
    display: grid;
    grid-template-columns: 280px 1fr 220px;
    gap: 0;
    padding: 0 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   LEFT SIDEBAR - Navigation Menu
   ───────────────────────────────────────────────────────────────────────────── */
#sidetoggle,
.sidetoggle {
    display: block !important;
    grid-column: 1;
    width: 280px;
    background: var(--ae-bg-gray-50);
    border-right: 1px solid var(--ae-border);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

/* Filter input */
.sidefilter,
.toc-filter {
    margin-bottom: 1rem;
}

.sidefilter input,
.toc-filter input,
#toc_filter_input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ae-border-dark);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--ae-bg-white);
    color: var(--ae-text-dark);
}

.sidefilter input:focus,
#toc_filter_input:focus {
    border-color: var(--ae-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ─── NAVIGATION MENU ITEMS ─── */
.sidetoc,
#toc {
    font-size: 0.9rem;
}

.sidetoc .nav,
#toc .nav,
.toc .nav {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Level 1 - Main sections */
.sidetoc .nav > li,
#toc .nav.level1 > li,
.toc .nav.level1 > li {
    margin-bottom: 2px;
}

.sidetoc .nav > li > a,
#toc .nav.level1 > li > a,
.toc .nav.level1 > li > a {
    display: block;
    padding: 0.6rem 0.85rem;
    color: var(--ae-text-dark) !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.sidetoc .nav > li > a:hover,
#toc .nav.level1 > li > a:hover,
.toc .nav.level1 > li > a:hover {
    background: var(--ae-bg-gray-100);
    color: var(--ae-primary) !important;
    border-left-color: var(--ae-primary-light);
}

.sidetoc .nav > li > a.active,
#toc .nav.level1 > li > a.active,
.toc .nav.level1 > li > a.active,
.sidetoc .nav .nav-link.active {
    background: var(--ae-primary) !important;
    color: #ffffff !important;
    border-left-color: var(--ae-primary-dark);
}

/* Level 2 - Sub-items */
.sidetoc .nav .nav,
#toc .nav.level2,
.toc .nav.level2 {
    margin-left: 0.75rem;
    margin-top: 4px;
    padding-left: 0.75rem;
    border-left: 2px solid var(--ae-border);
}

.sidetoc .nav .nav > li > a,
#toc .nav.level2 > li > a,
.toc .nav.level2 > li > a {
    padding: 0.45rem 0.75rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--ae-text-medium) !important;
}

.sidetoc .nav .nav > li > a:hover,
#toc .nav.level2 > li > a:hover {
    color: var(--ae-primary) !important;
    background: var(--ae-bg-gray-100);
}

/* Expand/collapse toggle */
.expand-stub {
    display: inline-block;
    width: 20px;
    cursor: pointer;
    text-align: center;
    user-select: none;
}

.expand-stub::before {
    content: "▶";
    font-size: 0.65rem;
    color: var(--ae-text-light);
    transition: transform 0.2s ease;
    display: inline-block;
}

.in > .expand-stub::before,
li.in > span.expand-stub::before {
    transform: rotate(90deg);
}

/* ─────────────────────────────────────────────────────────────────────────────
   MAIN CONTENT AREA
   ───────────────────────────────────────────────────────────────────────────── */
.content {
    grid-column: 2;
    padding: 2rem 2.5rem;
    max-width: 100%;
    min-width: 0;
    background: var(--ae-bg-white);
}

article {
    max-width: 800px;
}

/* Breadcrumb */
.actionbar {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--ae-border);
}

#breadcrumb {
    font-size: 0.85rem;
    color: var(--ae-text-light);
}

#breadcrumb a {
    color: var(--ae-text-light);
    text-decoration: none;
}

#breadcrumb a:hover {
    color: var(--ae-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RIGHT SIDEBAR - "In This Article"
   ───────────────────────────────────────────────────────────────────────────── */
.affix {
    grid-column: 3;
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 1.5rem 1rem;
    font-size: 0.8rem;
}

.affix h5,
.affix > p:first-child {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ae-text-light);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ae-border);
}

.affix .nav-link,
.affix ul a {
    display: block;
    padding: 0.35rem 0;
    padding-left: 0.75rem;
    color: var(--ae-text-medium) !important;
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}

.affix .nav-link:hover,
.affix ul a:hover {
    color: var(--ae-primary) !important;
    border-left-color: var(--ae-primary-light);
}

.affix .nav-link.active {
    color: var(--ae-primary) !important;
    border-left-color: var(--ae-primary);
    font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--ae-text-dark);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 2.25rem;
    margin-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--ae-primary);
}

h2 {
    font-size: 1.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ae-border);
}

h3 {
    font-size: 1.3rem;
    color: var(--ae-primary-dark);
}

h4 {
    font-size: 1.1rem;
}

p {
    color: var(--ae-text-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

a {
    color: var(--ae-primary);
    text-decoration: none;
}

a:hover {
    color: var(--ae-primary-dark);
    text-decoration: underline;
}

strong, b {
    font-weight: 700;
    color: var(--ae-text-dark);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CODE BLOCKS
   ───────────────────────────────────────────────────────────────────────────── */
pre {
    background: var(--ae-bg-gray-900) !important;
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    padding: 1.25rem !important;
    margin: 1.25rem 0;
    overflow-x: auto;
}

pre code {
    font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e5e7eb !important;
}

code:not(pre code) {
    background: rgba(2, 132, 199, 0.1);
    color: var(--ae-primary-dark);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "Cascadia Code", Consolas, monospace;
}

[data-bs-theme="dark"] code:not(pre code) {
    background: rgba(56, 189, 248, 0.15);
    color: var(--ae-primary-light);
}

/* ─────────────────────────────────────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: var(--ae-primary);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.85rem;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ae-border);
    color: var(--ae-text-dark);
}

tbody tr:hover {
    background: var(--ae-bg-gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ALERTS & BLOCKQUOTES
   ───────────────────────────────────────────────────────────────────────────── */
blockquote {
    border-left: 4px solid var(--ae-primary);
    background: var(--ae-bg-gray-50);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--ae-text-dark);
}

blockquote p {
    margin: 0;
}

.alert, .NOTE, .TIP, .WARNING, .IMPORTANT, .CAUTION {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-left: 4px solid;
}

.NOTE, .alert-info {
    background: rgba(2, 132, 199, 0.08);
    border-left-color: var(--ae-primary);
}

.TIP, .alert-success {
    background: rgba(5, 150, 105, 0.08);
    border-left-color: #059669;
}

.WARNING, .CAUTION, .alert-warning {
    background: rgba(217, 119, 6, 0.08);
    border-left-color: #d97706;
}

.IMPORTANT, .alert-danger {
    background: rgba(220, 38, 38, 0.08);
    border-left-color: #dc2626;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
footer {
    grid-column: 1 / -1;
    background: var(--ae-bg-gray-50);
    border-top: 1px solid var(--ae-border);
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ae-text-light);
    margin-top: 2rem;
}

footer a {
    color: var(--ae-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    main.container-xxl {
        grid-template-columns: 260px 1fr;
    }
    
    .affix {
        display: none;
    }
}

@media (max-width: 992px) {
    main.container-xxl {
        grid-template-columns: 1fr;
    }
    
    #sidetoggle,
    .sidetoggle {
        position: fixed;
        left: -300px;
        top: 70px;
        width: 280px;
        height: calc(100vh - 70px);
        z-index: 1020;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }
    
    #sidetoggle.show,
    .sidetoggle.show {
        left: 0;
    }
    
    .content {
        padding: 1.5rem 1rem;
    }
    
    .navbar-brand img#logo {
        height: 44px !important;
        max-height: 44px !important;
    }
    
    .navbar-brand::after {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 0.5rem !important;
    }
    
    .navbar-brand img#logo {
        height: 36px !important;
        max-height: 36px !important;
    }
    
    .navbar-brand::after {
        font-size: 1.1rem;
    }
    
    #search .form-control {
        width: 180px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   LISTS
   ───────────────────────────────────────────────────────────────────────────── */
ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.4rem;
    color: var(--ae-text-dark);
    line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────────
   API REFERENCE
   ───────────────────────────────────────────────────────────────────────────── */
.inheritance,
.implements,
.inheritedMembers {
    background: var(--ae-bg-gray-50);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

dl dt {
    font-weight: 600;
    color: var(--ae-primary-dark);
    margin-top: 0.75rem;
}

dl dd {
    margin-left: 1.25rem;
    color: var(--ae-text-medium);
}

/* ─────────────────────────────────────────────────────────────────────────────
   NEXT/PREV NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */
.next-article {
    margin-top: 2rem;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.next-article a {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--ae-bg-gray-50);
    border-radius: 8px;
    border: 1px solid var(--ae-border);
    text-decoration: none;
    transition: all 0.15s ease;
}

.next-article a:hover {
    border-color: var(--ae-primary);
    background: var(--ae-bg-gray-100);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SCROLLBAR
   ───────────────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ae-bg-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--ae-border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ae-text-light);
}

/* ─────────────────────────────────────────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────────────────────────────────────────── */
@media print {
    header, footer, .sidetoggle, #sidetoggle, .affix, .actionbar {
        display: none !important;
    }
    
    main.container-xxl {
        display: block;
    }
    
    .content {
        padding: 0;
        max-width: 100%;
    }
    
    pre {
        background: #f5f5f5 !important;
        border: 1px solid #ddd;
    }
    
    pre code {
        color: #333 !important;
    }
}
