:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 1fr;
    }
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    grid-column: 1 / -1;
    text-align: center;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="file"], select, input[type="number"], input[type="range"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

button:hover {
    background-color: var(--primary-hover);
}

button:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

.output {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 300px;
    text-align: center;
    position: relative;
}

#resultImg {
    max-width: 100%;
    max-height: 400px;
    border-radius: 6px;
    display: none;
}

#downloadBtn {
    display: none;
    text-decoration: none;
    text-align: center;
}

.status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.spinner {
    display: none;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.warning-box {
    display: block;
    color: #d9534f;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.warning-box.hidden {
    display: none !important;
}
