/* Image Compressor - imgcompress.org */
/* Light mode (default) */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Dark mode */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.sun-icon, .moon-icon {
    font-size: 1.5rem;
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

.drop-zone p {
    margin: 5px 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.drop-hint {
    color: var(--text-secondary) !important;
    font-size: 0.95rem !important;
}

.supported-formats {
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    margin-top: 10px !important;
}

/* Controls Section */
.controls-section {
    display: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    gap: 20px;
}

.controls-section {
    display: none;
}

.controls-section[style*="block"] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.quality-hints {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.control-group select,
.control-group input[type="number"] {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Results Section */
.results-section {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.image-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.image-preview {
    height: 180px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-info {
    padding: 15px;
}

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

.size-comparison {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.original-size {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.85rem;
}

.arrow {
    color: var(--text-muted);
}

.compressed-size {
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.savings {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.savings.positive {
    color: var(--success-color);
}

.savings.negative {
    color: var(--error-color);
}

.dimensions {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.image-actions {
    display: flex;
    gap: 10px;
    padding: 0 15px 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.download-all {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
}

/* Trust Badges */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 50px 0;
}

.badge {
    text-align: center;
    padding: 25px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.badge-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.badge-text {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.badge-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* How It Works */
.how-it-works {
    margin: 50px 0;
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
    padding: 25px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 15px;
}

.step h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* FAQ Section */
.faq-section {
    margin: 50px 0;
}

.faq-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.faq-item {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.faq-item h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .drop-zone {
        padding: 40px 20px;
    }
    
    .drop-icon {
        font-size: 3rem;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .trust-badges {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .trust-badges {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
}
