body {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
}

h1 {
    color: #333;
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px 40px;
    margin-top: 30px;
    border: 3px dashed #d8b4fe;
    border-radius: 12px;
    background-color: #faf5ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.drop-zone:hover {
    border-color: #c084fc;
    background-color: #f3e8ff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
    transform: translateY(-2px);
}

.drop-zone:focus {
    outline: 3px solid #a855f7;
    outline-offset: 4px;
}

.drop-zone.drag-over {
    border-color: #a855f7;
    border-style: solid;
    background-color: #f3e8ff;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.drop-zone i {
    color: #a855f7;
    margin-bottom: 20px;
    opacity: 0.8;
}

.drop-zone.drag-over i {
    color: #a855f7;
    opacity: 1;
}

.drop-zone p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.drop-zone p:first-of-type {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.drop-zone p:nth-of-type(2) {
    margin-bottom: 8px;
}

.drop-zone small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

@media (max-width: 600px) {
    .drop-zone {
        min-height: 280px;
        padding: 40px 20px;
    }

    .drop-zone i {
        font-size: 2.5em !important;
    }

    .drop-zone p:first-of-type {
        font-size: 18px;
    }
}

form {
    margin-top: 20px;
}

input[type="file"] {
    margin: 10px 0;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

.message {
    color: green;
    font-weight: bold;
    padding: 10px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 15px;
}

#loading {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

#result {
    margin-top: 20px;
}

#result h2 {
    color: #333;
}

#output-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin: 10px 0;
    display: block;
    background:
        repeating-conic-gradient(#ddd 0% 25%, white 0% 50%)
        50% / 20px 20px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#download-btn {
    background-color: #f43f5e;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#download-btn:hover {
    background-color: #e11d48;
}

#copy-btn {
    background-color: #a855f7;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#copy-btn:hover {
    background-color: #9333ea;
}

#copy-btn.copied {
    background-color: #6c757d;
}

#upload-another-btn {
    background-color: #a855f7;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#upload-another-btn:hover {
    background-color: #9333ea;
}

#canvas-editor {
    margin-top: 20px;
}

.canvas-controls {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
}

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

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mode-toggle {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 10px 15px;
    background-color: #fff;
    color: #333;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.mode-btn:hover {
    border-color: #a855f7;
    background-color: #faf5ff;
}

.mode-btn.active {
    background-color: #a855f7;
    color: white;
    border-color: #a855f7;
}

.mode-btn i {
    margin-right: 5px;
}

#brush-size,
#brush-hardness {
    width: 100%;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.action-btn i {
    margin-right: 5px;
}

#reset-btn {
    background-color: #6c757d;
    color: white;
}

#reset-btn:hover {
    background-color: #5a6268;
}

#done-btn {
    background-color: #f43f5e;
    color: white;
}

#done-btn:hover {
    background-color: #e11d48;
}

#undo-btn,
#redo-btn {
    background-color: #a855f7;
    color: white;
}

#undo-btn:hover:not(:disabled),
#redo-btn:hover:not(:disabled) {
    background-color: #9333ea;
}

#undo-btn:disabled,
#redo-btn:disabled {
    background-color: #6c757d;
    opacity: 0.5;
    cursor: not-allowed;
}

.canvas-container {
    background:
        repeating-conic-gradient(#ddd 0% 25%, white 0% 50%)
        50% / 20px 20px;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    display: inline-block;
}

#editor-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
    touch-action: none;
}

#retouch-btn {
    background-color: #a855f7;
    color: white;
}

#retouch-btn:hover {
    background-color: #9333ea;
}

#editor-canvas {
    cursor: none;
}

#brush-cursor {
    position: fixed;
    border-radius: 50%;
    border: 2px solid;
    pointer-events: none;
    z-index: 1000;
    display: none;
    transition: border-color 0.2s;
}

#brush-cursor.erase-mode {
    border-color: #f43f5e;
}

#brush-cursor.restore-mode {
    border-color: #3b82f6;
}

#brush-opacity {
    width: 100%;
    cursor: pointer;
}

.zoom-controls label {
    margin-bottom: 8px;
}

#zoom-value {
    font-weight: 600;
    color: #a855f7;
}

.zoom-buttons {
    display: flex;
    gap: 8px;
}

.zoom-btn {
    flex: 1;
    padding: 10px;
    background-color: #a855f7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background-color: #9333ea;
}

.zoom-btn:active {
    transform: scale(0.95);
}

.canvas-container {
    overflow: auto;
    max-width: 100%;
    max-height: 600px;
    position: relative;
}