/* Modern Image Compressor Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 300;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 500;
}

/* File Upload Styles */
.file-upload {
    text-align: center;
}

#files {
    display: none;
}

.file-label {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1.1em;
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.file-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.folder-help {
    margin-top: 10px;
    font-size: 0.9em;
    color: #7f8c8d;
    text-align: center;
    font-style: italic;
}

.file-list {
    margin-top: 15px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px;
    background: #fafbfc;
    display: none;
}

.folder-info {
    background: #e8f4fd;
    border: 1px solid #3498db;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.95em;
    color: #2c3e50;
}

.file-item {
    padding: 8px 0;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Processing Mode */
.processing-mode {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-option {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
}

.radio-option small {
    color: #7f8c8d;
    font-size: 0.85em;
    margin-top: 2px;
}

.local-notice {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #2e7d32;
    display: none;
}

.local-notice strong {
    color: #1b5e20;
}

/* Quality Control */
.quality-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quality-control label {
    font-weight: 500;
    min-width: 120px;
}

#quality {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e1e8ed;
    outline: none;
    -webkit-appearance: none;
}

#quality::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

#qualityValue {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
}

/* Resize Options */
.resize-options {
    space-y: 15px;
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.resize-controls {
    margin-left: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.resize-mode {
    margin-bottom: 15px;
}

.percentage-control, .preset-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 25px;
}

.percentage-control input, .custom-size input {
    width: 80px;
    padding: 8px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    text-align: center;
}

.preset-control select {
    min-width: 200px;
    padding: 8px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    background: white;
}

.custom-size {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(86, 171, 47, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-info:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Progress Section */
.progress-section {
    border-left: 4px solid #667eea;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e1e8ed;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

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

#progressText {
    font-weight: 500;
    color: #2c3e50;
}

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

.stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Analysis Section */
.analysis-section {
    border-left: 4px solid #3498db;
}

.analysis-summary {
    background: #e3f2fd;
    border: 1px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.analysis-stat {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.analysis-value {
    font-size: 1.3em;
    font-weight: 600;
    color: #3498db;
}

.analysis-label {
    font-size: 0.9em;
    color: #7f8c8d;
}

.analysis-details {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: #fafbfc;
}

.analysis-item {
    padding: 15px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analysis-item:last-child {
    border-bottom: none;
}

.analysis-file-info {
    flex: 1;
}

.analysis-filename {
    font-weight: 500;
    margin-bottom: 5px;
}

.analysis-file-details {
    font-size: 0.9em;
    color: #7f8c8d;
}

.analysis-savings {
    text-align: right;
    font-weight: 600;
    color: #3498db;
}

/* Results Section */
.results-section {
    border-left: 4px solid #27ae60;
}

.summary {
    background: #d5f4e6;
    border: 1px solid #27ae60;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.download-section {
    text-align: center;
    margin-bottom: 20px;
}

.detailed-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: #fafbfc;
}

.result-item {
    padding: 15px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:last-child {
    border-bottom: none;
}

.result-success {
    border-left: 4px solid #27ae60;
}

.result-error {
    border-left: 4px solid #e74c3c;
}

.result-info {
    flex: 1;
}

.result-filename {
    font-weight: 500;
    margin-bottom: 5px;
}

.result-details {
    font-size: 0.9em;
    color: #7f8c8d;
}

.result-savings {
    text-align: right;
    font-weight: 600;
    color: #27ae60;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .section {
        padding: 20px;
    }
    
    .quality-control {
        flex-direction: column;
        align-items: stretch;
    }
    
    .percentage-control, .preset-control {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .custom-size {
        justify-content: center;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}