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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    background: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.header ul {
    opacity: 0.9;
    font-size: 1.1rem;
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    display: inline-block;
    text-align: left;
}

.header li {
    margin: 8px 0;
    position: relative;
    padding-left: 25px;
}

.header li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.2em;
}

.main-content {
    padding: 40px;
}

.upload-section {
    border: 3px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: border-color 0.3s;
}

.upload-section.dragover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

#fileInput {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-button {
    background: #667eea;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.file-input-button:hover {
    background: #5a6fd8;
}

.controls-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.3s ease-out;
}

.controls-section.show {
    max-height: 1000px;
    opacity: 1;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.control-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.control-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.control-group input:focus {
    outline: none;
    border-color: #667eea;
}

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

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.process-button {
    background: #27ae60;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    margin: 20px 0;
}

.process-button:hover:not(:disabled) {
    background: #229954;
}

.process-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.results {
    margin-top: 30px;
    display: none;
}

.results.show {
    display: block;
}

.result-item {
    background: #e8f5e8;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
}

.download-button {
    background: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 10px 5px 0 0;
    transition: background 0.3s;
}

.download-button:hover {
    background: #2980b9;
}

.visualization {
    margin-top: 30px;
    text-align: center;
    display: none;
}

.canvas-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.canvas-wrapper {
    text-align: center;
}

.canvas-wrapper canvas {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    max-width: 100%;
}

.canvas-title {
    margin-top: 10px;
    font-weight: 600;
    color: #333;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1976d2;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .canvas-container {
        flex-direction: column;
        align-items: center;
    }
}