:root {
    --bg-dark: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b5b5b5;
    --accent: #ff3333;
    --accent-hover: #ff5555;
    --accent-glow: rgba(255, 51, 51, 0.3);
    --border: #404040;
    --highlight: #999999;
    color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #ffffff;
        --bg-secondary: #f8f8f8;
        --bg-tertiary: #efefef;
        --text-primary: #1a1a1a;
        --text-secondary: #444444;
        --accent: #7eb3ff;
        --accent-hover: #5a9ae8;
        --accent-glow: rgba(126, 179, 255, 0.25);
        --border: #dcdcdc;
        --highlight: #555555;
    }
}

html.light-mode {
    --bg-dark: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-tertiary: #efefef;
    --text-primary: #1a1a1a;
    --text-secondary: #444444;
    --accent: #7eb3ff;
    --accent-hover: #5a9ae8;
    --accent-glow: rgba(126, 179, 255, 0.25);
    --border: #dcdcdc;
    --highlight: #555555;
}

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

body {
    font-family: Tahoma, system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    padding: 0;
    padding-bottom: 28px;
    font-size: 13px;
    line-height: 1.5;
    scrollbar-gutter: stable;
}

html {
    height: 100%;
}

::selection {
    background-color: white;
    color: var(--bg-dark);
}

::-moz-selection {
    background-color: white;
    color: var(--bg-dark);
}
.sidenav a.active {
    color: var(--accent);
}
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border: 2px solid var(--bg-secondary);
}

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

.container {
    display: flex;
    align-items: flex-start;
    height: 100%;
}

.sidenav {
    position: fixed;
    left: 0;
    top: 0;
    width: 210px;
    height: calc(100vh - 22px);
    padding: 16px 12px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 12px;
    z-index: 100;
}

.sidenav p {
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidenav a {
    display: block;
    padding: 4px 0;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.sidenav a:visited {
    color: var(--text-secondary);
}

.sidenav a:hover {
    color: var(--accent);
}

.sidenav a.active,
.sidenav a.active:visited,
.sidenav a.active:hover {
    color: var(--accent);
}

html.light-mode .sidenav a.active {
    color: var(--accent);
}

.sidenav > hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.sidenav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    justify-content: center;
}

.sidenav-buttons img {
    width: 83px;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.sidenav-buttons img:hover {
    opacity: 0.8;
}


.theme-toggle {
    width: 100%;
    padding: 8px 4px;
    margin-bottom: 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent);
}

.body-content {
    margin-left: 200px;
    width: calc(100% - 200px);
    padding: 12px;
    padding-top: 8px;
    padding-bottom: 40px;
}

.blog-article {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 0 30px var(--accent-glow);
    overflow: hidden;
}

.blog-titlebar {
    background-color: var(--bg-secondary);
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-title {
    font-weight: bold;
    font-size: 16px;
    color: var(--accent);
}

.slidecontainer {
    display: flex;
    align-items: center;
    height: 100%;
    margin-right: 0;
}

.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.color-picker-container label {
    display: none;
}

.custom-slider-range {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 20px;
    background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
    outline: none;
    opacity: 0.8;
    transition: opacity 0.4s;
    border: 1px solid #ff3333;
    box-shadow: 0 0 10px #ff3333;
    border-radius: 2px;
    cursor: pointer;
}

.custom-slider-range:hover {
    opacity: 1;
}

.custom-slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 18px;
    background: white;
    border: 1px solid #000;
    cursor: pointer;
    border-radius: 0;
}

.custom-slider-range::-moz-range-thumb {
    width: 10px;
    height: 18px;
    background: white;
    border: 1px solid #000;
    border-radius: 0;
    cursor: pointer;
}

.blog-meta {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    border-bottom: 1px solid var(--border);
}

.blog-content {
    padding: 16px;
}

.blog-text-section {
    margin-bottom: 16px;
}

.blog-text-section p {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
}

.blog-text-section p:last-child {
    margin-bottom: 0;
}

figure {
    margin: 16px 0 16px 0;
    border: 1px solid var(--border);
    background-color: var(--bg-tertiary);
    padding: 8px;
}

.blog-image-right {
    float: right;
    width: 300px;
    margin: 0 0 16px 16px;
}

.blog-image-left {
    float: left;
    width: 300px;
    margin: 0 16px 16px 0;
}

.blog-image-full {
    clear: both;
    width: 100%;
    margin: 16px 0;
}

figure img {
     width: 100%;
    display: block;
    border: 1px solid var(--border);
    transition: border 0.2s ease;
    height: auto;
    object-fit: contain;
}

figure img:hover {
    border-color: var(--accent);
}

figcaption {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px;
    text-align: center;
    font-style: italic;
}

.blog-back-button {
    display: inline-block;
    margin: 16px;
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    font-size: 12px;
}

.blog-back-button:hover {
    background-color: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

a {
    color: #5b8def;
    text-decoration: none;
    border-bottom: 1px solid #5b8def;
    transition: color 0.15s ease;
    cursor: pointer;
}

a:hover {
    border-bottom-color: #5b8def;
}

a:visited {
    color: #d0d0d0;
    border-bottom-color: #d0d0d0;
}

a:active {
    color: #5b8def;
}
.sidenav a.active {
    color: var(--accent);
}

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 22px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    z-index: 9999;
    font-size: 11px;
    color: var(--text-secondary);
}

.taskbar-left {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-right: 1px solid var(--border);
    height: 100%;
}

.taskbar-center {
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 100%;
}

.taskbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-left: 1px solid var(--border);
    height: 100%;
}

.taskbar-icon {
    height: 14px;
    width: 14px;
    vertical-align: middle;
}

@media (max-width: 1000px) {
    .blog-image-right,
    .blog-image-left {
        width: 100%;
        float: none;
        margin: 16px 0;
    }
}

@media (max-width: 800px) {
    .sidenav {
        width: 160px;
        padding: 12px 8px;
    }

    .body-content {
        margin-left: 160px;
        width: calc(100% - 160px);
    }

    .blog-article {
        max-width: 100%;
    }

    .blog-titlebar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .slidecontainer {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidenav {
        width: 140px;
        padding: 12px 8px;
    }

    .body-content {
        margin-left: 140px;
        width: calc(100% - 140px);
        padding: 8px;
    }

    .blog-titlebar {
        padding: 8px;
        flex-direction: column;
        gap: 8px;
    }

    .blog-title {
        font-size: 14px;
    }

    .blog-meta {
        padding: 6px 12px;
        font-size: 11px;
    }

    .blog-content {
        padding: 12px;
    }

    .blog-text-section p {
        font-size: 12px;
    }

    .blog-image-right,
    .blog-image-left {
        width: 100%;
        margin: 12px 0;
    }

    figure {
        margin: 12px 0;
        padding: 6px;
    }

    figcaption {
        font-size: 11px;
    }

    .blog-back-button {
        margin: 12px;
        padding: 6px 12px;
    }
}