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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

h2 {
    margin: 20px 0 10px;
    color: #34495e;
}

h3 {
    margin-bottom: 10px;
    color: #34495e;
}

p {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

.upload-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#imageInput {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #2980b9;
}

.file-name {
    color: #666;
    font-style: italic;
}

.settings-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.setting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.setting label {
    min-width: 150px;
}

.setting input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}

.generate-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.generate-btn:hover:not(:disabled) {
    background-color: #219a52;
}

.generate-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.preview-section,
.svg-section,
.gcode-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.image-container {
    display: flex;
    justify-content: center;
    overflow: auto;
}

#originalCanvas {
    max-width: 100%;
    border: 1px solid #ddd;
}

.svg-container {
    display: flex;
    justify-content: center;
    overflow: auto;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
}

.svg-container svg {
    max-width: 100%;
    height: auto;
}

.download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #8e44ad;
}

#gcodeOutput {
    width: 100%;
    height: 300px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    background: #fafafa;
}

@media (max-width: 600px) {
    .upload-section {
        flex-direction: column;
    }
    
    .setting {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .setting input {
        width: 100%;
    }
}
