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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.description {
    color: #666;
    font-size: 1.1em;
}

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

#imageInput {
    display: none;
}

.file-label {
    background: #667eea;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.file-label:hover {
    background: #5568d3;
}

#clearSelection {
    background: #e74c3c;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

#clearSelection:hover:not(:disabled) {
    background: #c0392b;
}

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

#saveButton {
    background: #27ae60;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s, transform 0.1s;
}

#saveButton:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-2px);
}

#saveButton:active:not(:disabled) {
    transform: translateY(0);
}

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

.instructions {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.instructions p {
    color: #333;
    margin-bottom: 10px;
}

.instructions ul {
    list-style-position: inside;
    color: #555;
}

.instructions li {
    margin: 5px 0;
}

kbd {
    background: #333;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: monospace;
}

.canvas-wrapper {
    max-height: 70vh;
    overflow: auto;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    transition: border-color 0.3s, background-color 0.3s;
}

.canvas-wrapper.drag-over {
    border-color: #667eea;
    background: #e8ecff;
    border-width: 3px;
}

#canvas {
    display: none;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3" fill="rgba(0,0,0,0.7)" stroke="white" stroke-width="1"/></svg>') 8 8, auto;
    background: white;
}

#canvas.active {
    display: block;
}

.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-zone.hidden {
    display: none;
}

.drop-zone-content {
    text-align: center;
    color: #667eea;
}

.drop-zone-content svg {
    margin-bottom: 20px;
    opacity: 0.7;
}

.drop-zone-content p {
    font-size: 1.2em;
    font-weight: 500;
    margin: 10px 0;
}

.drop-zone-sub {
    font-size: 0.95em !important;
    color: #999 !important;
    font-weight: 400 !important;
}

.status {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    min-height: 40px;
    border-radius: 6px;
    font-weight: 500;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}
