body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 10px;
}

p {
    color: #666;
    margin-bottom: 25px;
}

.input-section {
    margin-bottom: 20px;
}

/* Hide default file input */
#imageUpload {
    display: none;
}

.upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-button:hover {
    background-color: #0056b3;
}

.image-editor-container {
    position: relative;
    display: inline-block; /* For proper centering */
    border: 1px solid #ddd;
    margin-bottom: 20px;
    max-width: 100%; /* Ensure container doesn't exceed parent width */
    overflow: hidden; /* Hide overflow if image is too large */
}

#inputImage {
    display: block; /* Remove extra space below image */
    max-width: 100%;
    height: auto;
    object-fit: contain;
    cursor: crosshair;
}

#maskCanvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
}

#noImagePrompt {
    padding: 50px;
    color: #999;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #28a745;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.controls button:hover:not(:disabled) {
    background-color: #218838;
}

.controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.controls #resetButton {
    background-color: #dc3545;
}

.controls #resetButton:hover:not(:disabled) {
    background-color: #c82333;
}

.controls input[type="range"] {
    width: 100px;
    margin-left: 10px;
}

.output-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

#outputImage {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    margin-top: 15px;
}

#loading {
    margin-top: 15px;
    color: #007bff;
    font-weight: bold;
}
