:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #457b9d;
    --dark: #1d3557;
    --light: #f1faee;
    --gray: #a8dadc;
    --code-bg: #1e1e2e;
    --code-text: #cdd6f4;
    --sidebar-width: 280px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: #fff;
}

/* Navigation */
nav {
    background: var(--dark);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    color: var(--light);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.logo span {
    color: var(--primary);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--light);
}

/* Layout */
.container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--light);
    border-right: 1px solid #ddd;
    padding: 2rem 0;
    position: fixed;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
}

.sidebar h3 {
    padding: 0.5rem 1.5rem;
    color: var(--secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.sidebar h3:first-child {
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--dark);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem;
}

.sidebar a:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.sidebar a.active {
    background: var(--primary);
    color: white;
}

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

.content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.content h1 span {
    color: var(--primary);
}

.subtitle {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.content h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--dark);
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
}

.content h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.content h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.content p {
    margin-bottom: 1rem;
    color: #444;
}

.content ul, .content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: #444;
}

/* Code blocks */
code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

:not(pre) > code {
    background: #f0f0f0;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--primary-dark);
}

pre {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

pre code {
    color: var(--code-text);
    background: none;
    padding: 0;
}

/* Syntax highlighting */
.keyword { color: #cba6f7; }
.type { color: #89b4fa; }
.string { color: #a6e3a1; }
.number { color: #fab387; }
.comment { color: #6c7086; }
.sigil { color: #f38ba8; }
.func { color: #89dceb; }
.operator { color: #94e2d5; }

/* Info boxes */
.info-box {
    background: #e8f4fd;
    border-left: 4px solid var(--secondary);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.info-box.warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.info-box.danger {
    background: #f8d7da;
    border-color: var(--primary);
}

.info-box.success {
    background: #d4edda;
    border-color: #28a745;
}

.info-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

tr:hover {
    background: #f9f9f9;
}

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

.card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.card h4 {
    margin-top: 0;
    color: var(--dark);
}

.card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Steps */
.steps {
    counter-reset: step;
}

.step {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2rem;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step h3 {
    margin-top: 0;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--gray);
    text-align: center;
    padding: 2rem;
    margin-left: var(--sidebar-width);
}

footer a {
    color: var(--light);
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

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

    footer {
        margin-left: 0;
    }

    nav ul {
        display: none;
    }
}

/* Next/Prev navigation */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.page-nav a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.2s;
    max-width: 45%;
}

.page-nav a:hover {
    background: var(--light);
}

.page-nav .label {
    font-size: 0.85rem;
    color: #666;
}

.page-nav .title {
    color: var(--primary);
    font-weight: 600;
}

.page-nav .next {
    text-align: right;
    margin-left: auto;
}
