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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

.controls {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-weight: 600;
    font-size: 0.9em;
    color: #495057;
}

input[type="file"] {
    display: none;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

select, input[type="number"] {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.canvas-container {
    padding: 30px;
    background: #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

#canvas-wrapper {
    background: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.status {
    padding: 20px 30px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin: 20px 30px;
    border-radius: 5px;
    display: none;
}

.status.active {
    display: block;
}

.status.success {
    background: #d4edda;
    border-color: #28a745;
}

.status.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.progress-bar {
    height: 4px;
    background: #e9ecef;
    margin: 0 30px 20px;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.progress-bar.active {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.image-controls {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-left: 4px solid #667eea;
    margin: 20px 30px;
    border-radius: 5px;
    display: none;
}

.image-controls.active {
    display: block;
}

.image-controls h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.1em;
}

.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    background: white;
    border: 2px solid #dee2e6;
}

.btn-small:hover {
    transform: translateY(-1px);
    border-color: #667eea;
}

.btn-small:active {
    transform: translateY(0);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.control-group-inline {
    display: flex;
    gap: 5px;
    align-items: center;
}

.control-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
    margin-right: 5px;
}

.info-panel {
    padding: 20px 30px;
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    margin: 20px 30px;
    border-radius: 5px;
}

.info-panel h3 {
    margin-bottom: 10px;
    color: #1976D2;
}

.info-panel ul {
    margin-left: 20px;
}

.info-panel li {
    margin: 5px 0;
}

footer {
    padding: 20px 30px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
}
