:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-purple: #a371f7;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --code-bg: #1c2128;
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

.logo {
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--accent-purple);
    margin-bottom: 0.25rem;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 0.5rem;
}

.nav-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-menu a.active {
    border-left: 3px solid var(--accent-blue);
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    padding: 3rem 4rem;
    max-width: 1200px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h2 {
    font-size: 1.75rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.intro-text {
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.card.highlight {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(88, 166, 255, 0.1) 100%);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature h3 {
    color: var(--accent-blue);
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.feature p {
    font-size: 0.875rem;
    margin: 0;
}

/* Tool Cards */
.tool-category {
    margin: 2rem 0;
}

.tool-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tool-header code {
    background: var(--code-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-green);
    font-size: 0.9rem;
}

.tool-type {
    background: var(--accent-purple);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.example-code {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.example-code pre {
    margin: 0;
}

.example-code code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.example-code .comment {
    color: #6a737d;
}

.tip, .warning {
    background: rgba(210, 153, 34, 0.1);
    border-left: 4px solid var(--accent-orange);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 6px 6px 0;
}

.warning {
    background: rgba(248, 81, 73, 0.1);
    border-left-color: var(--accent-red);
}

.tip strong, .warning strong {
    color: var(--text-primary);
}

/* Agent Cards */
.agent-types {
    margin: 2rem 0;
}

.agent-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agent-icon {
    font-size: 2rem;
}

.agent-header h3 {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-blue);
    margin: 0;
}

.agent-card ul {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.usage-example {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.usage-example h4 {
    color: var(--accent-green);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Best Practices */
.best-practices {
    margin: 2rem 0;
}

.practice {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin: 1rem 0;
}

.practice-num {
    background: var(--accent-blue);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.practice h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.practice p {
    font-size: 0.9rem;
    margin: 0;
}

.example-scenario ol {
    color: var(--text-secondary);
    margin-left: 1.5rem;
}

.example-scenario li {
    margin-bottom: 0.5rem;
}

/* RAG Flow */
.rag-flow {
    margin: 2rem 0;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.flow-step {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-blue);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 150px;
}

.step-num {
    display: block;
    background: var(--accent-blue);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    line-height: 28px;
    margin: 0 auto 0.5rem;
    font-weight: bold;
}

.flow-step p {
    font-size: 0.85rem;
    margin: 0;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

/* RAG Tools */
.rag-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.rag-tool {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.rag-tool h4 {
    color: var(--accent-green);
    margin-bottom: 0.5rem;
}

/* Example Tabs */
.example-tabs {
    margin: 2rem 0;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    margin-bottom: 0;
}

.tab-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.tab-content {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: var(--accent-blue);
    margin-top: 0;
}

/* BP Grid */
.bp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.bp-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.bp-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.bp-card h3 {
    color: var(--accent-blue);
    font-size: 1rem;
    margin: 0.5rem 0;
}

.bp-card p {
    font-size: 0.85rem;
    margin: 0;
}

/* Avoid Grid */
.avoid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.avoid-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 6px;
}

.avoid-icon {
    font-size: 1.5rem;
}

.avoid-item p {
    font-size: 0.85rem;
    margin: 0;
}

.avoid-item code {
    background: var(--code-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}
