:root {
    --primary-color: #5e72e4;
    --primary-hover: #4c63d2;
    --success-color: #2dce89;
    --success-hover: #26b877;
    --secondary-color: #8898aa;
    --danger-color: #f5365c;
    --background: #f8f9fe;
    --surface: #ffffff;
    --text-primary: #32325d;
    --text-secondary: #8898aa;
    --border-color: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(50, 50, 93, 0.15), 0 1px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
.header {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    color: var(--primary-color);
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

/* Main */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.drop-zone {
    background: var(--surface);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(94, 114, 228, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
}

.drop-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.drop-subtext {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* File List */
.file-list {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.file-item:hover {
    background: var(--background);
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 1rem;
}

.file-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    line-height: 1;
}

.file-remove:hover {
    transform: scale(1.1);
    background: #f03a5f;
}

/* Settings Section */
.settings-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.settings-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.setting-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.quality-control {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quality-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.quality-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
}

.resize-inputs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.resize-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #7889a0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.125rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Progress Section */
.progress-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 2rem;
}

.progress-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #667eea 100%);
    transition: width 0.3s;
    width: 0;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Results Section */
.results-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.results-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.image-card {
    background: var(--background);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-info {
    padding: 1rem;
}

.image-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-dimensions,
.image-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.image-card .btn {
    width: calc(100% - 2rem);
    margin: 0 1rem 1rem;
}

/* Footer */
.footer {
    background: var(--surface);
    padding: 2rem 0;
    margin-top: auto;
    box-shadow: 0 -1px 3px rgba(50, 50, 93, 0.15);
}

.footer p {
    text-align: center;
    color: var(--text-secondary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .results-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons,
    .download-buttons {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
    }
}