body {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f5;
}

#toolbar {
    margin: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button, select, input[type="color"], label {
    margin: 5px;
    padding: 10px;
    font-size: 16px;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, transform 0.1s;
}

button:active, select:active, input[type="color"]:active {
    transform: scale(0.95);
}

button:hover, select:hover, input[type="color"]:hover {
    background: #ccc;
}

#canvas-container {
    position: relative;
    display: inline-block;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#canvas {
    display: block;
    cursor: crosshair;
}

#resize-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ccc;
    bottom: 0;
    right: 0;
    cursor: se-resize;
    border-radius: 50%;
    transition: background 0.3s;
}

#resize-handle:hover {
    background-color: #aaa;
}

#text-input {
    font-size: 20px;
    border: 1px solid #000;
    outline: none;
    position: absolute;
    display: none;
    background: rgba(255, 255, 255, 0.8);
}

button {
    position: relative;
}

button:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #ccc;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
}
