* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #181818;
    color: #fff;
    min-height: 100vh;
}

header {
    height: 64px;
    background: #222;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 19px;
    margin: 0;
}

.app {
    display: flex;
    height: calc(100vh - 64px);
}

/* SIDEBAR */

.sidebar {
    width: 280px;
    background: #202020;
    border-right: 1px solid #333;
    padding: 20px;
    overflow-y: auto;
}

.section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 12px;
    text-transform: uppercase;
}

button,
input[type="file"] {
    width: 100%;
}

button {
    border: none;
    border-radius: 7px;
    padding: 11px;
    background: #333;
    color: white;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 8px;
}

button:hover {
    background: #444;
}

.primary {
    background: #4d75ff;
}

.primary:hover {
    background: #5c82ff;
}

.download {
    background: #20a060;
}

.download:hover {
    background: #27b36d;
}

label {
    display: block;
    font-size: 13px;
    color: #ccc;
    margin-bottom: 7px;
}

.value {
    float: right;
    color: #fff;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 20px;
}

select {
    width: 100%;
    padding: 10px;
    background: #303030;
    color: white;
    border: 1px solid #444;
    border-radius: 6px;
}

/* IMAGE AREA */

.workspace {
    flex: 1;
    position: relative;
    overflow: hidden;

    background:
        linear-gradient(
            45deg,
            #222 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #222 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #222 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #222 75%
        );

    background-size: 30px 30px;

    background-position:
        0 0,
        0 15px,
        15px -15px,
        -15px 0;
}

.canvas-wrapper {
    position: absolute;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: auto;
    padding: 30px;

    cursor: default;
    user-select: none;
}

.canvas-wrapper.panning {
    cursor: grabbing;
}

#canvas {
    display: none;

    box-shadow:
        0 5px 30px rgba(0, 0, 0, .5);

    cursor: crosshair;

    flex: none;
}

/* BRUSH INDICATOR */

#brushIndicator {
    position: absolute;

    width: 60px;
    height: 60px;

    border: 2px solid white;
    border-radius: 50%;

    pointer-events: none;

    display: none;

    z-index: 20;

    transform: translate(-50%, -50%);

    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

/* ZOOM */

.zoom-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.zoom-controls button {
    width: 42px;
    margin-bottom: 0;
    padding: 8px;
}

#zoomValue {
    flex: 1;

    text-align: center;

    font-size: 13px;

    color: #ccc;
}

/* EMPTY STATE */

.empty {
    position: absolute;
    inset: 0;

    display: flex;

    justify-content: center;
    align-items: center;

    color: #888;

    font-size: 16px;

    text-align: center;

    pointer-events: none;
}

/* INSTRUCTIONS */

.instructions {
    line-height: 1.6;

    color: #aaa;

    font-size: 13px;
}

/* STATUS */

.status {
    position: absolute;

    bottom: 15px;
    left: 15px;

    background: rgba(0, 0, 0, .65);

    padding: 7px 10px;

    border-radius: 6px;

    font-size: 12px;

    color: #ccc;
}

/* DROP */

.workspace.dragging {
    outline: 3px solid #4d75ff;
    outline-offset: -3px;
}
