:root {
    /* Light Mode Palette */
    --bg: #f7f6f2;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.7);
    --text: #1d2526;
    --text-muted: #576567;
    --accent: #275d63;
    --accent-hover: #1e474c;
    --accent-light: rgba(39, 93, 99, 0.08);
    --accent-border: rgba(39, 93, 99, 0.15);
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 10px 30px rgba(39, 93, 99, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --code-bg: #1e1e1e;
    --code-text: #f8f8f2;
    
    --warning-bg: #fff9e6;
    --warning-border: #ffe082;
    --warning-text: #8a6d00;
    
    --info-bg: #e6f7ff;
    --info-border: #91d5ff;
    --info-text: #0050b3;
    
    --success-bg: #f6ffed;
    --success-border: #b7eb8f;
    --success-text: #389e0d;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --sidebar-width: 280px;
    --header-height: 70px;
}

.dark-mode {
    /* Dark Mode Palette */
    --bg: #0b1112;
    --surface: #12191a;
    --surface-glass: rgba(18, 25, 26, 0.7);
    --text: #e1e9ea;
    --text-muted: #8ca3a6;
    --accent: #3fa1ad;
    --accent-hover: #5ec0cc;
    --accent-light: rgba(63, 161, 173, 0.12);
    --accent-border: rgba(63, 161, 173, 0.25);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 8px rgba(0, 0, 0, 0.2);
    
    --warning-bg: rgba(255, 215, 0, 0.05);
    --warning-border: rgba(255, 215, 0, 0.2);
    --warning-text: #ffe082;
    
    --info-bg: rgba(0, 191, 255, 0.05);
    --info-border: rgba(0, 191, 255, 0.2);
    --info-text: #91d5ff;
    
    --success-bg: rgba(50, 205, 50, 0.05);
    --success-border: rgba(50, 205, 50, 0.2);
    --success-text: #b7eb8f;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--surface-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    outline: none;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo-img {
    height: 32px;
    border-radius: 4px;
}

.search-box {
    position: relative;
    max-width: 380px;
    width: 250px;
    transition: var(--transition);
}

.search-box:focus-within {
    width: 320px;
}

.search-input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link-ext {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link-ext:hover {
    color: var(--accent);
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    outline: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* Layout Container */
.container {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px;
    z-index: 90;
    transition: var(--transition);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover {
    background-color: var(--accent-light);
    color: var(--accent);
    padding-left: 16px;
}

.sidebar-link.active {
    background-color: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding-left: 9px;
}

/* Main Content Area */
main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 40px 48px 80px;
    max-width: 1012px;
    transition: var(--transition);
}

/* Content Elements Styling */
.doc-section {
    margin-bottom: 48px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
    margin-bottom: 16px;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent);
    margin-top: 36px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

p {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Callout Boxes (Alerts) */
.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
    line-height: 1.5;
    font-size: 0.95rem;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.callout-warning {
    background-color: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.callout-info {
    background-color: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.callout-success {
    background-color: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

/* Code Blocks */
.code-container {
    position: relative;
    background: var(--code-bg);
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    text-transform: uppercase;
}

.copy-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
    font-family: inherit;
    font-weight: 500;
}

.copy-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

pre {
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--code-text);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--accent-border);
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
}

/* Highlight variables inside code styling */
.token.comment { color: #75715e; }
.token.keyword { color: #f92672; }
.token.string { color: #e6db74; }
.token.number { color: #ae81ff; }
.token.function { color: #a6e22e; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

th {
    background-color: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
}

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

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.01);
}

.dark-mode tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Image styling */
.doc-img-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin: 24px 0;
    box-shadow: var(--shadow);
    text-align: center;
}

.doc-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.doc-img-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Steps list */
.steps-list {
    list-style: none;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-item {
    display: flex;
    gap: 16px;
}

.step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 12px 35px rgba(39, 93, 99, 0.08);
    text-decoration: none;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    main {
        padding: 30px 24px 60px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.visible {
        transform: translateX(0);
    }
    
    main {
        margin-left: 0;
        padding: 24px 16px 40px;
    }
    
    .search-box {
        display: none; /* simple mobile version */
    }
}
