:root {
    --primary-color: #4a6bff;
    --secondary-color: #f5f7ff;
    --text-color: #333;
    --light-text: #666;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7ff;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

header h1 i {
    margin-right: 10px;
}

header p {
    color: var(--light-text);
    font-size: 1.1rem;
}

.upload-area {
    background-color: white;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.upload-area.highlight {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area h2 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.upload-area p {
    color: var(--light-text);
    margin: 10px 0;
}

.upload-area .formats {
    font-size: 0.9rem;
    color: #999;
}

#fileInput {
    display: none;
}

.browse-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.browse-btn:hover {
    background-color: #3a56d4;
}

.settings {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #eee;
    border-radius: 4px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    font-size: 1rem;
}

#compressBtn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

#compressBtn:hover {
    background-color: #3a56d4;
}


.results {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.results h2 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.result-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.result-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 10px;
}

.result-info {
    margin-top: auto;
}

.result-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--light-text);
}

.result-info .file-size {
    color: var(--primary-color);
    font-weight: 600;
}

.download-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
    text-align: center;
    text-decoration: none;
}

.download-btn:hover {
    background-color: #3a56d4;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--light-text);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

.download-all {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
    text-align: center;
}

.download-all:hover {
    background-color: #218838;
}


footer {
    text-align: center;
    padding: 20px;
    color: var(--light-text);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive styles */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .settings {
        padding: 15px;
    }
}