:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --background: #ecf0f1;
    --text: #2c3e50;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

.upload-section {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    transition: border-color 0.3s ease;
}

.upload-section:hover {
    border-color: var(--secondary);
}

.upload-box {
    cursor: pointer;
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.preview-container {
    display: none;
    margin-top: 1rem;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.image-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.controls {
    margin: 2rem 0;
}

.control-group {
    margin-bottom: 1.5rem;
}

select, input[type="range"], input[type="number"] {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.optimize-btn {
    background: var(--secondary);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    transition: background 0.3s ease;
}

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

.result-section {
    display: none;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.comparison {
    display: flex;
    justify-content: space-around;
    margin: 1.5rem 0;
    font-weight: bold;
}

.download-btn {
    background: var(--accent);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #c0392b;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .upload-section {
        padding: 1.5rem;
    }
    
    .upload-icon {
        width: 50px;
        height: 50px;
    }
}