* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.upload-section {
    text-align: center;
    padding: 30px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-section.highlight {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.upload-section {
    cursor: pointer;
}

.upload-icon {
    margin-bottom: 15px;
    color: #999;
}

.upload-section p {
    margin-bottom: 15px;
    color: #666;
}

.file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.editor-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.canvas-container {
    flex: 1;
    min-width: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    min-height: 300px;
    position: relative;
    transition: all 0.3s ease;
}

.canvas-container.highlight {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

canvas.dragging {
    cursor: move;
}

.controls {
    flex: 1;
    min-width: 300px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.control-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

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

.control-group h3 {
    margin-bottom: 10px;
    color: #555;
}

input[type="text"], input[type="range"], input[type="color"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

input[type="range"] {
    padding: 0;
}

label {
    display: block;
    margin-bottom: 10px;
}

.position-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.position-controls button {
    padding: 8px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.position-controls button:hover {
    background-color: #e0e0e0;
}

.position-sliders {
    margin-top: 15px;
}

#downloadBtn {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#downloadBtn:hover {
    background-color: #45a049;
}

#downloadBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Only apply hover effects on devices that support hover (desktop) */
@media (hover: hover) {
    .canvas-container:hover .canvas-overlay {
        opacity: 1;
    }

    .canvas-container:hover .gesture-hint {
        opacity: 1;
    }
}

/* For touch devices, we'll control the overlay visibility via JavaScript */

.reupload-btn {
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.reupload-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

.gesture-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    font-size: 14px;
    border-radius: 4px;
    margin: 0 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }

    .canvas-container, .controls {
        width: 100%;
    }
}
