/* =========================================
   COLOR VARIABLES - LIGHT THEME
========================================= */

:root {

    --background: #f5f7f9;

    --sidebar-background: #ffffff;

    --content-background: #ffffff;

    --text-primary: #17212b;

    --text-secondary: #65717d;

    --border-color: #dce2e7;

    --accent: #ff7a00;

    --accent-light: #fff0e3;

    --hover: #f2f4f6;

    --code-background: #f3f5f7;

    --shadow:
        0 4px 20px rgba(0, 0, 0, 0.06);

}


/* =========================================
   DARK THEME
========================================= */

[data-theme="dark"] {

    --background: #0c1319;

    --sidebar-background: #111a22;

    --content-background: #111a22;

    --text-primary: #e7edf3;

    --text-secondary: #9aa8b5;

    --border-color: #263541;

    --accent: #ff7a00;

    --accent-light: #33200f;

    --hover: #18242d;

    --code-background: #0a1015;

    --shadow:
        0 4px 20px rgba(0, 0, 0, 0.25);

}


/* =========================================
   GLOBAL
========================================= */

* {

    box-sizing: border-box;

}

html {

    scroll-behavior: smooth;

}

body {

    margin: 0;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);

    color: var(--text-primary);

    transition:
        background 0.25s ease,
        color 0.25s ease;

}


/* =========================================
   APP LAYOUT
========================================= */

.app {

    display: flex;

    min-height: 100vh;

}


/* =========================================
   SIDEBAR
========================================= */

.sidebar {

    position: fixed;

    top: 0;
    left: 0;

    width: 320px;

    height: 100vh;

    overflow-y: auto;

    background: var(--sidebar-background);

    border-right:
        1px solid var(--border-color);

    padding: 20px;

    z-index: 100;

}


.sidebar-header {

    padding-bottom: 20px;

    border-bottom:
        1px solid var(--border-color);

}


.brand-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}


.brand {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

}


.brand-icon {

    width: 44px;

    height: 44px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #ff9a32,
        #ff6a00
    );

    color: white;

    font-weight: 800;

    font-size: 18px;

    box-shadow:
        0 6px 15px rgba(255, 122, 0, 0.25);

}


.brand-title {

    font-size: 17px;

    font-weight: 700;

    line-height: 1.2;

}


.brand-subtitle {

    margin-top: 3px;

    font-size: 12px;

    color: var(--text-secondary);

}


.mobile-nav-toggle {

    display: none;

    width: 42px;

    height: 42px;

    border: 1px solid var(--border-color);

    border-radius: 10px;

    background: var(--content-background);

    color: var(--text-primary);

    font-size: 22px;

    cursor: pointer;

}


/* =========================================
   CONTROLS
========================================= */

.controls {

    padding:
        20px 0;

    display: flex;

    flex-direction: column;

    gap: 12px;

}


.control-group {

    display: flex;

    flex-direction: column;

    gap: 6px;

}


.control-group label {

    font-size: 12px;

    font-weight: 600;

    color: var(--text-secondary);

}


select {

    width: 100%;

    padding: 10px 12px;

    border-radius: 8px;

    border:
        1px solid var(--border-color);

    background: var(--content-background);

    color: var(--text-primary);

    font-size: 14px;

    cursor: pointer;

}


.theme-toggle {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 10px;

    border: none;

    border-radius: 8px;

    background: var(--accent);

    color: white;

    cursor: pointer;

    font-weight: 600;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;

}


.theme-toggle:hover {

    opacity: 0.9;

}


.theme-toggle:active {

    transform: scale(0.98);

}


/* =========================================
   SEARCH
========================================= */

.search-container {

    margin-bottom: 15px;

}


#search-input {

    width: 100%;

    padding: 12px;

    border-radius: 10px;

    border:
        1px solid var(--border-color);

    background: var(--background);

    color: var(--text-primary);

    outline: none;

}


#search-input:focus {

    border-color: var(--accent);

}


/* =========================================
   NAVIGATION
========================================= */

#sidebar-navigation {

    padding-bottom: 40px;

}


.nav-item {

    margin: 2px 0;

}


.nav-link {

    display: flex;

    align-items: center;

    width: 100%;

    padding: 8px 10px;

    border-radius: 7px;

    color: var(--text-secondary);

    text-decoration: none;

    font-size: 14px;

    line-height: 1.3;

    transition:
        background 0.15s ease,
        color 0.15s ease;

    overflow-wrap: anywhere;

}


.nav-link:hover {

    background: var(--hover);

    color: var(--text-primary);

}


.nav-link.active {

    background: var(--accent-light);

    color: var(--accent);

    font-weight: 600;

}


/* Hierarchy indentation */

.nav-level-1 .nav-link {

    font-weight: 700;

    color: var(--text-primary);

    margin-top: 12px;

}


.nav-level-2 {

    padding-left: 12px;

}


.nav-level-3 {

    padding-left: 24px;

}


.nav-level-4 {

    padding-left: 36px;

}


.nav-item.hidden {

    display: none;

}


/* =========================================
   MAIN CONTENT
========================================= */

.main-content {

    margin-left: 320px;

    width: calc(100% - 320px);

    min-height: 100vh;

}


#documentation-content {

    max-width: 1100px;

    margin: auto;

    padding:
        60px
        50px
        100px;

}


/* =========================================
   TYPOGRAPHY
========================================= */

h1 {

    font-size: 38px;

    margin-top: 60px;

    padding-bottom: 14px;

    border-bottom:
        1px solid var(--border-color);

}


h1:first-child {

    margin-top: 0;

}


h2 {

    margin-top: 55px;

    font-size: 28px;

}


h3 {

    margin-top: 40px;

    font-size: 22px;

}


h4 {

    margin-top: 30px;

    font-size: 18px;

}


p,
li {

    font-size: 16px;

    line-height: 1.75;

    color: var(--text-primary);

}


a {

    color: var(--accent);

}


/* =========================================
   IMAGES
========================================= */

figure {

    margin:
        35px auto;

    padding: 14px;

    background: var(--content-background);

    border:
        1px solid var(--border-color);

    border-radius: 16px;

    box-shadow: var(--shadow);

}


figure img {

    display: block;

    max-width: 100%;

    height: auto;

    margin: auto;

    border-radius: 10px;

}


figcaption {

    margin-top: 12px;

    text-align: center;

    color: var(--text-secondary);

    font-size: 14px;

}


/* =========================================
   ICON LIST CARDS
========================================= */

.icon-card {

    display: flex;

    align-items: center;

    gap: 20px;

    margin: 12px 0;

    padding: 15px 20px;

    background: var(--content-background);

    border:
        1px solid var(--border-color);

    border-radius: 12px;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;

}


.icon-card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow);

}


.icon-card-image {

    width: 55px;

    min-width: 55px;

    height: 55px;

    display: flex;

    align-items: center;

    justify-content: center;

}


.icon-card-image img {

    max-width: 48px;

    max-height: 48px;

    object-fit: contain;

}


.icon-card-text {

    color: var(--text-primary);

    font-size: 15px;

    line-height: 1.5;

}


/* =========================================
   TABLES
========================================= */

table {

    width: 100%;

    border-collapse: collapse;

    margin: 25px 0;

}


th,
td {

    padding: 12px;

    border:
        1px solid var(--border-color);

}


th {

    background: var(--hover);

}


/* =========================================
   PROGRESS BAR
========================================= */

.progress-bar {

    position: fixed;

    top: 0;

    left: 320px;

    right: 0;

    height: 3px;

    background: transparent;

    z-index: 200;

}


#progress {

    height: 100%;

    width: 0%;

    background: var(--accent);

}


/* =========================================
   LOADING
========================================= */

.loading {

    padding: 80px;

    text-align: center;

    color: var(--text-secondary);

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 900px) {

    .sidebar {

        position: sticky;

        top: 0;

        width: 100%;

        height: auto;

        max-height: none;

        padding: 12px 14px 16px;

        border-right: none;

        border-bottom: 1px solid var(--border-color);

    }

    .app {

        flex-direction: column;

    }

    .main-content {

        margin-left: 0;

        width: 100%;

    }

    .progress-bar {

        left: 0;

    }

    #documentation-content {

        padding:
            32px
            18px
            72px;

    }

    .mobile-nav-toggle {

        display: inline-flex;

        align-items: center;

        justify-content: center;

        flex-shrink: 0;

    }

    #sidebar-navigation {

        max-height: 0;

        overflow: hidden;

        opacity: 0;

        transition:
            max-height 0.25s ease,
            opacity 0.2s ease,
            padding 0.2s ease;

        padding: 0;

    }

    .sidebar.open #sidebar-navigation {

        max-height: 80vh;

        opacity: 1;

        padding-top: 12px;

    }

    .controls,
    .search-container {

        margin-top: 10px;

    }

    .nav-link {

        padding: 10px 12px;

        font-size: 15px;

    }

    h1 {

        font-size: 30px;

    }

    h2 {

        font-size: 24px;

    }

    h3 {

        font-size: 20px;

    }

    .icon-card {

        flex-direction: column;

        align-items: flex-start;

    }

}