:root {
    /* Color Palette - Dark & Vibrant */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.4);

    --accent-purple: #9333ea;
    --accent-purple-light: rgba(147, 51, 234, 0.2);
    --accent-blue: #3b82f6;
    --accent-blue-light: rgba(59, 130, 246, 0.2);
    --accent-green: #22c55e;
    --accent-green-light: rgba(34, 197, 94, 0.15);

    --border-color: rgba(255, 255, 255, 0.08);
    --nav-width: 280px;
    --header-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--nav-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    padding: 2rem 1rem;
    z-index: 100;
    transition: transform 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

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

.nav-link.active {
    background: var(--accent-purple-light);
    color: var(--accent-purple);
    font-weight: 600;
}

.nav-link.has-submenu .chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.nav-link.expanded .chevron {
    transform: rotate(90deg);
}

/* Submenu */
.submenu {
    list-style: none;
    padding-left: 1rem;
    display: none;
    margin-top: 2px;
    margin-bottom: 4px;
    border-left: 1px solid var(--border-color);
    margin-left: 0.75rem;
}

.submenu.open {
    display: block;
}

.submenu .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.submenu .nav-link:hover {
    color: white;
    background: transparent;
}

.submenu .nav-link.active {
    color: var(--accent-purple);
    background: transparent;
}


/* Section Headers */
.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem 0.75rem;
}

/* Main Content */
.main-content {
    margin-left: var(--nav-width);
    flex: 1;
    padding: 3rem 4rem;
    max-width: 1000px;
    /* Constrain width for readability */
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, white, #a8a29e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: white;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-primary);
}

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

ul,
ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.1s;
}

a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Code Blocks */
pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: #e879f9;
    /* Pink-ish for inline code */
    background: rgba(232, 121, 249, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

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

/* Info/Warning/Danger Callouts */
.callout {
    padding: 1.25rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid;
    background: var(--bg-secondary);
}

.callout.info {
    border-color: var(--accent-blue);
}

.callout.info strong {
    color: var(--accent-blue);
}

.callout.warning {
    border-color: #f59e0b;
}

.callout.warning strong {
    color: #f59e0b;
}

.callout.tip {
    border-color: var(--accent-green);
}

.callout.tip strong {
    color: var(--accent-green);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-tertiary);
    color: white;
    font-weight: 600;
}

td {
    color: var(--text-secondary);
}

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

/* Cards (for Index/Dashboard pages) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    /* In case card is wrapped in A tag */
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
}

.card h3 {
    margin-top: 0;
    color: var(--accent-purple);
    font-size: 1.1rem;
}

.card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Mobile Menu Toggle Button (Hidden by default) */
.menu-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-purple);
    width: 50px;
    height: 50px;
    border-radius: 25px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 200;
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform 0.2s;
}

.menu-toggle:active {
    transform: scale(0.95);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 80%;
        /* Don't cover full screen on wider phones */
        max-width: 300px;
        box-shadow: none;
        /* Shadow handled by open state */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
        padding: 5rem 1.5rem 2rem 1.5rem;
        /* Add top padding for header space if needed, or just standard */
        padding: 2rem 1rem;
        width: 100%;
        overflow-x: hidden;
    }

    .menu-toggle {
        display: flex;
        /* Show only on mobile */
    }

    /* Overlay when menu is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    /* Ensure content doesn't break layout */
    img,
    video {
        max-width: 100%;
        height: auto;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    pre {
        white-space: pre;
        /* Allow scrolling */
        max-width: 100%;
        /* Force constraint */
    }
}