:root {
    --bg-main: #2e3440;
    --bg-secondary: #3b4252;
    --bg-button: #88c0d0;
    --bg-button-hover: #81a1c1;
    --bg-button-disabled: #5e81ac;
    --text-light: #d8dee9;
    --text-dark: #2e3440;
    --text-muted: #4c566a;
    --border: #4c566a;
    --highlight: #5e81ac;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;
    background: var(--bg-main);
}

body {
    display: flex;
    flex-direction: column;
}

.button-bar {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 10px 20px;
    flex-shrink: 0;
}

.color-controls,
.brush-controls {
    display: flex;
    flex-direction: column;
}

.canvas-size-controls {
    display: flex;
    flex-direction: row;
}

.sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
    background: var(--bg-secondary);
    overflow-y: auto;
}

.main {
    background: var(--bg-secondary);
    overflow: auto;
    height: 100%;
    min-width: 0;
}

.canvas-container {
    width: max-content;
    height: max-content;
    padding: 10px;
}

canvas {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--border);
    cursor: crosshair;
    touch-action: none;
}

button {
    border: none;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 14px;
    cursor: pointer;
    background-color: var(--bg-button);
    color: var(--text-dark);
}

button:hover {
    background-color: var(--bg-button-hover);
}

button:disabled {
    background-color: var(--bg-button-disabled);
    color: var(--text-muted);
}

button.active {
    box-shadow: 0 0 0 2px var(--text-light);
}

.material-symbols-outlined {
    font-variation-settings:
        "FILL" 0,
        "wght" 400,
        "GRAD" 0,
        "opsz" 24;
}

label,
p {
    font-size: 14px;
    color: var(--text-light);
    margin: 10px;
}

input[type="range"],
select,
.canvas-size-controls input {
    width: 100%;
}

.color-preview {
    width: auto;
    height: 25px;
    border-radius: 5px;
}

.color-wheel {
    display: flex;
    flex-direction: column;
}

#helpModal {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-muted);
    color: var(--text-light);
    padding: 20px;
    border-radius: 8px;
    z-index: 999;
}

li {
    list-style-type: none;
}

input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
    outline: none;
}

/* WebKit Slider */
input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: var(--bg-button);
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 20px;
    background: var(--bg-button-hover);
    border: 2px solid var(--text-light);
    margin-top: -6px;
    cursor: pointer;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
    position: relative;
    z-index: 2;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus::-webkit-slider-thumb {
    background: var(--highlight);
    border-color: var(--text-light);
    box-shadow: 0 0 6px #5e81ac88;
}

/* Firefox Slider */
input[type="range"]::-moz-range-track {
    height: 8px;
    background: var(--bg-button);
    border-radius: 4px;
}

input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 20px;
    background: var(--bg-button-hover);
    border: 2px solid var(--text-light);
    cursor: pointer;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:focus::-moz-range-thumb {
    background: var(--highlight);
    border-color: var(--text-light);
    box-shadow: 0 0 6px #5e81ac88;
}