        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', system-ui, sans-serif;
        }

        /* :root {
            --primary: #f72585;
            --primary-dark: #e11575;
            --secondary: #09b73d;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #6c757d;
            --gray-light: #e9ecef;
            --border: #dee2e6;
            --success: #28a745;
            --warning: #ffc107;
            --danger: #dc3545;
            --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        } */

        body {
            background-color: #f9fbff;
            color: var(--dark);
            line-height: 1.6;
        }

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

    
        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 1.5rem;
            font-weight: 700;
            text-decoration: none;
            color: white;
        }

        .logo i {
            font-size: 1.8rem;
            color: #ffd166;
        }

        .back-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: white;
            text-decoration: none;
            font-weight: 500;
            padding: 8px 16px;
            border-radius: 50px;
            background: rgba(255, 255, 255, 0.15);
            transition: var(--transition);
        }

        .back-btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateX(-3px);
        }

        /* Main Content */
        .page-header {
            text-align: center;
            padding: 3rem 0 2rem;
        }

        .page-header h2 {
            font-size: 2rem;
            margin-bottom: 1rem;
            background: black;
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .page-header p {
            color: var(--gray);
            max-width: 700px;
            margin: 0 auto;
            font-size: 1.1rem;
        }

        /* Upload Area */
        .upload-section {
            margin-bottom: 3rem;
        }

        .upload-area {
            background: white;
            border-radius: 16px;
            padding: 3rem 2rem;
            text-align: center;
            box-shadow: var(--card-shadow);
            border: 2px dashed var(--border);
            transition: var(--transition);
            cursor: pointer;
            position: relative;
        }

        .upload-area.dragover {
            background: rgba(247, 37, 133, 0.05);
            border-color: var(--primary);
            border-style: solid;
        }

        .upload-icon {
            font-size: 4rem;
            color: var(--primary);
            margin-bottom: 1.5rem;
        }

        .upload-area h3 {
            font-size: 1.8rem;
            margin-bottom: 1rem;
            color: var(--dark);
        }

        .upload-area p {
            color: var(--gray);
            margin-bottom: 1.5rem;
        }

        .upload-btn {
            display: inline-block;
            padding: 14px 30px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 50px;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: 0 4px 15px rgba(247, 37, 133, 0.2);
        }

        .upload-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(247, 37, 133, 0.3);
        }

        .upload-btn i {
            margin-right: 8px;
        }

        .file-input {
            display: none;
        }

        .file-info {
            margin-top: 1.5rem;
            padding: 1rem;
            background: var(--gray-light);
            border-radius: 10px;
            display: none;
        }

        .file-info.active {
            display: block;
        }

        .file-name {
            font-weight: 600;
            color: var(--dark);
        }

        .file-size {
            color: var(--gray);
            font-size: 0.9rem;
        }

        /* Compression Controls */
        .controls-section {
            background: white;
            border-radius: 16px;
            padding: 2.5rem;
            box-shadow: var(--card-shadow);
            margin-bottom: 3rem;
        }

        .controls-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .controls-header h2 {
            font-size: 1.8rem;
            color: var(--dark);
        }

        .preset-buttons {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .preset-btn {
            padding: 10px 20px;
            background: var(--gray-light);
            border: none;
            border-radius: 50px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
        }

        .preset-btn:hover {
            background: #d8dde2;
        }

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

        .control-group {
            margin-bottom: 2rem;
        }

        .control-group h3 {
            font-size: 1.2rem;
            margin-bottom: 1rem;
            color: var(--dark);
        }

        .slider-container {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex-wrap: wrap;
        }

        .slider-value {
            min-width: 60px;
            text-align: center;
            font-weight: 600;
            color: var(--primary);
            font-size: 1.2rem;
        }

        .slider {
            flex: 1;
            /* -webkit-appearance: none; */
            height: 8px;
            border-radius: 5px;
            background: var(--gray-light);
            outline: none;
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            transition: var(--transition);
        }

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

        .quality-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            color: var(--gray);
            font-size: 0.9rem;
        }

        .format-options {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
        }

        .format-option {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }

        .format-radio {
            display: none;
        }

        .format-label {
            padding: 12px 20px;
            background: var(--gray-light);
            border-radius: 10px;
            font-weight: 500;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .format-radio:checked + .format-label {
            background: var(--primary);
            color: white;
        }

        .compress-btn {
            width: 100%;
            padding: 18px;
            background: var(--secondary);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1.2rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-top: 1rem;
        }

        .compress-btn:hover {
            background: #08a336;
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(9, 183, 61, 0.3);
        }

        .compress-btn:disabled {
            background: var(--gray);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* Results Section */
        .results-section {
            display: none;
            margin-bottom: 3rem;
        }

        .results-section.active {
            display: block;
            animation: fadeIn 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .results-header h2 {
            font-size: 1.8rem;
            color: var(--dark);
        }

        .results-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
        }

        @media (max-width: 768px) {
            .results-grid {
                grid-template-columns: 1fr;
            }
        }

        .image-card {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
        }

        .image-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .image-header h3 {
            font-size: 1.3rem;
            color: var(--dark);
        }

        .image-size {
            color: var(--gray);
            font-weight: 500;
        }

        .image-preview {
            padding: 1.5rem;
            text-align: center;
            min-height: 300px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .image-preview img {
            max-width: 100%;
            max-height: 250px;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .image-placeholder {
            color: var(--gray);
            font-size: 1.1rem;
        }

        .stats-card {
            grid-column: 1 / -1;
            background: white;
            border-radius: 16px;
            padding: 2rem;
            box-shadow: var(--card-shadow);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
        }

        .stat-item {
            text-align: center;
            padding: 1.5rem;
            border-radius: 12px;
            background: var(--gray-light);
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .stat-label {
            color: var(--gray);
            font-size: 0.9rem;
        }

        .download-btn {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 14px 30px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 50px;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            box-shadow: 0 4px 15px rgba(247, 37, 133, 0.2);
        }

        .download-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(247, 37, 133, 0.3);
        }

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

        /* Loading Overlay */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.9);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            flex-direction: column;
        }

        .loading-overlay.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        .spinner {
            width: 60px;
            height: 60px;
            border: 5px solid var(--gray-light);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1.5rem;
        }

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

        .loading-text {
            font-size: 1.2rem;
            color: var(--dark);
            font-weight: 500;
        }


        /* Responsive */
        @media (max-width: 768px) {
            .page-header h1 {
                font-size: 2.2rem;
            }
            
            .controls-section, .upload-area {
                padding: 1.5rem;
            }
            
            .slider-container {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
            
            .slider {
                width: 100%;
            }
            
            .preset-buttons {
                justify-content: center;
            }
        }



        /* Multiple files upload info */
.multi-file-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 10px;
    display: none;
}

.multi-file-info.active {
    display: block;
}

.file-list {
    list-style: none;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

/* Batch controls */
.batch-controls {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.batch-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.batch-checkbox label {
    font-weight: 500;
    cursor: pointer;
}

.batch-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--gray);
    font-weight: 500;
}

/* Results container */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-3px);
}

.result-item.selected {
    border: 2px solid var(--primary);
}

.result-checkbox {
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 2;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.result-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.result-header h4 {
    font-size: 1rem;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 30px;
}

.result-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    padding-top: 2rem;
}

.result-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: var(--gray-light);
    border-top: 1px solid var(--border);
}

.stat-compact {
    text-align: center;
}

.stat-compact .value {
    font-weight: 600;
    color: var(--primary);
    display: block;
}

.stat-compact .label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Individual download button */
.individual-download {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.individual-download:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* File size indicator */
.file-size-indicator {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 4px;
}

.original-size {
    text-decoration: line-through;
    opacity: 0.7;
}

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


/* Batch Upload Section */
.batch-upload {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--card-shadow);
    border: 2px solid var(--border);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.batch-header h4 {
    font-size: 1.2rem;
    color: var(--dark);
    margin: 0;
}

.batch-header h4 span {
    color: var(--primary);
    font-weight: 700;
}

.batch-actions {
    display: flex;
    gap: 1rem;
}

.batch-action-btn {
    padding: 8px 16px;
    background: var(--gray-light);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.batch-action-btn:hover {
    background: #d8dde2;
    transform: translateY(-2px);
}

#clearAllBtn {
    background: #ffeaea;
    color: #dc3546;
}

#clearAllBtn:hover {
    background: #ffd6d6;
}

#addMoreBtn {
    background: #e8f5e9;
    color: var(--success);
}

#addMoreBtn:hover {
    background: #d4edd8;
}

.batch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.batch-item {
    background: var(--gray-light);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    border: 2px solid transparent;
}

.batch-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.batch-item.selected {
    border-color: var(--primary);
    background: rgba(247, 37, 133, 0.05);
}

.batch-item-preview {
    height: 120px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.batch-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.batch-item:hover .batch-item-preview img {
    transform: scale(1.05);
}

.batch-item-info {
    padding: 12px;
}

.batch-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--dark);
}

.batch-item-size {
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.batch-item-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.batch-item-status .format {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.batch-item-status .index {
    color: var(--gray);
    font-weight: 500;
}

.batch-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 70, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.batch-item:hover .batch-item-remove {
    opacity: 1;
}

.batch-item-remove:hover {
    background: #dc3546;
    transform: scale(1.1);
}

.batch-item-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    z-index: 2;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.batch-item:hover .batch-item-checkbox {
    opacity: 1;
}

.batch-item.selected .batch-item-checkbox {
    opacity: 1;
}

/* Empty batch state */
.batch-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.batch-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-light);
}

/* Scrollbar styling */
.batch-list::-webkit-scrollbar {
    width: 8px;
}

.batch-list::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

.batch-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.batch-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .batch-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .batch-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .batch-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}


/* Status Badges */
.status-badge {
    position: absolute;
    top: 75px;
    right: 210px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: badgePulse 2s infinite;
}

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

.status-badge-optimized {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 2px solid #198754;
}

.status-badge-small {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
    color: white;
    border: 2px solid #495057;
    /* right: 140px; */
}

.status-badge-increased {
    background: linear-gradient(135deg, #dc3545, #e35d6a);
    color: white;
    border: 2px solid #bb2d3b;
    /* right: 140px; */
}

.status-badge-transparency {
    background: linear-gradient(135deg, #0dcaf0, #31d2f2);
    color: white;
    border: 2px solid #0aa2c0;
    /* right: 140px; */
}

.status-badge-excellent {
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
    border: 2px solid #146c43;
    /* right: 140px; */
}

.status-badge-good {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    color: #212529;
    border: 2px solid #cc9a06;
    /* right: 140px; */
}

.status-badge-moderate {
    background: linear-gradient(135deg, #fd7e14, #fd9843);
    color: white;
    border: 2px solid #ca6510;
}

/* Small file badge in batch preview */
.batch-item-small-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 1;
}

/* Updated file size indicators */
.file-size-indicator {
    font-size: 0.8rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
}

.file-size-indicator i {
    font-size: 0.7rem;
}

.original-size {
    background: rgba(247, 37, 133, 0.1);
    color: var(--primary);
    border: 1px solid rgba(247, 37, 133, 0.2);
}

.compressed-size {
    background: rgba(9, 183, 61, 0.1);
    color: var(--success);
    border: 1px solid rgba(9, 183, 61, 0.2);
}

/* For files that increased in size */
.increased-size {
    background: rgba(220, 53, 70, 0.1);
    color: var(--danger);
    border: 1px solid rgba(220, 53, 70, 0.2);
}

/* Optimization tooltip */
.optimization-tooltip {
    position: relative;
    cursor: help;
}

.optimization-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Updated result item for optimization status */
.result-item.optimized {
    border: 2px solid #28a745;
    background: linear-gradient(145deg, rgba(40, 167, 69, 0.03), rgba(40, 167, 69, 0.01));
}

.result-item.no-compression {
    border: 2px solid #ffc107;
    background: linear-gradient(145deg, rgba(255, 193, 7, 0.03), rgba(255, 193, 7, 0.01));
}

.result-item.increased {
    border: 2px solid #dc3545;
    background: linear-gradient(145deg, rgba(220, 53, 70, 0.03), rgba(220, 53, 70, 0.01));
}