body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s, box-shadow 0.3s;
}

h1 {
    margin-block-start: 0;
    color: #2c3e50;
    transition: color 0.3s;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-block-end: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 14px;
}

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

button:active {
    transform: scale(0.98);
}

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

.status {
    margin-block-end: 10px;
    font-weight: bold;
    display: flex;
    gap: 20px;
}

.canvas-container {
    margin: 20px 0;
    overflow: auto;
    max-width: 100%;
    border: 1px solid #ddd;
    box-shadow: 0 0 5px rgba(0,0,0,0.05);
    transition: border-color 0.3s;
}

canvas {
    display: block;
}

.instructions {
    margin-block-start: 20px;
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

.instructions h3 {
    margin-block-start: 0;
}

.instructions ul {
    margin-block-end: 0;
    padding-inline-start: 20px;
}

/* Drop Overlay */
.drop-overlay {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.2s;
    pointer-events: none; /* Allow events initially, toggled by JS usually or managed by visibility */
}

.drop-overlay.hidden {
    opacity: 0;
    display: none;
}

.drop-text {
    color: white;
    font-size: 2em;
    font-weight: bold;
    padding: 20px;
    border: 3px dashed white;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
}

footer {
    margin-block-start: 30px;
    padding: 20px;
    padding-block-end: 0;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    border-block-start: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
}

footer a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .container {
        background: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }

    h1 {
        color: #ffffff;
    }

    .controls {
        background-color: #363636;
    }

    button {
        background-color: #0069d9;
    }

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

    .canvas-container {
        border-color: #444;
        background-color: #111;
    }

    .instructions {
        background-color: #363636;
        color: #ddd;
    }

    input[type="file"] {
        color: #ddd;
    }

    footer {
        color: #aaa;
        border-block-start-color: #444;
    }

    footer a {
        color: #4dabf7;
    }

    footer a:hover {
        color: #74c0fc;
    }
}
