:root {
    --primary-color: #4a6bff;
    --secondary-color: #f5f7ff;
    --dark-color: #2d3748;
    --light-color: #f8fafc;
    --success-color: #48bb78;
    --error-color: #f56565;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8fafc;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

header h1 i {
    margin-right: 10px;
}

header p {
    color: #64748b;
    font-size: 1.1rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    background-color: white;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.upload-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-content p {
    margin: 10px 0;
    color: #64748b;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background-color: #3a56d4;
    transform: translateY(-2px);
}

.btn i {
    margin-right: 8px;
}

.btn.secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn.secondary:hover {
    background-color: var(--secondary-color);
}

.settings-panel {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus, input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.2);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.resize-options {
    margin-top: 15px;
    padding: 15px;
    background-color: var(--secondary-color);
    border-radius: 6px;
}

.resize-input {
    margin-bottom: 10px;
}

.resize-input:last-child {
    margin-bottom: 0;
}

.preview-section, .results-section {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.preview-section h3, .results-section h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: var(--dark-color);
}

.preview-container, .results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.preview-item, .result-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-item:hover, .result-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.preview-image, .result-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.preview-info, .result-info {
    padding: 15px;
}

.preview-info h4, .result-info h4 {
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-info p, .result-info p {
    font-size: 0.9rem;
    color: #64748b;
}

.file-size {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.progress-container {
    margin-bottom: 30px;
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar div {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .preview-container, .results-container {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}