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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.alert-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.upload-form {
    margin-bottom: 30px;
}

.file-input-container {
    position: relative;
    margin-bottom: 30px;
}

.file-input-container input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-label.file-selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-text {
    color: #666;
    font-size: 1.1em;
}

.file-button {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
}

.file-size-info {
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

.file-error {
    margin-top: 8px;
    padding: 8px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    font-size: 0.9em;
    text-align: center;
}

.progress-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
}

.progress-step:last-child {
    margin-bottom: 0;
}

.progress-icon {
    font-size: 1.5em;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.progress-text {
    flex: 1;
    font-weight: 500;
    color: #333;
    margin-right: 15px;
}

.progress-bar {
    flex: 2;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

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

.progress-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-step.completed .progress-icon {
    color: #28a745;
}

.progress-step.active .progress-text {
    color: #667eea;
}

.progress-step.disabled {
    opacity: 0.5;
}

.progress-step.disabled .progress-spinner {
    display: none;
}

.parameters {
    margin-bottom: 30px;
}

.parameters h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3em;
}

.param-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.param-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.param-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    margin-bottom: 10px;
}

.param-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.param-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.param-value {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.param-help {
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.optimize-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.optimize-btn:hover {
    transform: translateY(-2px);
}

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

.info-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.info-section ul {
    list-style: none;
}

.info-section li {
    margin-bottom: 8px;
    padding-left: 10px;
    color: #555;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9em;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-description {
    margin: 0;
    font-size: 1em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-legal a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-legal a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-legal .separator {
    opacity: 0.6;
}

.footer-credits {
    margin: 0;
}

.footer-credits p {
    margin: 0;
    font-size: 0.85em;
}

.footer-credits a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.footer-credits a:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .param-group {
        padding: 15px;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 5px;
    }
    
    .footer-legal .separator {
        display: none;
    }
}