:root {
    --primary-color: #4a6bff;
    --secondary-color: #3a56d4;
    --accent-color: #6c8eff;
    --success-color: #00c851;
    --danger-color: #ff3547;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7ff;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.compressor-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 1000px;
    padding: 30px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header p {
    color: #666;
    font-size: 16px;
}

.dropzone {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 25px;
    background-color: #fafafa;
}

.dropzone:hover {
    border-color: var(--accent-color);
    background-color: rgba(74, 107, 255, 0.05);
}

.dropzone.active {
    border-color: var(--primary-color);
    background-color: rgba(74, 107, 255, 0.1);
}

.dropzone-content i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.dropzone-content h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.dropzone-content p {
    margin: 10px 0;
    color: #666;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

#selectFilesBtn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

#selectFilesBtn:hover {
    background-color: var(--primary-color);
    color: white;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.option {
    display: flex;
    flex-direction: column;
}

.option label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.option input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.quality-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#qualityValue {
    font-weight: bold;
    color: var(--primary-color);
}

.quality-hint {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.option input[type="number"],
.option select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
}

.option input:focus,
.option select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.file-list {
    margin: 25px 0;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.file-icon {
    color: var(--primary-color);
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.file-size {
    color: #666;
    font-size: 14px;
}

.file-remove {
    color: var(--danger-color);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 18px;
    padding: 5px;
}

.preview-comparison {
    margin: 30px 0;
}

.preview-comparison h3 {
    margin-bottom: 15px;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.image-box {
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 15px;
    background-color: #fafafa;
}

.image-box h4 {
    margin-bottom: 10px;
    text-align: center;
}

.image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    margin-bottom: 10px;
    overflow: hidden;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-stats {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.original .image-stats {
    color: var(--dark-color);
    font-weight: 500;
}

.compressed .image-stats {
    color: var(--success-color);
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

#clearBtn {
    background-color: var(--light-color);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

#clearBtn:hover {
    background-color: var(--danger-color);
    color: white;
}

#downloadAllBtn {
    background-color: var(--success-color);
}

#downloadAllBtn:hover {
    background-color: #007e33;
}

.progress-container {
    margin-top: 25px;
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
    height: 30px;
    position: relative;
}

.progress-bar {
    background-color: var(--accent-color);
    border-radius: var(--border-radius);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.savings-summary {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.savings-summary h3 {
    margin-bottom: 15px;
    text-align: center;
}

.savings-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.savings-item {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
}

.savings-label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.savings-value {
    font-weight: bold;
}

.highlight {
    background-color: rgba(0, 200, 81, 0.1);
    border: 1px solid var(--success-color);
}

.highlight .savings-value {
    color: var(--success-color);
}

@media (max-width: 768px) {
    .options {
        grid-template-columns: 1fr;
    }
    
    .comparison-container {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .file-name {
        max-width: 150px;
    }
}