:root {
    --primary: #1ba4c8;
    --primary-dark: #1892B2;
    --secondary: #1892B2;
    --light-bg: #F8FCFF;
    --border: #e1e5f1;
    --text: #333;
    --text-light: #666;
    --danger: #ff6b6b;
    --success: #06d6a0;
    --warning: #ffd166;
    --info: #2b2b2b;
    --info-back: #f8f9fa;
}


/* Tooltip styles for disabled buttons */
button:disabled {
    position: relative;
    cursor: not-allowed;
    background: #f3f3f3;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Ensure tooltip doesn't interfere with button layout */
.action-buttons-custom button {
    position: relative;
    overflow: visible;
}

/* Main Container */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.container-custom p { text-align: center; }
.container-custom select { margin-bottom: 0; }
.container-custom h3, 
.container-custom h3 a { font-size: 18px !important; padding: 0px; }

/* Content Wrapper */
.content-wrapper-custom {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Left Panel - NO SCROLL */
.left-panel-custom {
    flex: 0 0 300px;
    padding: 15px;
    border-right: 1px solid var(--border);
    overflow-y: visible !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

/* Right Panel */
.right-panel-custom {
    flex: 1;
    padding: 15px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.section-title-custom {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-custom .fa-icon {
    color: var(--primary);
}

/* Upload Area */
.upload-area-custom {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 5px 10px;
    text-align: center;
    background-color: rgb(164 187 200 / 10%);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.upload-area-custom:hover {
    background-color: rgb(164 187 200 / 20%);
    border-color: var(--primary-dark);
}
.upload-area-custom i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 2px;
}
.upload-area-custom h3 {
    font-size: 1rem;
    color: var(--secondary);
}
.upload-area-custom p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0px;
    text-align: center;
}

#fileInput {
    display: none;
}

/* Form Controls */
.form-group-custom {
    margin-bottom: 2px;
}

.form-group-custom label {
    display: block;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

/* Mode Toggle */
.mode-toggle-custom {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    background: var(--border);
    padding: 4px;
    border-radius: 6px;
}

.mode-toggle-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 4px;
    background: white;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.mode-toggle-btn:hover {
    color: var(--primary);
}

.mode-toggle-btn.active {
    background: var(--primary);
    color: white;
}

/* Hide advanced controls in easy mode */
.advanced-only {
    display: none;
}

.mode-advanced .advanced-only {
    display: block !important;
}

/* Aspect Ratio Selector */
.format-selector-custom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 2px;
}

.format-option-custom {
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.format-option-custom:hover {
    border-color: var(--primary);
}

.format-option-custom.active-custom {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.1);
}

.format-preview-custom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 2px;
    border-radius: 2px;
    cursor: pointer;
}

.format-preview-custom svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.format-preview-custom span {
    font-weight: 600;
    font-size: 12px;
    margin-top: 2px;
}

/* Crop Tools - SVG ICONS */
.compression-levels-custom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 2px;
}

.compression-level-custom {
    padding: 8px 4px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    text-align: center;
    position: relative;
}

.compression-level-custom:hover {
    border-color: var(--primary);
}

.compression-level-custom.active-custom {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.1);
    font-weight: 600;
}

/* Remove old icon styles */
.compression-level-custom i {
    font-size: 16px;
    color: #919192;
}

/* Select Full */
.select-full-custom {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

/* Zoom Slider */
.quality-slider-container-custom {
    margin-top: 2px;
}

.quality-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.quality-value-custom {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.quality-description-custom {
    font-size: 0.8rem;
    color: var(--text-light);
}

.quality-slider-custom {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--slider-percent, 20%), #e0e0e0 var(--slider-percent, 20%), #e0e0e0 100%);
    outline: none;
    border-radius: 2.5px;
    margin-bottom: 2px;
}

.quality-slider-custom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Action Buttons */
.action-buttons-custom {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

/* Loading */
.loading-custom {
    display: none;
    text-align: center;
    padding: 8px;
}

.spinner-custom {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Preview Area */
.preview-area-custom {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex: 0 0 400px !important;
    flex-shrink: 0 !important;
    background-color: #f8f9fa;
}

.preview-container-custom {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.preview-placeholder-custom {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.preview-placeholder-custom .fa-icon {
    font-size: 3rem;
    color: #d1d9f0;
    margin-bottom: 10px;
}

/* Combined Info Container */
.combined-info-container-custom {
    display: none;
    position: relative;
    background: var(--info-back);
    color: white;
    padding: 2px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(2px);
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    height: 70px;
    margin: 0;
    pointer-events: none;
    border: 1px solid #e1e5f1;
}

.combined-info-container-custom.active {
    display: flex;
}

.combined-info-container-custom * {
    pointer-events: auto;
}

.info-left-custom {
    flex: 0 0 auto;
}

.info-right-custom {
    flex: 1;
    margin-left: 20px;
    min-width: 0;
    text-align: right;
}

.dimension-values-custom {
    display: flex;
    gap: 15px;
}

.dimension-item-custom {
    text-align: center;
    min-width: 60px;
}

.dimension-row-custom {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dimension-row-custom .value-custom {
    font-size: 16px;
    font-weight: 600;
    color: var(--info);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dimension-row-custom .label-custom {
    font-size: 11px;
    color: var(--info);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.info-text-custom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-line-custom {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--info);
    font-weight: 400;
}

/* File List Container */
.file-list-container-custom {
   flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 350px;
    overflow: hidden;
    position: relative;
}

.file-list-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.file-list-header-custom h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
}

.file-count-custom {
    font-size: 0.8rem;
    color: var(--text-light);
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* File Actions */
.file-header-actions-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-all-btn-custom {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    padding: 0;
}

.delete-all-btn-custom:hover {
    background: #e82121;
    color: white;
    border: none;
    box-shadow: none;
}

.delete-all-btn-custom:active {
    transform: scale(0.95);
}

/* File List */
.file-list-custom {
   flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    min-height: 150px;
    max-height: calc(5 * 58px);
}

/* Hide scrollbar when empty state is shown */
.file-list-custom:has(.empty-state-custom:only-child) {
    overflow: hidden !important;
    max-height: 200px !important;
}

/* File Item - 2 line layout */
.file-item-custom {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s;
    cursor: pointer;
    min-height: 48px;
    height: 48px;
    box-sizing: border-box;
    position: relative;
}

.file-item-custom:last-child {
    border-bottom: none;
}

.file-item-custom:hover {
    background-color: rgba(255,255,255,0.7);
}

.file-item-custom.active-custom {
    background-color: rgba(75, 108, 183, 0.1);
    border-left: 3px solid var(--primary);
}

/* File Actions */
.file-actions-custom {
    margin-left: 8px;
    flex-shrink: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item-custom:hover .file-actions-custom {
    opacity: 1;
}

.file-preview-custom {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 8px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-preview-custom img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-preview-custom .fa-icon {
    color: #d1d9f0;
    font-size: 1.1rem;
}

.file-details-custom {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-name-custom {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* FIXED: 2nd line with all file details */
.file-details-row-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
}

.file-size-original-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.original-label {
    font-weight: 600;
    color: var(--text);
}

.cropped-label {
    font-weight: 600;
    color: var(--success);
    margin-left: 8px;
}

.file-cropped-info-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.file-cropped-size {
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    font-size: 11px;
}

.file-dimensions {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
    padding: 1px 5px;
    border-radius: 8px;
    display: inline-block;
    white-space: nowrap;
    font-size: 10px;
}

/* File Actions */
.delete-file-btn-custom {
    background: none;
    color: var(--danger);
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    padding: 0;
}

.delete-file-btn-custom:hover {
    background: none;
    color: var(--danger);
    transform: scale(1.2);
    border: none;
    box-shadow: none;
}

.delete-file-btn-custom:active {
    transform: scale(0.9);
}

/* Empty State */
.empty-state-custom {
   text-align: center;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    margin: 0;
    padding: 20px;
}

.empty-state-custom .fa-icon {
    font-size: 2rem;
    color: #d1d9f0;
    margin-bottom: 8px;
}

.empty-state-custom p {
    margin: 5px 0;
    line-height: 1.4;
}

.empty-state-custom .helper-text {
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.7;
}

/* Crop Result Modal */
.download-modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.download-modal-content-custom {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    min-width: 280px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    margin: 0 auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-modal-header-custom {
    padding: 10px 10px 10px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--light-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-modal-header-custom h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-modal-close-custom {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.download-modal-close-custom:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.download-modal-body-custom {
    padding: 10px;
}

.crop-preview-modal-custom {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-height: 300px;
    overflow: hidden;
    display: flex;
    gap: 10px;
    align-items: center;
}

.crop-preview-modal-custom img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.download-options-custom {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-option-custom {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--light-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.download-option-custom:hover {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(27, 164, 200, 0.1);
}

.download-option-icon-custom {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.download-option-content-custom {
    flex: 1;
}

.download-option-title-custom {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 5px;
    font-size: 1rem;
}

.download-option-description-custom {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

.download-stats-custom {
    margin-top: 10px;
    padding: 10px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stats-grid-custom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-item-custom {
    text-align: center;
    padding: 2px;
}

.stat-value-custom {
    display: block;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.stat-label-custom {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Format toggle styling */
.format-toggle-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Toggle switch styles */
.toggle-switch-custom {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch-custom input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider-custom {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 20px;
}

.toggle-slider-custom:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch-custom input:checked + .toggle-slider-custom {
    background-color: var(--primary);
}

.toggle-switch-custom input:checked + .toggle-slider-custom:before {
    transform: translateX(20px);
}

/* Format options group */
.format-options-group-custom {
    display: block;
    margin-top: 8px;
}


/* Style for quality slider */
#qualitySlider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--quality-percent, 92%), #e0e0e0 var(--quality-percent, 92%), #e0e0e0 100%);
    outline: none;
    border-radius: 2.5px;
    margin-bottom: 2px;
}

#qualitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#qualitySlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.format-badge {
    font-size: 9px;
    background: var(--primary);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}

/* Comparison Preview Styles */
.comparison-container-custom {
    display: flex;
    width: 100%;
    height: 100%;
}

.before-container-custom,
.after-container-custom {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.before-container-custom img,
.after-container-custom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-label-custom {
    position: absolute;
    top: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.before-container-custom .preview-label-custom {
    left: 10px;
}

.after-container-custom .preview-label-custom {
    right: 10px;
}

/* Split View Styles with Handle */
.split-container-custom {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.split-view-wrapper-custom {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#beforeImageSplit, #afterImageSplit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.split-line-custom {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #1ba4c8;
    cursor: col-resize;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: left 0.05s linear;
}

.split-line-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: #1ba4c8;
    border-radius: 50%;
    cursor: col-resize;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 3px solid white;
}

.split-line-handle:before,
.split-line-handle:after {
    content: '';
    position: absolute;
    background-color: white;
    border-radius: 2px;
}

.split-line-handle:before {
    width: 12px;
    height: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.split-line-handle:after {
    width: 2px;
    height: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.split-line-custom:hover .split-line-handle {
    background-color: #1493b3;
    transform: translate(-50%, -50%) scale(1.1);
}

.split-label-left-custom,
.split-label-right-custom {
    position: absolute;
    top: 10px;
    padding: 4px 12px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 5;
}

.split-label-left-custom {
    left: 10px;
}

.split-label-right-custom {
    right: 10px;
}

/* Single View Styles */
.single-container-custom {
    width: 100%;
    height: 100%;
    position: relative;
}

.single-container-custom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.single-label-custom {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Algorithm Info Panel */
.algorithm-info-custom {
    background: var(--info-back);
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
    border-left: 3px solid var(--primary);
}

.algorithm-info-custom strong {
    color: var(--primary);
    font-weight: 600;
}

/* Sharpening Preset Icons */
.format-preview-custom i {
    font-size: 20px;
    margin-bottom: 6px;
    color: var(--primary);
}

/* Status Indicators */
.file-status-custom {
    margin-left: 8px;
    flex-shrink: 0;
}

.status-pending {
    color: var(--warning);
}

.status-processing {
    color: var(--primary);
}

.status-complete {
    color: var(--success);
}

.status-error {
    color: var(--danger);
}

/* Loading overlay for preview */
.preview-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.preview-loading-overlay .spinner-custom {
    width: 40px;
    height: 40px;
}

/* Hide broken image icons */
img[src=""], img:not([src]) {
    opacity: 0;
}

/* Drag overlay for split view */
#dragOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    cursor: col-resize;
    background: transparent;
}

/* Preview Buttons Under Image */
.preview-buttons-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
    /*background: rgba(0, 0, 0, 0.7);*/
    padding: 8px 12px;
    margin-bottom: 0px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    /*box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);*/
}

.preview-mode-btn {
    background: rgba(0, 0, 0, 0.20);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-shadow: none;
}

.preview-mode-btn:hover {
    color: white;
    background: rgba(0, 0, 0, 0.50);
    /*transform: translateY(-2px);*/
}

.preview-mode-btn.active {
    background: #1ba4c8;
    color: white;
    box-shadow: 0 2px 8px rgba(27, 164, 200, 0.4);
}

.preview-mode-btn i {
    font-size: 16px;
}

/* Tooltip for advanced controls */
.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom:hover:after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper-custom {
        flex-direction: column;
    }
    
    .left-panel-custom {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-y: visible !important;
        max-height: none;
    }
    
    .right-panel-custom {
        flex: 1;
        padding: 15px;
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
    }
    
    .preview-area-custom {
        flex: 0 0 300px;
        max-height: 300px;
        min-height: 300px;
    }
    
    .combined-info-container-custom {
        height: 70px;
        padding: 10px;
    }
    
    .dimension-values-custom {
        gap: 10px;
    }
    
    .dimension-item-custom {
        min-width: 50px;
    }
    
    .dimension-row-custom .value-custom {
        font-size: 14px;
    }
    
    .info-line-custom {
        font-size: 11px;
    }
    
    .file-list-container-custom {
        min-height: 150px;
    }
    
    .format-selector-custom,
    .compression-levels-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .file-name-custom {
        max-width: 150px;
    }
    
    .file-details-row-custom {
        font-size: 9px;
    }
    
    .stats-grid-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-container-custom {
        flex-direction: column;
    }
    
    .before-container-custom,
    .after-container-custom {
        height: 50%;
    }
    
    .split-label-left-custom,
    .split-label-right-custom {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .preview-buttons-container {
        bottom: 10px;
        padding: 6px 10px;
    }
    
    .preview-mode-btn {
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .split-line-handle {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .compression-levels-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .format-selector-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .file-name-custom {
        max-width: 120px;
    }
    
    .preview-area-custom {
        flex: 0 0 250px;
        max-height: 250px;
        min-height: 250px;
    }
    
    .upload-area-custom {
        min-height: 120px;
        padding: 12px 8px;
    }
    
    .combined-info-container-custom {
        height: 70px;
        padding: 8px 10px;
    }
    
    .dimension-values-custom {
        gap: 8px;
    }
    
    .dimension-item-custom {
        min-width: 45px;
    }
    
    .dimension-row-custom .value-custom {
        font-size: 13px;
    }
    
    .dimension-row-custom .label-custom {
        font-size: 10px;
    }
    
    .info-text-custom {
        gap: 2px;
    }
    
    .info-line-custom {
        font-size: 10px;
    }
    
    .file-list-container-custom {
        min-height: 120px;
    }
    
    .file-item-custom {
        padding: 6px 4px;
        min-height: 45px;
    }
    
    .file-name-custom {
        max-width: 100px;
    }
    
    .file-details-row-custom {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .file-size-original-custom {
        flex-basis: 100%;
        margin-bottom: 2px;
    }
    
    .file-cropped-info-custom {
        margin-left: 0;
    }
    
    .action-buttons-custom {
        flex-direction: column;
    }
    
    .action-buttons-custom button {
        width: 100%;
    }
    
    .quality-header-custom {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .section-title-custom {
        font-size: 0.9rem;
    }
    
    .crop-preview-modal-custom {
        max-height: 200px;
    }
    
    .download-modal-content-custom {
        max-width: 95%;
    }
    
    .stats-grid-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preview-label-custom,
    .single-label-custom {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .preview-buttons-container {
        bottom: 8px;
        padding: 5px 8px;
    }
    
    .preview-mode-btn {
        width: 30px;
        height: 30px;
        padding: 5px;
    }
    
    .preview-mode-btn i {
        font-size: 14px;
    }
    
    .split-line-handle {
        width: 30px;
        height: 30px;
    }
}



/* Add these styles to your existing CSS */

/* Preview loading overlay */
.preview-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: none;
}

.preview-loading-overlay .spinner-custom {
    width: 40px;
    height: 40px;
}

/* Batch processing status */
.batch-processing-status {
    display: none;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
}

/* Mode toggle switch specific styling */
#modeToggle:checked + .toggle-slider-custom {
    background-color: var(--primary);
}

#modeToggle:not(:checked) + .toggle-slider-custom {
    background-color: #ccc;
}

/* Quick preview update indicator */
.quick-update-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.quick-update-indicator.show {
    opacity: 1;
}


/* Batch result modal specific styles */
#batchResultModal .download-option-custom {
    min-height: 50px;
}

#batchResultModal .fa-check-circle {
    font-size: 48px;
    color: var(--success);
    margin-bottom: 15px;
}

#batchResultModal .crop-preview-modal-custom {
    text-align: center;
    padding: 10px !important;
}

/* Ensure preview updates are visible */
.quick-update-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.quick-update-indicator.show {
    opacity: 1;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Make sure preview images update smoothly */
#afterImage, #afterImageSplit, #singleImage {
    transition: opacity 0.3s;
}

.preview-updating {
    opacity: 0.7;
}




/* Updated Preview Placeholder Styles */
#previewPlaceholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    top: 0;
    left: 0;
    background-color: #f8f9fa;
    z-index: 5;
    text-align: center;
}

.preview-placeholder-inner-custom {
    max-width: 300px;
    padding: 20px;
}

#previewPlaceholder i {
    font-size: 64px;
    color: #d1d9f0;
    margin-bottom: 20px;
    display: block;
}

#previewPlaceholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

#previewPlaceholder p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

/* Hide preview buttons when no image is loaded */
.preview-container-custom:has(#previewPlaceholder:not([style*="display: none"])) .preview-buttons-container {
    display: none;
}

/* Hide preview containers when no image is loaded */
.preview-container-custom:has(#previewPlaceholder:not([style*="display: none"])) #comparisonContainer,
.preview-container-custom:has(#previewPlaceholder:not([style*="display: none"])) #splitContainer,
.preview-container-custom:has(#previewPlaceholder:not([style*="display: none"])) #singleContainer {
    display: none !important;
}