/* GLOBAL */
body {
    margin: 0;
    height: 100vh;
    display: flex;
    font-family: system-ui, -apple-system, sans-serif;
    color: #e5e5e5;
}

/* LEFT PANEL */
#controls {
    width: 300px;
    height: 100vh; 
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #1a1a1a;
    box-sizing: border-box;
    border-right: 2px solid #2a2a2a;
}

/* TITLES AND TEXT */
h1 {
    font-size: 20px;
    margin: 0;
    letter-spacing: 0.5px;
}

h2 {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.hints {
    display: flex;
    gap: 12px;
    font-size: 10px;

    .hint {
        flex: 1;
    }
}

a {
    color: #8ab4ff;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

/* SEPARATOR */
hr {
    border: none;
    border-top: 1px solid #444;
    margin: 8px 0;
}

/* BUTTONS */
.row {
    display: flex;
    gap: 8px;
}

button {
    width: 100%;
    padding: 6px 8px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #eee;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;

    &:hover {
        background: #333;
    }

    &:active {
        background: #3d3d3d;
    }
}

/* SELECT */
select {
    padding: 5px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #eee;
    font-size: 11px;
    border-radius: 4px;
}

/* SWITCH */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;

    /* hide default checkbox */
    input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    /* track */
    .switch-slider {
        position: absolute;
        inset: 0;
        background: #444;
        border-radius: 999px;
        transition: 0.2s;
        cursor: pointer;
    }

    /* knob */
    .switch-slider::before {
        content: "";
        position: absolute;
        height: 14px;
        width: 14px;
        left: 2px;
        top: 2px;
        background: white;
        border-radius: 50%;
        transition: 0.2s;
    }

    /* checked state */
    input:checked + .switch-slider {
        background: #999;
    }

    input:checked + .switch-slider::before {
        transform: translateX(14px);
    }
}

/* SLIDER */
.slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #2f2f2f;
    border-radius: 4px;
    outline: none;
    margin-top: 10px;

    &::-moz-range-thumb {
        cursor: pointer;
        background: #DDD;
    }

    &.disabled {
        display: none;
    }
}

/* CONTROL GROUP */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;

    .slider-header {
        display: flex;
        justify-content: space-between;
        align-items: center;

        /* label */
        label {
            font-size: 11px;
            opacity: 0.8;
        }
    }
}

/* PALETTE */
#palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    overflow-y: auto;

    .swatch {
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 4px;
        border: 4px solid transparent;
        box-sizing: border-box;
        cursor: pointer;

        &.disabled {
            border-color: red;
        }

        &:hover {
            border-color: white;
        }
    }

    .swatch.add {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #444;
        font-size: 32px;
    }
}

/* RIGHT PANEL */
#preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;

    canvas {
        width: 100%;
        height: 100%;
    }
}

