* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
}

.container {
    display: flex;
    height: 100vh;
}

.controls {
    width: 350px;
    background: white;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #ddd;
}

.controls h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.control-group input[type="number"],
.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 400;
    margin-bottom: 0;
}

.btn {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    background: #5568d3;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-primary {
    background: #28a745;
}

.btn-primary:hover {
    background: #218838;
}

.stop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
}

.stop-item input[type="color"] {
    width: 50px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.stop-item input[type="number"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.stop-item button {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.stop-item button:hover {
    background: #c82333;
}

.stop-item button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#gradient-bar-container {
    position: relative;
    height: 50px;
    margin-bottom: 15px;
    cursor: crosshair;
}

#gradient-bar {
    width: 100%;
    height: 30px;
    border-radius: 4px;
    border: 2px solid #ddd;
    position: absolute;
    top: 10px;
}

#stops-markers {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.stop-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    cursor: grab;
    top: 15px;
    margin-left: -10px;
    z-index: 1;
}

.stop-marker:active {
    cursor: grabbing;
    z-index: 2;
}

.stop-marker.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px #667eea, 0 2px 5px rgba(0, 0, 0, 0.3);
}
