/* Modern Knowledge Base Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Clean & Professional */
    --primary: #274A28;
    --primary-hover: #1E3A1F;
    --primary-light: #CBE3CC;
    --secondary: #3D6B3E;
    --accent: #4A7C4B;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;

    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;

    --success: #10B981;
    --warning: #F59E0B;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
}

::selection {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* ================================
   Layout Container
   ================================ */
.container {
    display: grid;
    grid-template-columns: 280px 1fr 220px;
    min-height: 100vh;
}

/* ================================
   Left Sidebar - Navigation
   ================================ */
.sidebar-left {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    padding: var(--space-xl) var(--space-lg) var(--space-xl) var(--space-lg);
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.sidebar-left::-webkit-scrollbar {
    width: 6px;
}

.sidebar-left::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-left::-webkit-scrollbar-thumb {
    background-color: var(--border-medium);
    border-radius: 3px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    text-decoration: none;
}

.logo img {
    height: 36px;
    width: auto;
}

/* Home Button */
.home-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.home-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.home-btn svg {
    width: 16px;
    height: 16px;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: var(--space-lg);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background-color: var(--bg-primary);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding-left: var(--space-sm);
}

.nav-section {
    margin-bottom: var(--space-md);
    padding-left: var(--space-sm);
    border-left: 2px solid var(--border-light);
}

.nav-section.active {
    border-left-color: var(--primary);
}

.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.nav-section-title:hover {
    color: var(--text-primary);
}

.nav-section.active .nav-section-title {
    color: var(--primary);
    font-weight: 700;
}

.nav-chevron {
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform var(--transition-fast);
}

.nav-section.collapsed .nav-chevron {
    transform: rotate(-90deg);
}

.nav-section.collapsed .nav-list {
    display: none;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.375rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 450;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 500;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ================================
   Main Content Area
   ================================ */
.main-content {
    padding: var(--space-2xl) var(--space-2xl) var(--space-2xl) 4rem;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

.content-wrapper {
    max-width: 720px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.breadcrumb span {
    color: var(--text-secondary);
}

/* Page Title */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

/* Article Content */
.article-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.article-content > p:first-of-type {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}

/* Content Sections */
.content-section {
    margin-bottom: var(--space-2xl);
    padding-top: var(--space-xl);
    scroll-margin-top: var(--space-xl);
}

.content-section h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.35;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.content-section h2::before {
    content: '';
    width: 4px;
    height: 1.25em;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 2px;
    flex-shrink: 0;
}

.content-section p {
    margin-bottom: var(--space-md);
}

.content-section p strong,
.content-section p b {
    color: var(--text-primary);
    font-weight: 600;
}

/* Section Headers */
.section-header {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

/* Steps List */
.steps-list {
    margin: var(--space-md) 0 var(--space-lg);
    padding-left: 0;
    list-style: none;
    counter-reset: step-counter;
}

.steps-list > li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: var(--space-md);
    counter-increment: step-counter;
}

.steps-list > li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps-list > li em {
    color: var(--text-muted);
    font-style: italic;
}

/* Sub-lists */
.sub-list {
    margin: var(--space-sm) 0 var(--space-sm) var(--space-md);
    padding-left: 0;
    list-style: none;
}

.sub-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.sub-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background-color: var(--border-medium);
    border-radius: 50%;
}

/* Info Notes / Callouts */
.info-note {
    background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%);
    border-left: 4px solid var(--primary);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.9375rem;
}

.info-note strong {
    color: var(--primary);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-lg) 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table thead {
    background-color: var(--bg-secondary);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: var(--bg-secondary);
}

.data-table .custom-notes-header {
    background-color: var(--bg-tertiary);
}

.data-table .custom-notes-header td {
    font-weight: 600;
    color: var(--text-primary);
}

.data-table em {
    color: var(--text-muted);
    font-style: italic;
}

/* ================================
   Right Sidebar - Table of Contents
   ================================ */
.sidebar-right {
    padding: var(--space-2xl) var(--space-lg);
    border-left: 1px solid var(--border-light);
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    background-color: var(--bg-primary);
}

.toc-wrapper {
    position: sticky;
    top: var(--space-2xl);
}

.toc-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.toc-list {
    list-style: none;
    border-left: 2px solid var(--border-light);
    padding-left: var(--space-md);
}

.toc-list li {
    margin-bottom: var(--space-xs);
}

.toc-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: var(--space-xs) 0;
    transition: all var(--transition-fast);
    position: relative;
}

.toc-link:hover {
    color: var(--text-primary);
}

.toc-link.active {
    color: var(--primary);
    font-weight: 500;
}

.toc-link.active::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-md) - 2px);
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--primary);
}

/* ================================
   Mobile Navigation
   ================================ */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 1000;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.625rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-medium);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.mobile-overlay.active {
    opacity: 1;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 260px 1fr;
    }

    .sidebar-right {
        display: none;
    }

    .main-content {
        padding: var(--space-xl) var(--space-xl);
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-overlay {
        display: block;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .sidebar-left.mobile-open {
        left: 0;
    }

    .main-content {
        padding: var(--space-lg);
        padding-top: 4.5rem;
    }

    .content-wrapper {
        max-width: 100%;
    }

    .page-title {
        font-size: 1.625rem;
    }

    .content-section h2 {
        font-size: 1.25rem;
    }

    .steps-list {
        padding-left: 0;
    }
}

/* ================================
   Utility Classes
   ================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth hover transitions for all interactive elements */
a, button {
    transition: all var(--transition-fast);
}

/* Print styles */
@media print {
    .sidebar-left,
    .sidebar-right,
    .mobile-menu-btn {
        display: none;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0;
    }
}
