:root {
    --primary-color: #0075FF;
    --primary-hover: #005ECC;
    --danger-color: #E53935;
    --danger-hover: #C62828;
    --light-gray: #f8f9fa;
    --gray: #e9ecef;
    --dark-gray: #6c757d;
    --text-color: #212529;
    --white: #fff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--white);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    font-weight: 600;
    color: var(--text-color);
    font-size: clamp(1.4rem, 6.5vw, 2.5rem);
    text-align: center;
    white-space: nowrap; /* Keep title on one line */
}

main > p {
    text-align: center;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 25px;
    background-color: var(--light-gray);
    padding: 25px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid var(--gray);
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray);
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch {
    border-radius: 50%;
    border: 2px solid var(--gray);
}
input[type="color"]::-moz-color-swatch {
    border-radius: 50%;
    border: 2px solid var(--gray);
}

.control-group-slider {
    width: 160px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--gray);
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    transition: background .2s;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: background .2s;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--primary-hover);
}
input[type="range"]:hover::-moz-range-thumb {
    background: var(--primary-hover);
}

#thicknessValue {
    font-size: 14px;
    margin-top: 8px;
    color: var(--text-color);
    font-weight: 600;
}

button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#undoButton {
    background-color: var(--danger-color);
}

#undoButton:hover {
    background-color: var(--danger-hover);
}

.canvas-container {
    position: relative;
    width: 100%;
    max-width: 900px; /* Adjust as needed */
    border: 1px solid var(--gray);
    background-color: var(--white);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    margin: 0 auto;
}



canvas#canvas {
    display: block; /* Remove extra space below canvas */
    width: 100%;
    height: auto;
    background-color: #f0f0f0; /* A light background for the canvas itself */
    border-radius: var(--border-radius);
}

footer {
    width: 100%;
    background-color: var(--light-gray);
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--dark-gray);
    box-sizing: border-box;
    border-top: 1px solid var(--gray);
}
