/* Ultimate Image Compressor Pro - Modern Clean Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

.uic-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Header */
.uic-header {
    text-align: center;
    margin-bottom: 40px;
}

.uic-icon-badge {
    font-size: 48px;
    margin-bottom: 15px;
}

.uic-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.uic-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* Upload Area */
.uic-upload-area {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 24px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.uic-upload-area:hover,
.uic-upload-area.dragover {
    border-color: #6366f1;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.uic-upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.uic-upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 10px;
}

.uic-upload-or {
    color: #94a3b8;
    margin: 15px 0;
}

.uic-browse-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.uic-browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.uic-supported {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Image Preview */
.uic-image-preview {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.uic-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.uic-remove-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #ef4444;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.uic-remove-btn:hover {
    background: #fef2f2;
}

.uic-preview-container {
    text-align: center;
}

.uic-preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.uic-preview-info {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #475569;
}

/* Settings Panel */
.uic-settings-panel {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.uic-basic-settings {
    margin-bottom: 20px;
}

.uic-setting-row {
    margin-bottom: 20px;
}

.uic-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e293b;
    font-size: 0.9rem;
}

.uic-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.uic-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Quality Slider */
.uic-quality-wrapper {
    padding: 10px 0;
}

.uic-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.uic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    border: 2px solid white;
}

.uic-quality-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #64748b;
}

.uic-estimated {
    color: #10b981;
    font-weight: 600;
}

/* Advanced Toggle */
.uic-advanced-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    font-weight: 600;
    color: #475569;
}

.uic-advanced-toggle:hover {
    color: #6366f1;
}

.uic-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

/* Advanced Settings */
.uic-advanced-settings {
    margin-bottom: 25px;
}

.uic-resize-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 16px;
}

.uic-dimension-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.uic-dimension-input {
    flex: 1;
}

.uic-dimension-input label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 5px;
}

.uic-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
}

.uic-input:focus {
    outline: none;
    border-color: #6366f1;
}

.uic-lock-btn {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.uic-lock-btn:hover {
    border-color: #6366f1;
    background: #f0f4ff;
}

/* Checkbox */
.uic-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
}

.uic-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Compress Button */
.uic-compress-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.uic-compress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* Progress Section */
.uic-progress-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.uic-progress-wrapper {
    max-width: 300px;
    margin: 0 auto;
}

.uic-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.uic-progress-text {
    color: #475569;
    margin-bottom: 15px;
}

.uic-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.uic-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Results Section */
.uic-results-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.uic-success-badge {
    font-size: 48px;
    margin-bottom: 15px;
    animation: bounce 0.5s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.uic-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 10px;
}

.uic-success-message {
    color: #475569;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Before/After Comparison */
.uic-comparison-container {
    margin-bottom: 30px;
}

.uic-comparison-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
    color: #475569;
}

.uic-before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
}

.uic-before-image,
.uic-after-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
}

.uic-before-image img,
.uic-after-image img {
    width: 100%;
    height: auto;
    display: block;
}

.uic-image-stats {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    text-align: center;
    backdrop-filter: blur(5px);
}

/* Saving Stats */
.uic-saving-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.uic-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 16px;
    text-align: left;
}

.uic-stat-icon {
    font-size: 28px;
}

.uic-stat-content {
    flex: 1;
}

.uic-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

.uic-stat-label {
    font-size: 0.75rem;
    color: #64748b;
}

/* Result Actions */
.uic-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.uic-download-btn,
.uic-new-btn {
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.uic-download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.uic-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.uic-new-btn {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.uic-new-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

/* Error Section */
.uic-error-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.uic-error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.uic-error-section h4 {
    color: #ef4444;
    margin-bottom: 10px;
}

.uic-error-message {
    color: #475569;
    margin-bottom: 20px;
}

.uic-retry-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .uic-container {
        padding: 20px 15px;
    }
    
    .uic-title {
        font-size: 1.6rem;
    }
    
    .uic-upload-area {
        padding: 40px 20px;
    }
    
    .uic-before-after {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .uic-saving-stats {
        grid-template-columns: 1fr;
    }
    
    .uic-dimension-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .uic-lock-btn {
        align-self: center;
    }
    
    .uic-result-actions {
        flex-direction: column;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .uic-image-preview,
    .uic-settings-panel,
    .uic-progress-section,
    .uic-results-section,
    .uic-error-section {
        background: #1e293b;
        border-color: #334155;
    }
    
    .uic-upload-area {
        background: #0f172a;
        border-color: #334155;
    }
    
    .uic-upload-text,
    .uic-label,
    .uic-stat-value {
        color: #f1f5f9;
    }
    
    .uic-preview-info,
    .uic-resize-controls,
    .uic-stat-card {
        background: #0f172a;
    }
    
    .uic-select,
    .uic-input {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .uic-new-btn {
        background: #1e293b;
        border-color: #334155;
        color: #94a3b8;
    }
}