 /* JPG Compressor Tool Styles */

 /* Upload Page Styles */
 .upload-container {
     background-color: transparent;
     border-radius: 0px;
     overflow: hidden;
     margin-bottom: 0px;
     transition: all 0.3s ease;
     border: none;
 }

 .upload-area {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     min-height: 300px;
     position: relative;
     background: transparent;
 }

 .upload-content {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     text-align: center;
     width: 100%;
     max-width: 1000px;
     transition: all 0.3s ease;
     padding: 20px 20px;
     border-radius: 2px;
     background-color: transparent;
     border: 2px dashed #d0d0d0;
     opacity: 1;
     cursor: pointer;
     position: relative;
     overflow: hidden;
 }

 .upload-content:hover {
     border: 2px dashed #7953db;
     box-shadow: 0 0 10px rgba(121, 83, 219, 0.1);
 }

 .upload-icon {
     font-size: 24px;
     color: white;
     margin-bottom: 25px;
     transition: transform 0.3s ease, color 0.3s ease;
     background-color: #7953db;
     width: 80px;
     height: 80px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .upload-icon i {
     font-size: 32px;
 }

 .upload-content:hover .upload-icon {
     transform: translateY(-5px);
 }

 .upload-content h3 {
     font-size: 24px;
     font-weight: 600;
     margin-bottom: 12px;
     color: var(--text-color);
 }

 .upload-content p {
     font-size: 16px;
     color: var(--tool-description-color);
     margin-bottom: 25px;
 }

 .upload-info {
     display: none;
 }

 /* Format tags */
 .format-tags {
     display: flex;
     gap: 10px;
     margin-top: 30px;
     justify-content: center;
 }

 .format-tag {
     background-color: transparent;
     color: #666;
     padding: 5px 15px;
     border-radius: 20px;
     font-size: 14px;
     font-weight: 500;
     border: 1px solid #eee;
 }

 [data-theme="dark"] .format-tag {
     background-color: transparent;
     color: #aaa;
     border: 1px solid #333;
 }

 .file-input {
     position: absolute;
     width: 100%;
     height: 100%;
     top: 0;
     left: 0;
     opacity: 0;
     cursor: pointer;
     z-index: 2;
 }

 .upload-button {
     background-color: #7953db;
     color: white;
     border: none;
     border-radius: 6px;
     padding: 12px 28px;
     font-size: 16px;
     font-weight: 500;
     cursor: pointer;
     transition: background-color 0.2s ease;
 }

 .upload-button:hover {
     background-color: #6a44cc;
 }

 /* Upload Preview Styles */
 .upload-preview {
     display: none;
     width: 100%;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     transition: opacity 0.3s ease;
     opacity: 1;
     text-align: center;
     padding: 20px;
 }

 .preview-container {
     width: 100%;
     max-width: 450px;
     height: 280px;
     border-radius: 10px;
     overflow: hidden;
     margin: 0 auto 25px auto;
     background-color: transparent;
     display: flex;
     align-items: center;
     justify-content: center;
     position: relative;
     border: 1px solid #eee;
 }

 .preview-container::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: linear-gradient(135deg, rgba(121, 83, 219, 0.05) 0%, rgba(121, 83, 219, 0.05) 100%);
     z-index: 0;
 }

 .preview-container img {
     max-width: 100%;
     max-height: 100%;
     object-fit: contain;
     position: relative;
     z-index: 1;
 }

 .preview-info {
     width: 100%;
     max-width: 450px;
     display: flex;
     flex-direction: column;
     gap: 18px;
     background-color: transparent;
     padding: 20px;
     border-radius: 10px;
     margin: 0 auto;
     text-align: center;
 }

 .file-details {
     display: flex;
     justify-content: center;
     align-items: center;
     gap: 20px;
     padding-bottom: 15px;
     border-bottom: 1px solid var(--card-border);
     flex-wrap: wrap;
 }

 .file-name {
     font-size: 17px;
     font-weight: 500;
     color: var(--text-color);
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     max-width: 70%;
 }

 .file-size {
     font-size: 15px;
     color: var(--tool-description-color);
     background-color: rgba(121, 83, 219, 0.1);
     padding: 4px 10px;
     border-radius: 15px;
     font-weight: 500;
 }

 .preview-actions {
     display: flex;
     justify-content: center;
     gap: 15px;
     margin-top: 5px;
     flex-wrap: wrap;
 }

 .preview-actions button {
     flex: 1;
     max-width: 200px;
     min-width: 120px;
     padding: 12px 20px;
     border-radius: 30px;
     font-weight: 500;
     transition: all 0.3s ease;
 }

 .preview-actions .secondary-btn {
     background-color: transparent;
     border: 1px solid var(--card-border);
     color: var(--text-color);
 }

 .preview-actions .secondary-btn:hover {
     background-color: rgba(0, 0, 0, 0.05);
 }

 .preview-actions .primary-btn {
     background-color: #7953db;
     color: white;
     border: none;
 }

 .preview-actions .primary-btn:hover {
     background-color: #6a44cc;
 }

 /* Compressor Page Styles */
 .cropper-container {
     background-color: var(--card-bg);
     border-radius: 10px;
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
     overflow: hidden;
     margin-bottom: 30px;
     transition: all 0.3s ease;
 }

 /* Image Container Styles */
 .cropper-image-container {
     width: 100%;
     height: 450px;
     background: linear-gradient(135deg, var(--background-color) 0%, rgba(121, 83, 219, 0.03) 100%);
     border-radius: 16px;
     overflow: hidden;
     position: relative;
     margin-bottom: 25px;
     display: flex;
     align-items: center;
     justify-content: center;
     border: 2px solid var(--card-border);
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
     transition: all 0.3s ease;
 }

 .cropper-image-container:hover {
     box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
     transform: translateY(-2px);
 }

 .cropper-image-container img {
     max-width: 100%;
     max-height: 100%;
     display: block;
     border-radius: 8px;
 }

 .cropper-wrapper {
     display: flex;
     flex-wrap: nowrap;
     min-height: 600px;
     height: auto;
 }

 /* Left Panel - Image Preview */
 .preview-panel {
     flex: 1.2;
     min-width: 350px;
     padding: 30px;
     border-right: 1px solid var(--card-border);
     background: linear-gradient(135deg, var(--card-bg) 0%, rgba(121, 83, 219, 0.02) 100%);
     position: relative;
     overflow: visible;
     display: flex;
     flex-direction: column;
 }

 .preview-panel::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: radial-gradient(circle at top right, rgba(121, 83, 219, 0.05) 0%, transparent 50%);
     pointer-events: none;
 }

 .image-preview-container {
     width: 100%;
     height: 450px;
     background: linear-gradient(135deg, var(--background-color) 0%, rgba(121, 83, 219, 0.03) 100%);
     border-radius: 16px;
     overflow: hidden;
     position: relative;
     margin-bottom: 25px;
     display: flex;
     align-items: center;
     justify-content: center;
     border: 2px solid var(--card-border);
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
     transition: all 0.3s ease;
 }

 .image-preview-container:hover {
     box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
     transform: translateY(-2px);
 }

 .image-preview {
     width: 100%;
     height: 100%;
     position: relative;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .image-preview img {
     max-width: 100%;
     max-height: 100%;
     object-fit: contain;
     border-radius: 4px;
 }

 .image-label {
     position: absolute;
     top: 20px;
     left: 50%;
     transform: translateX(-50%);
     padding: 8px 16px;
     background: linear-gradient(135deg, rgba(121, 83, 219, 0.9), rgba(157, 109, 255, 0.9));
     color: white;
     font-size: 13px;
     font-weight: 600;
     border-radius: 20px;
     backdrop-filter: blur(10px);
     box-shadow: 0 4px 12px rgba(121, 83, 219, 0.3);
     letter-spacing: 0.5px;
     text-transform: uppercase;
     z-index: 10;
 }

 .image-info {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
     gap: 18px;
     margin-top: 25px;
     padding: 20px;
     background: linear-gradient(135deg, rgba(121, 83, 219, 0.02) 0%, rgba(157, 109, 255, 0.02) 100%);
     border-radius: 16px;
     border: 1px solid rgba(121, 83, 219, 0.1);
 }

 .info-item {
     background-color: var(--background-color);
     padding: 16px 20px;
     border-radius: 12px;
     display: flex;
     flex-direction: column;
     gap: 8px;
     border: 1px solid var(--card-border);
     transition: all 0.3s ease;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
 }

 .info-item:hover {
     transform: translateY(-2px);
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
 }

 .info-label {
     font-size: 13px;
     color: var(--tool-description-color);
     font-weight: 500;
     display: flex;
     align-items: center;
     gap: 6px;
 }

 .info-label i {
     font-size: 14px;
     opacity: 0.8;
 }

 .info-value {
     font-size: 18px;
     font-weight: 700;
     color: var(--text-color);
     letter-spacing: 0.5px;
 }

 .crop-badge {
     color: #2ecc71;
     background-color: rgba(46, 204, 113, 0.1);
     padding: 4px 8px;
     border-radius: 6px;
     font-size: 16px;
     display: inline-block;
     width: fit-content;
 }

 /* Right Panel - Compression Options */
 .options-panel {
     flex: 1;
     min-width: 320px;
     padding: 0;
     background-color: var(--card-bg);
     overflow-y: auto;
     overflow-x: hidden;
     height: 600px;
     max-height: calc(100vh - 200px);
     scrollbar-width: thin;
     scrollbar-color: rgba(121, 83, 219, 0.3) transparent;
 }

 .options-panel::-webkit-scrollbar {
     width: 6px;
 }

 .options-panel::-webkit-scrollbar-track {
     background: transparent;
 }

 .options-panel::-webkit-scrollbar-thumb {
     background-color: rgba(121, 83, 219, 0.3);
     border-radius: 3px;
     transition: background-color 0.2s ease;
 }

 .options-panel::-webkit-scrollbar-thumb:hover {
     background-color: rgba(121, 83, 219, 0.5);
 }

 /* Mobile scrollbar improvements */
 @media (max-width: 768px) {

     .options-panel::-webkit-scrollbar {
         width: 4px;
     }
     
     .options-panel::-webkit-scrollbar-thumb {
         background-color: rgba(121, 83, 219, 0.4);
         border-radius: 2px;
     }
     
     .options-panel::-webkit-scrollbar-track {
         background: rgba(0, 0, 0, 0.05);
         border-radius: 2px;
     }
 }

 .options-container {
     max-width: 100%;
     padding: 25px;
     min-height: 100%;
     padding-bottom: 50px;
 }

 .options-container h3 {
     font-size: 24px;
     font-weight: 700;
     margin-bottom: 8px;
     color: var(--text-color);
     letter-spacing: -0.5px;
 }

 .options-description {
     font-size: 14px;
     color: var(--tool-description-color);
     margin-bottom: 30px;
     line-height: 1.6;
     opacity: 0.9;
 }

 .option-group {
     margin-bottom: 25px;
     background-color: var(--background-color);
     padding: 20px;
     border-radius: 12px;
     border: 1px solid var(--card-border);
 }

 .option-group>label {
     display: block;
     font-size: 16px;
     font-weight: 600;
     margin-bottom: 15px;
     color: var(--text-color);
     letter-spacing: 0.2px;
 }

 /* Quality Control Styles */
 .quality-control {
     display: flex;
     align-items: center;
     gap: 15px;
     margin-bottom: 15px;
 }

 .quality-slider {
     flex: 1;
     height: 8px;
     border-radius: 5px;
     background: #ddd;
     outline: none;
     -webkit-appearance: none;
 }

 .quality-slider::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 20px;
     height: 20px;
     border-radius: 50%;
     background: #7953db;
     cursor: pointer;
     box-shadow: 0 2px 6px rgba(121, 83, 219, 0.3);
 }

 .quality-slider::-moz-range-thumb {
     width: 20px;
     height: 20px;
     border-radius: 50%;
     background: #7953db;
     cursor: pointer;
     border: none;
     box-shadow: 0 2px 6px rgba(121, 83, 219, 0.3);
 }

 .quality-display {
     background-color: var(--card-bg);
     padding: 8px 12px;
     border-radius: 8px;
     border: 2px solid var(--card-border);
     font-weight: 600;
     color: var(--text-color);
     min-width: 60px;
     text-align: center;
 }

 .quality-presets {
     display: flex;
     gap: 8px;
     flex-wrap: wrap;
 }

 .option-input {
     width: 100%;
     padding: 10px 15px;
     border: 1px solid var(--card-border);
     border-radius: 5px;
     font-size: 16px;
     color: var(--text-color);
     background-color: var(--background-color);
     transition: border-color 0.3s ease;
 }

 .option-input:focus {
     border-color: var(--tool-icon-color);
     outline: none;
 }

 .option-select {
     width: 100%;
     padding: 10px 15px;
     border: 1px solid var(--card-border);
     border-radius: 5px;
     font-size: 16px;
     color: var(--text-color);
     background-color: var(--background-color);
     transition: border-color 0.3s ease;
     appearance: none;
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
     background-repeat: no-repeat;
     background-position: right 10px center;
     background-size: 16px;
     padding-right: 35px;
 }

 .option-select:focus {
     border-color: var(--tool-icon-color);
     outline: none;
 }

 /* Download format specific styling */
 #downloadFormat {
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237953db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
 }

 /* Preset buttons for quick settings */
 .preset-btn {
     background-color: var(--card-bg);
     border: 1px solid var(--card-border);
     color: var(--text-color);
     padding: 8px 12px;
     border-radius: 4px;
     font-size: 12px;
     font-weight: 500;
     cursor: pointer;
     transition: background-color 0.2s ease;
     white-space: nowrap;
     text-align: center;
 }

 .preset-btn:hover {
     background-color: #7953db;
     color: white;
     border-color: #7953db;
 }

 .preset-btn.active {
     background-color: #7953db;
     color: white;
     border-color: #7953db;
     box-shadow: 0 2px 8px rgba(121, 83, 219, 0.3);
 }

 /* Enhanced Action Buttons Container */
 .action-buttons-container {
     margin-top: 30px;
 }

 .primary-action {
     margin-bottom: 20px;
 }

 .compress-btn,
 .download-btn {
     width: 100%;
     padding: 16px 24px;
     font-size: 16px;
     font-weight: 600;
     border-radius: 12px;
     transition: all 0.3s ease;
     box-shadow: 0 4px 12px rgba(121, 83, 219, 0.3);
 }

 .compress-btn:hover,
 .download-btn:hover {
     transform: translateY(-2px);
     box-shadow: 0 6px 20px rgba(121, 83, 219, 0.4);
 }

 .secondary-actions {
     display: flex;
     flex-direction: column;
     gap: 12px;
 }

 .action-row {
     display: flex;
     gap: 12px;
 }

 .action-row button {
     flex: 1;
     padding: 12px 16px;
     font-size: 14px;
     border-radius: 8px;
     transition: all 0.3s ease;
 }

 .action-row .secondary-btn:hover {
     transform: translateY(-1px);
     box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
 }

 /* Preview Modal Styles */
 .preview-modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     z-index: 10000;
     opacity: 0;
     visibility: hidden;
     transition: all 0.3s ease;
 }

 .preview-modal.show {
     opacity: 1;
     visibility: visible;
 }

 .preview-modal.fade-out {
     opacity: 0;
     visibility: hidden;
 }

 .preview-modal-overlay {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.8);
     backdrop-filter: blur(5px);
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 20px;
 }

 .preview-modal-content {
     background: var(--card-bg);
     border-radius: 16px;
     max-width: 90vw;
     max-height: 90vh;
     width: 1000px;
     display: flex;
     flex-direction: column;
     box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
     border: 1px solid var(--card-border);
     overflow: hidden;
     transform: scale(0.9);
     transition: transform 0.3s ease;
 }

 .preview-modal.show .preview-modal-content {
     transform: scale(1);
 }

 .preview-modal-header {
     padding: 20px 25px;
     border-bottom: 1px solid var(--card-border);
     display: flex;
     justify-content: space-between;
     align-items: center;
     background: linear-gradient(135deg, var(--card-bg) 0%, rgba(121, 83, 219, 0.05) 100%);
 }

 .preview-modal-header h3 {
     margin: 0;
     color: var(--text-color);
     font-size: 20px;
     font-weight: 600;
     display: flex;
     align-items: center;
     gap: 10px;
 }

 .preview-modal-header h3 i {
     color: #7953db;
 }

 .preview-modal-close {
     background: none;
     border: none;
     color: var(--tool-description-color);
     cursor: pointer;
     padding: 8px;
     border-radius: 6px;
     transition: all 0.2s ease;
     font-size: 18px;
 }

 .preview-modal-close:hover {
     background: rgba(0, 0, 0, 0.1);
     color: var(--text-color);
 }

 .preview-modal-body {
     display: flex;
     flex: 1;
     min-height: 0;
 }

 .preview-image-container {
     flex: 2;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 30px;
     background: linear-gradient(135deg, var(--background-color) 0%, rgba(121, 83, 219, 0.02) 100%);
 }

 .preview-modal-image {
     max-width: 100%;
     max-height: 100%;
     object-fit: contain;
     border-radius: 8px;
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
 }

 .preview-info-panel {
     flex: 1;
     padding: 30px;
     border-left: 1px solid var(--card-border);
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     background: var(--card-bg);
 }

 .preview-stats {
     display: flex;
     flex-direction: column;
     gap: 20px;
 }

 .preview-stat-item {
     display: flex;
     flex-direction: column;
     gap: 8px;
     padding: 16px;
     background: var(--background-color);
     border-radius: 12px;
     border: 1px solid var(--card-border);
 }

 .stat-label {
     font-size: 14px;
     color: var(--tool-description-color);
     font-weight: 500;
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .stat-label i {
     font-size: 16px;
     opacity: 0.8;
 }

 .stat-value {
     font-size: 18px;
     font-weight: 700;
     color: var(--text-color);
 }

 .stat-value.compressed {
     color: #2ecc71;
 }

 .stat-value.reduction {
     color: #e74c3c;
     background: rgba(231, 76, 60, 0.1);
     padding: 4px 8px;
     border-radius: 6px;
     display: inline-block;
     width: fit-content;
 }

 .preview-actions {
     display: flex;
     gap: 12px;
     margin-top: 30px;
 }

 .preview-btn {
     flex: 1;
     padding: 12px 16px;
     border-radius: 8px;
     font-weight: 500;
     font-size: 14px;
     cursor: pointer;
     border: none;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     transition: all 0.3s ease;
 }

 .preview-btn.primary {
     background-color: #7953db;
     color: white;
 }

 .preview-btn.primary:hover {
     background-color: #6a44cc;
     transform: translateY(-1px);
 }

 .preview-btn.secondary {
     background-color: transparent;
     border: 1px solid var(--card-border);
     color: var(--text-color);
 }

 .preview-btn.secondary:hover {
     background-color: var(--card-border);
     transform: translateY(-1px);
 }

 /* Multi-File Grid Styles */
 .multi-file-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 20px;
     background: linear-gradient(135deg, var(--card-bg) 0%, rgba(121, 83, 219, 0.05) 100%);
     border-radius: 12px;
     margin-bottom: 20px;
     border: 1px solid var(--card-border);
 }

 .file-counter {
     display: flex;
     align-items: center;
     gap: 10px;
     font-weight: 600;
     color: var(--text-color);
 }

 .file-counter i {
     color: #7953db;
     font-size: 18px;
 }

 .batch-actions {
     display: flex;
     gap: 10px;
 }

 .batch-btn {
     padding: 8px 16px;
     border-radius: 6px;
     font-weight: 500;
     font-size: 14px;
     cursor: pointer;
     border: none;
     display: flex;
     align-items: center;
     gap: 6px;
     transition: all 0.3s ease;
 }

 .batch-btn.primary {
     background-color: #7953db;
     color: white;
 }

 .batch-btn.primary:hover:not(:disabled) {
     background-color: #6a44cc;
     transform: translateY(-1px);
 }

 .batch-btn.secondary {
     background-color: transparent;
     border: 1px solid var(--card-border);
     color: var(--text-color);
 }

 .batch-btn.secondary:hover:not(:disabled) {
     background-color: var(--card-border);
     transform: translateY(-1px);
 }

 .batch-btn:disabled {
     opacity: 0.6;
     cursor: not-allowed;
 }

 /* Batch Progress Styles */
 .batch-progress {
     margin-top: 15px;
     padding: 15px;
     background: var(--background-color);
     border-radius: 8px;
     border: 1px solid var(--card-border);
 }

 .progress-bar {
     width: 100%;
     height: 8px;
     background-color: #e0e0e0;
     border-radius: 4px;
     overflow: hidden;
     margin-bottom: 8px;
 }

 .progress-fill {
     height: 100%;
     background: linear-gradient(90deg, #7953db, #9d6dff);
     width: 0%;
     transition: width 0.3s ease;
     border-radius: 4px;
 }

 .progress-text {
     font-size: 12px;
     color: var(--tool-description-color);
     text-align: center;
     font-weight: 500;
 }

 /* Images Grid Container */
 .images-grid-container {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
     gap: 20px;
     margin-bottom: 25px;
 }

 .image-grid-item {
     background: var(--background-color);
     border-radius: 12px;
     border: 2px solid var(--card-border);
     overflow: hidden;
     transition: all 0.3s ease;
     position: relative;
 }

 .image-grid-item:hover {
     transform: translateY(-2px);
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
 }

 .image-grid-item.compressed {
     border-color: rgba(46, 204, 113, 0.3);
 }

 .image-grid-item.processing {
     border-color: rgba(255, 193, 7, 0.5);
     animation: pulse 2s infinite;
 }

 .grid-image-container {
     position: relative;
     height: 200px;
     overflow: hidden;
     background: linear-gradient(135deg, var(--background-color) 0%, rgba(121, 83, 219, 0.03) 100%);
 }

 .grid-image-container img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     transition: transform 0.3s ease;
 }

 .image-grid-item:hover .grid-image-container img {
     transform: scale(1.05);
 }

 .grid-image-label {
     position: absolute;
     top: 10px;
     left: 10px;
     padding: 4px 8px;
     background: linear-gradient(135deg, rgba(121, 83, 219, 0.9), rgba(157, 109, 255, 0.9));
     color: white;
     font-size: 11px;
     font-weight: 600;
     border-radius: 12px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }

 .grid-image-label.compressed {
     background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 0.9));
 }

 .grid-image-label.processing {
     background: linear-gradient(135deg, rgba(255, 193, 7, 0.9), rgba(255, 152, 0, 0.9));
 }

 .grid-image-info {
     padding: 15px;
 }

 .grid-image-name {
     font-weight: 600;
     color: var(--text-color);
     font-size: 14px;
     margin-bottom: 8px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
 }

 .grid-image-stats {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 12px;
 }

 .grid-stat {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 2px;
 }

 .grid-stat-label {
     font-size: 10px;
     color: var(--tool-description-color);
     text-transform: uppercase;
     font-weight: 500;
 }

 .grid-stat-value {
     font-size: 12px;
     font-weight: 600;
     color: var(--text-color);
 }

 .grid-stat-value.compressed {
     color: #2ecc71;
 }

 .grid-stat-value.savings {
     color: #e74c3c;
 }

 .grid-image-actions {
     display: flex;
     gap: 8px;
 }

 .grid-action-btn {
     flex: 1;
     padding: 6px 10px;
     border-radius: 6px;
     font-size: 11px;
     font-weight: 500;
     cursor: pointer;
     border: none;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 4px;
     transition: all 0.3s ease;
 }

 .grid-action-btn.primary {
     background-color: #7953db;
     color: white;
 }

 .grid-action-btn.primary:hover:not(:disabled) {
     background-color: #6a44cc;
 }

 .grid-action-btn.secondary {
     background-color: transparent;
     border: 1px solid var(--card-border);
     color: var(--text-color);
 }

 .grid-action-btn.secondary:hover:not(:disabled) {
     background-color: var(--card-border);
 }

 .grid-action-btn:disabled {
     opacity: 0.6;
     cursor: not-allowed;
 }

 /* Compression Summary */
 .compression-summary {
     background: linear-gradient(135deg, var(--card-bg) 0%, rgba(121, 83, 219, 0.02) 100%);
     border-radius: 12px;
     padding: 20px;
     border: 1px solid var(--card-border);
 }

 .summary-stats {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
     gap: 15px;
 }

 .summary-item {
     display: flex;
     flex-direction: column;
     gap: 5px;
     text-align: center;
 }

 .summary-label {
     font-size: 12px;
     color: var(--tool-description-color);
     font-weight: 500;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 5px;
 }

 .summary-value {
     font-size: 16px;
     font-weight: 700;
     color: var(--text-color);
 }

 /* Processing Animation */
 @keyframes pulse {
     0% {
         opacity: 1;
     }

     50% {
         opacity: 0.7;
     }

     100% {
         opacity: 1;
     }
 }

 .processing-overlay {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(255, 193, 7, 0.1);
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 10;
 }

 .processing-spinner {
     color: #ffc107;
     font-size: 24px;
     animation: spin 1s linear infinite;
 }

 @keyframes spin {
     from {
         transform: rotate(0deg);
     }

     to {
         transform: rotate(360deg);
     }
 }

 /* Small inline progress indicator */
 .btn-content {
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .small-progress {
     display: inline-flex;
     align-items: center;
     justify-content: center;
 }

 .small-progress svg {
     animation: spin 1s linear infinite;
 }

 .progress-ring {
     animation: progressRing 2s ease-in-out infinite;
 }

 @keyframes progressRing {
     0% {
         stroke-dashoffset: 62.83;
     }

     50% {
         stroke-dashoffset: 31.42;
     }

     100% {
         stroke-dashoffset: 0;
     }
 }

 /* Simple Button Styles */
 .enhanced-btn {
     padding: 12px 24px;
     border-radius: 6px;
     font-weight: 500;
     font-size: 14px;
     cursor: pointer;
     border: none;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     transition: background-color 0.2s ease;
 }

 .enhanced-btn:disabled {
     opacity: 0.6;
     cursor: not-allowed;
 }

 .primary-btn.enhanced-btn {
     background-color: #7953db;
     color: white;
 }

 .primary-btn.enhanced-btn:hover:not(:disabled) {
     background-color: #6a44cc;
 }

 .secondary-btn.enhanced-btn {
     background-color: transparent;
     border: 1px solid var(--card-border);
     color: var(--text-color);
 }

 .secondary-btn.enhanced-btn:hover:not(:disabled) {
     background-color: var(--card-border);
 }

 /* Dark mode support for simple buttons */
 [data-theme="dark"] .secondary-btn.enhanced-btn {
     border-color: #444;
     color: var(--text-color);
 }

 [data-theme="dark"] .secondary-btn.enhanced-btn:hover:not(:disabled) {
     background-color: #444;
 }

 /* Checkbox styles */
 .option-group input[type="checkbox"] {
     margin-right: 10px;
     transform: scale(1.2);
     accent-color: #7953db;
 }

 .option-group label:has(input[type="checkbox"]) {
     display: flex;
     align-items: center;
     cursor: pointer;
     font-size: 14px;
     margin-bottom: 0;
 }

 /* Animations */
 @keyframes float {
     0% {
         transform: translateY(0px);
     }

     50% {
         transform: translateY(-10px);
     }

     100% {
         transform: translateY(0px);
     }
 }

 @keyframes pulse {
     0% {
         transform: scale(1);
     }

     50% {
         transform: scale(1.1);
     }

     100% {
         transform: scale(1);
     }
 }

 @keyframes shake {

     0%,
     100% {
         transform: translateX(0);
     }

     20%,
     60% {
         transform: translateX(-5px);
     }

     40%,
     80% {
         transform: translateX(5px);
     }
 }

 .hover-effect {
     transform: translateY(-5px);
 }

 .shake-animation {
     animation: shake 0.5s ease-in-out;
 }

 /* Drag and Drop Highlight */
 .upload-area.drag-over .upload-content {
     border: 2px dashed #7953db;
     background-color: rgba(121, 83, 219, 0.03);
     transform: scale(1.02);
     transition: all 0.3s ease;
 }

 .upload-area.drag-over .upload-icon {
     transform: translateY(-5px) scale(1.1);
 }


 /* Responsive Styles */
 @media (max-width: 992px) {
     .cropper-wrapper {
         flex-direction: column;
     }

     .preview-panel {
         border-right: none;
         border-bottom: 1px solid var(--card-border);
         min-width: auto;
     }

     .options-panel {
         height: 400px;
         max-height: 50vh;
         overflow-y: auto;
         overflow-x: hidden;
     }
 }

 @media (max-width: 768px) {
     .images-grid-container {
         grid-template-columns: 1fr;
     }

     .multi-file-header {
         flex-direction: column;
         gap: 15px;
         text-align: center;
     }

     .batch-actions {
         justify-content: center;
     }

     .options-panel {
         height: 350px;
         max-height: 40vh;
         overflow-y: auto;
         overflow-x: hidden;
         -webkit-overflow-scrolling: touch;
     }

     .options-container {
         padding: 20px;
         padding-bottom: 40px;
     }

     .preview-modal-content {
         width: 95vw;
         height: 95vh;
     }

     .preview-modal-body {
         flex-direction: column;
     }

     .preview-info-panel {
         border-left: none;
         border-top: 1px solid var(--card-border);
     }
 }

 @media (max-width: 480px) {
     .summary-stats {
         grid-template-columns: repeat(2, 1fr);
     }

     .action-row {
         flex-direction: column;
     }

     .quality-control {
         flex-direction: column;
         gap: 10px;
     }

     .quality-presets {
         justify-content: center;
     }

     .options-panel {
         height: 300px;
         max-height: 35vh;
         overflow-y: scroll;
         overflow-x: hidden;
         -webkit-overflow-scrolling: touch;
         scrollbar-width: thin;
     }

     .options-container {
         padding: 15px;
         padding-bottom: 50px;
     }

     .option-group {
         margin-bottom: 20px;
         padding: 15px;
     }

     .cropper-wrapper {
         min-height: auto;
     }
 }
 /*
 Comparison Modal Styles */
 .comparison-body {
     padding: 20px;
     display: flex;
     flex-direction: column;
     gap: 20px;
 }

 .comparison-images {
     display: flex;
     gap: 20px;
     align-items: flex-start;
     min-height: 400px;
 }

 .comparison-side {
     flex: 1;
     display: flex;
     flex-direction: column;
     gap: 10px;
     height: 100%;
 }

 .comparison-label {
     text-align: center;
     font-weight: 600;
     font-size: 16px;
     color: var(--text-color);
     padding: 8px 16px;
     background: linear-gradient(135deg, rgba(121, 83, 219, 0.1), rgba(157, 109, 255, 0.1));
     border-radius: 20px;
     flex-shrink: 0;
 }

 .comparison-label.compressed {
     background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.1));
     color: #2ecc71;
 }

 .comparison-image-container {
     display: flex;
     align-items: center;
     justify-content: center;
     background: var(--background-color);
     border-radius: 12px;
     border: 2px solid var(--card-border);
     height: 350px;
     overflow: hidden;
     flex-shrink: 0;
 }

 .comparison-image {
     max-width: 100%;
     max-height: 100%;
     object-fit: contain;
     border-radius: 8px;
     display: block;
 }

 .comparison-divider {
     width: 2px;
     background: linear-gradient(to bottom, transparent, var(--card-border), transparent);
     margin: 0 10px;
     align-self: stretch;
     min-height: 400px;
 }

 .comparison-stats {
     display: flex;
     flex-direction: column;
     gap: 8px;
     padding: 15px;
     background: var(--background-color);
     border-radius: 8px;
     border: 1px solid var(--card-border);
     margin-top: auto;
     flex-shrink: 0;
 }

 .stat-item {
     display: flex;
     justify-content: space-between;
     align-items: center;
 }

 .stat-label {
     font-size: 14px;
     color: var(--tool-description-color);
     font-weight: 500;
 }

 .stat-value {
     font-size: 14px;
     font-weight: 600;
     color: var(--text-color);
 }

 .stat-value.savings {
     color: #e74c3c;
     background: rgba(231, 76, 60, 0.1);
     padding: 2px 6px;
     border-radius: 4px;
 }

 .comparison-actions {
     display: flex;
     justify-content: center;
     gap: 15px;
     padding-top: 15px;
     border-top: 1px solid var(--card-border);
 }

 /* Responsive comparison modal */
 @media (max-width: 768px) {
     .comparison-images {
         flex-direction: column;
         min-height: auto;
     }
     
     .comparison-divider {
         width: 100%;
         height: 2px;
         margin: 10px 0;
         min-height: 2px;
         align-self: auto;
     }

     .comparison-image-container {
         height: 250px;
     }

     .comparison-side {
         height: auto;
     }
 }