:root {
            --primary-color: #6c5ce7;
            --primary-dark: #5649c0;
            --accent-color: #00cec9;
            --dark-color: #2d3436;
            --light-color: #f8f9fa;
            --success-color: #00b894;
            --warning-color: #fdcb6e;
            --danger-color: #d63031;
            --gray-color: #636e72;
            --light-gray: #dfe6e9;
            
            /* Light mode colors */
            --bg-color: #f5f6fa;
            --card-bg: white;
            --text-color: #2d3436;
            --border-color: #dfe6e9;
            --shadow-color: rgba(0, 0, 0, 0.08);
        }
        
        .dark-mode {
            --bg-color: #1a1a2e;
            --card-bg: #16213e;
            --text-color: #f8f9fa;
            --border-color: #2d3436;
            --shadow-color: rgba(0, 0, 0, 0.3);
            --dark-color: #f8f9fa;
            --light-gray: #2d3436;
            --gray-color: #b2bec3;
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.6;
            transition: background-color 0.3s ease, color 0.3s ease;
        }
        
        .app-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 30px;
        }
        
        .header {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .header h1 {
            font-size: 2.5rem;
            color: var(--primary-color);
            margin-bottom: 10px;
            font-weight: 700;
        }
        
        .header p {
            color: var(--gray-color);
            font-size: 1.1rem;
            max-width: 700px;
            margin: 0 auto;
        }
        
        .tool-container {
            background: var(--card-bg);
            border-radius: 16px;
            padding: 40px;
            box-shadow: 0 15px 40px var(--shadow-color);
            margin-bottom: 40px;
            position: relative;
            overflow: hidden;
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
        }
        
        .tool-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 8px;
            background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
        }
        
        .upload-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 50px 20px;
            border: 3px dashed var(--border-color);
            border-radius: 12px;
            transition: all 0.3s ease;
            margin-bottom: 30px;
            cursor: pointer;
            position: relative;
            background: var(--bg-color);
        }
        
        .upload-section:hover {
            border-color: var(--primary-color);
            background: rgba(108, 92, 231, 0.03);
        }
        
        .upload-section.active {
            border-color: var(--success-color);
            background: rgba(0, 184, 148, 0.05);
        }
        
        .upload-icon {
            font-size: 60px;
            color: var(--primary-color);
            margin-bottom: 20px;
        }
        
        .upload-text h3 {
            font-size: 1.5rem;
            color: var(--text-color);
            margin-bottom: 10px;
        }
        
        .upload-text p {
            color: var(--gray-color);
            margin-bottom: 20px;
            font-size: 1rem;
        }
        
        .browse-btn {
            background: var(--primary-color);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .browse-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
        }
        
        .file-input {
            display: none;
        }
        
        .controls-section {
            margin-bottom: 30px;
        }
        
        .section-title {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.3rem;
            color: var(--text-color);
            margin-bottom: 20px;
            font-weight: 600;
        }
        
        .section-title i {
            color: var(--primary-color);
        }
        
        .format-options {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 25px;
        }
        
        .format-option {
            flex: 1;
            min-width: 120px;
            padding: 15px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-color);
            font-weight: 500;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
        }
        
        .format-option:hover {
            border-color: var(--primary-color);
            transform: translateY(-3px);
            box-shadow: 0 5px 15px var(--shadow-color);
        }
        
        .format-option.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
            box-shadow: 0 5px 15px rgba(108, 92, 231, 0.2);
        }
        
        .format-option.active .format-icon {
            color: white;
        }
        
        .format-icon {
            font-size: 24px;
            color: var(--primary-color);
        }
        
        .format-name {
            font-size: 0.95rem;
        }
        
        .advanced-options {
            background: var(--bg-color);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 25px;
            border: 1px solid var(--border-color);
        }
        
        .option-group {
            margin-bottom: 20px;
        }
        
        .option-group:last-child {
            margin-bottom: 0;
        }
        
        .option-label {
            display: block;
            margin-bottom: 10px;
            font-weight: 500;
            color: var(--text-color);
        }
        
        .slider-container {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .slider {
            flex: 1;
            -webkit-appearance: none;
            height: 8px;
            border-radius: 10px;
            background: var(--light-gray);
            outline: none;
        }
        
        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--primary-color);
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            transition: all 0.2s ease;
        }
        
        .slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
            background: var(--primary-dark);
        }
        
        .slider-value {
            width: 50px;
            text-align: center;
            font-weight: 600;
            color: var(--primary-color);
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 5px;
        }
        
        .checkbox-group {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .checkbox-label {
            cursor: pointer;
            user-select: none;
            color: var(--text-color);
        }
        
        .checkbox-input {
            width: 18px;
            height: 18px;
            accent-color: var(--primary-color);
            cursor: pointer;
        }
        
        .action-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 30px;
        }
        
        .action-btn {
            flex: 1;
            min-width: 180px;
            padding: 15px;
            border: none;
            border-radius: 10px;
            font-weight: 500;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            cursor: pointer;
        }
        
        .primary-btn {
            background: var(--primary-color);
            color: white;
        }
        
        .primary-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(108, 92, 231, 0.3);
        }
        
        .secondary-btn {
            background: var(--card-bg);
            color: var(--text-color);
            border: 2px solid var(--border-color);
        }
        
        .secondary-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            transform: translateY(-3px);
            box-shadow: 0 5px 15px var(--shadow-color);
        }
        
        .success-btn {
            background: var(--success-color);
            color: white;
        }
        
        .success-btn:hover {
            background: #00997a;
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3);
        }
        
        .danger-btn {
            background: var(--card-bg);
            color: var(--danger-color);
            border: 2px solid var(--border-color);
        }
        
        .danger-btn:hover {
            background: var(--bg-color);
            border-color: var(--danger-color);
            transform: translateY(-3px);
        }
        
        .results-section {
            display: none;
            margin-top: 30px;
        }
        
        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .results-title {
            font-size: 1.3rem;
            color: var(--text-color);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .results-actions {
            display: flex;
            gap: 10px;
        }
        
        .image-grid {
            display: grid;
            gap: 20px;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        }
        
        .image-card {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 5px 15px var(--shadow-color);
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
            background: var(--card-bg);
        }
        
        .image-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px var(--shadow-color);
        }
        
        .image-preview {
            width: 100%;
            height: 200px;
            object-fit: contain;
            background: var(--bg-color);
            border-bottom: 1px solid var(--border-color);
        }
        
        .image-details {
            padding: 20px;
        }
        
        .image-name {
            font-weight: 500;
            color: var(--text-color);
            margin-bottom: 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .image-meta {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            font-size: 0.9rem;
        }
        
        .image-size {
            color: var(--gray-color);
        }
        
        .image-dimensions {
            color: var(--gray-color);
        }
        
        .compression-info {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
            margin-bottom: 15px;
        }
        
        .compression-ratio {
            font-weight: 600;
        }
        
        .ratio-up {
            color: var(--danger-color);
        }
        
        .ratio-down {
            color: var(--success-color);
        }
        
        .download-btn {
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: 8px;
            background: var(--primary-color);
            color: white;
            font-weight: 500;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
        }
        
        .download-btn:hover {
            background: var(--primary-dark);
        }
        
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            display: none;
        }
        
        .spinner {
            width: 60px;
            height: 60px;
            border: 5px solid rgba(255, 255, 255, 0.2);
            border-top: 5px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .loading-text {
            font-size: 1.2rem;
            color: white;
            margin-bottom: 20px;
        }
        
        .progress-container {
            width: 80%;
            max-width: 400px;
            height: 10px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 20px;
        }
        
        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
            border-radius: 10px;
            transition: width 0.3s ease;
            width: 0%;
        }
        
        .features-section {
            margin-top: 60px;
        }
        
        .features-title {
            text-align: center;
            font-size: 1.8rem;
            color: var(--text-color);
            margin-bottom: 40px;
            font-weight: 600;
        }
        
        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 25px;
        }
        
        .feature-card {
            background: var(--card-bg);
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 5px 20px var(--shadow-color);
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
            text-align: center;
        }
        
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px var(--shadow-color);
        }
        
        .feature-icon {
            font-size: 40px;
            color: var(--primary-color);
            margin-bottom: 20px;
        }
        
        .feature-title {
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 15px;
            font-size: 1.2rem;
        }
        
        .feature-desc {
            color: var(--gray-color);
            font-size: 0.95rem;
        }
        
        .file-list {
            width: 100%;
            margin-bottom: 20px;
            display: none;
        }
        
        .file-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 15px;
            background: var(--card-bg);
            border-radius: 8px;
            margin-bottom: 8px;
            box-shadow: 0 2px 5px var(--shadow-color);
        }
        
        .file-info {
            display: flex;
            align-items: center;
            gap: 10px;
            overflow: hidden;
        }
        
        .file-icon {
            color: var(--primary-color);
            font-size: 20px;
            flex-shrink: 0;
        }
        
        .file-name {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: var(--text-color);
        }
        
        .file-size {
            color: var(--gray-color);
            font-size: 0.85rem;
            flex-shrink: 0;
        }
        
        .remove-file {
            color: var(--danger-color);
            cursor: pointer;
            margin-left: 15px;
            flex-shrink: 0;
        }
        
        .toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            padding: 15px 20px;
            background: var(--dark-color);
            color: white;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 1000;
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s ease;
        }
        
        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }
        
        .toast.success {
            background: var(--success-color);
        }
        
        .toast.error {
            background: var(--danger-color);
        }
        
        .toast.warning {
            background: var(--warning-color);
            color: var(--dark-color);
        }
        
        .theme-toggle {
            position: fixed;
            bottom: 30px;
            left: 30px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            z-index: 100;
            border: none;
            font-size: 1.2rem;
        }
        
        .theme-toggle:hover {
            background: var(--primary-dark);
            transform: translateY(-3px);
        }
        
        @media (max-width: 768px) {
            .app-container {
                padding: 20px;
            }
            
            .tool-container {
                padding: 25px;
            }
            
            .header h1 {
                font-size: 2rem;
            }
            
            .format-options {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .action-buttons {
                flex-direction: column;
            }
            
            .action-btn {
                width: 100%;
            }
            
            .image-grid {
                grid-template-columns: 1fr;
            }
            
            .theme-toggle {
                bottom: 20px;
                left: 20px;
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }
        }