: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;
}

/* 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; /* No scrolling */
    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;
/*    margin-bottom: 6px;*/
    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;
}

/* 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;
}


/* SVG color inheritance */
.format-preview-custom.btn1 svg { stroke: #919192; }
.format-preview-custom.btn2 svg { stroke: #919192; }
.format-preview-custom.btn3 svg { stroke: #919192; }
.format-preview-custom.btn4 svg { stroke: #919192; }

/* Crop Tools - SVG ICONS */
.compression-levels-custom {
    display: grid;
    grid-template-columns: repeat(2, 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;
    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;
}

/* Crop Tools - SVG Styling */
.compression-level-custom svg {
    width: 24px;
    height: 24px;    
}

.compression-level-custom span {
    font-size: 11px;
    font-weight: 500;
}

/* SVG colors for tools */
.compression-level-custom[data-tool="crop"] svg {
    stroke: #919192;
}

.compression-level-custom[data-tool="move"] svg {
    stroke: #919192;
}

/* Rotate/Flip Tools - SVG ICONS */
.rotate-flip-tools-custom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 2px;
}

.rotate-flip-button-custom {
    padding: 8px 4px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rotate-flip-button-custom:hover {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.05);
}

/* Rotate/Flip Tools - SVG Styling */
.rotate-flip-button-custom svg {
    width: 24px;
    height: 24px;
    color: #919192;
}

/* SVG colors for rotate/flip */
/*.rotate-flip-button-custom[data-action="rotate-left"] svg {
    stroke: #919192;
}

.rotate-flip-button-custom[data-action="rotate-right"] svg {
    stroke: #919192;
}

.rotate-flip-button-custom[data-action="flip-horizontal"] svg {
    stroke: #919192;
}

.rotate-flip-button-custom[data-action="flip-vertical"] svg {
    stroke: #919192;
}*/

/* Remove old icon styles */
.compression-level-custom i,
.rotate-flip-button-custom i {
    display: none !important; /* Hide font awesome icons */
}

/* Preset Options */
.resize-options-container-custom {
    margin-top: 2px;
}

/* Preset Sizes Group */
.web-presets-group-custom {
    display: block;
    margin-bottom: 8px;
}

.select-full-custom {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

/* Custom Size Options Group - ALWAYS SHOW */
.resize-options-group-custom {
    display: block !important;
    margin-bottom: 8px;
}

.resize-inputs-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dimension-input-custom {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.dimension-input-custom input {
    flex: 1;
    border: none;
    padding: 8px;
    font-size: 13px;
    outline: none;
    min-width: 0;
    width: 100%;
    background: transparent;
}

.dimension-input-custom span {
    padding: 0 8px;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
    border-left: 1px solid var(--border);
}

/* Lock aspect ratio button */
.lock-ratio-btn-custom {
    background: var(--border);
    border: none;
    border-radius: 4px;
    width: 32px !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
    font-size: 14px !important;
    padding: 0;
    margin: 0 2px;
    flex-shrink: 0;
    text-shadow: none;
}

.lock-ratio-btn-custom:hover {
    background: var(--primary);
    color: white;
    box-shadow: none;
}

.lock-ratio-btn-custom.locked {
    background: var(--primary);
    color: white;
}

/* Aspect ratio display - REMOVED from custom size area */
.aspect-ratio-display-custom {
    display: none;
}

/* 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 - Cropper Container */
.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;
}

#cropImage {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: none;
    margin: auto;
}

/* Cropper.js custom styles - WHITE with bigger corners */
.cropper-container {
    direction: ltr;
    font-size: 0;
    line-height: 0;
    position: relative;
    touch-action: none;
    user-select: none;
    width: 100% !important;
    height: 100% !important;
}

.cropper-view-box {
    outline: 2px dotted white !important; /* White outline */
    outline-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); /* Dark border for contrast */
}

/* Replace the existing .cropper-point styles */
.cropper-point {
    background-color: white !important;
    border: 2px solid var(--primary) !important;
    opacity: 1 !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Corner points - SMALLER SQUARE */
.cropper-point.point-se,
.cropper-point.point-sw,
.cropper-point.point-nw,
.cropper-point.point-ne {
    width: 10px !important;  /* Even smaller */
    height: 10px !important; /* Even smaller */
    border-radius: 2px !important;
    cursor: nwse-resize !important;
}

/* Position corner points */
.cropper-point.point-se {
    right: -5px !important;  /* Adjusted for smaller size */
    bottom: -5px !important; /* Adjusted for smaller size */
}

.cropper-point.point-sw {
    left: -5px !important;   /* Adjusted for smaller size */
    bottom: -5px !important; /* Adjusted for smaller size */
    cursor: nesw-resize !important;
}

.cropper-point.point-nw {
    left: -5px !important;   /* Adjusted for smaller size */
    top: -5px !important;    /* Adjusted for smaller size */
}

.cropper-point.point-ne {
    right: -5px !important;  /* Adjusted for smaller size */
    top: -5px !important;    /* Adjusted for smaller size */
    cursor: nesw-resize !important;
}

/* Side points - EVEN THINNER RECTANGLE */
.cropper-point.point-n,
.cropper-point.point-s {
    width: 32px !important;  /* Wider to emphasize thinness */
    height: 4px !important;  /* Very thin height */
    border-radius: 1px !important;
    border: 2px solid var(--primary) !important;
    background-color: white !important;
    cursor: ns-resize !important;
}

.cropper-point.point-e,
.cropper-point.point-w {
    width: 4px !important;   /* Very thin width */
    height: 32px !important; /* Taller to emphasize thinness */
    border-radius: 1px !important;
    border: 2px solid var(--primary) !important;
    background-color: white !important;
    cursor: ew-resize !important;
}

/* Center points positioning */
.cropper-point.point-n,
.cropper-point.point-s {
    left: 50% !important;
    margin-left: -16px !important; /* Half of width (32px) */
}

.cropper-point.point-e,
.cropper-point.point-w {
    top: 50% !important;
    margin-top: -16px !important; /* Half of height (32px) */
}

/* Guide lines */
.cropper-dashed {
    border: 0 dashed rgba(255, 255, 255, 0.7) !important;
}

/* Modal background */
.cropper-modal {
    background: rgba(0, 0, 0, 0.5) !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 - FIXED POSITION */
.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-radius: 0 0 8px 8px;*/
    border: 1px solid #e1e5f1;
}

.combined-info-container-custom * {
    pointer-events: auto;
}

.combined-info-container-custom.active {
    display: flex;
}

.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;
}

/* NEW: Aspect Ratio Display in Combined Info */
/* Add this new style for aspect ratio display in info panel */
.aspect-ratio-info-custom {
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Update the combined info container to include aspect ratio info */
.combined-info-container-custom .info-left-custom {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

/* Add a specific style for when aspect ratio is locked */
.aspect-ratio-locked {
    color: #42AFD3 !important;
    font-weight: 600;
}

/* 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; /* ADD THIS LINE - hides button by default */
    transition: opacity 0.2s ease; /* ADD THIS LINE - smooth fade effect */
}

.file-item-custom:hover .file-actions-custom {
    opacity: 1; /* ADD THIS LINE - shows button on hover */
}

.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 */
.file-actions-custom {
    margin-left: 8px;
    flex-shrink: 0;
    z-index: 2;
}

.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;
}

.file-item-custom:hover .delete-file-btn-custom {
    opacity: 1;
}

.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);
}

.file-status-custom {
    margin-left: 8px;
    flex-shrink: 0;
}

.file-status-custom i {
    font-size: 14px;
}

.status-pending {
    color: var(--warning);
}

.status-processing {
    color: var(--primary);
}

.status-complete {
    color: var(--success);
}

.status-error {
    color: var(--danger);
}

/* 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: 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: 25px;
}

.crop-preview-modal-custom {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-preview-modal-custom img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.download-options-custom {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.download-option-custom {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    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: 20px;
    padding: 15px;
    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: 8px;
}

.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 selection styling */
.format-select-custom {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* Format option icons */
.format-select-custom option[value="original"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%23333" d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/></svg>');
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 25px;
}

.format-select-custom option[value="jpg"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%23ea4335" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>');
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 25px;
}

.format-select-custom option[value="png"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%2334a853" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>');
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 25px;
}

.format-select-custom option[value="webp"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%234285f4" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>');
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 25px;
}

.format-select-custom option[value="avif"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%239c27b0" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>');
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 25px;
}


.format-badge {
    font-size: 9px;
    background: var(--primary);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}



/* Format toggle styling - KEEP THIS SWITCH */
.format-toggle-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Toggle switch styles - KEEP THESE */
.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;
}

/* Quality slider container */
.quality-slider-container-custom {
    margin-top: 10px;
    /* Removed display: none - controlled by JavaScript */
}

/* 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);
}



/* 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);
        /* STILL NO SCROLL on mobile */
        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,
    .rotate-flip-tools-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);
    }
}

@media (max-width: 480px) {
    /* Crop tools - 2 per row on mobile */
    .compression-levels-custom,
    .rotate-flip-tools-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Aspect ratio selector - 1 per row on mobile */
    .format-selector-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Preset and size options adjustments */
    .resize-inputs-custom {
        flex-direction: column;
        gap: 6px;
    }
    
    .dimension-input-custom {
        width: 100%;
    }
    
    /* File list adjustments */
    .file-name-custom {
        max-width: 120px;
    }
    
    /* Preview area */
    .preview-area-custom {
        flex: 0 0 250px;
        max-height: 250px;
        min-height: 250px;
    }
    
    /* Upload area */
    .upload-area-custom {
        min-height: 120px;
        padding: 12px 8px;
    }
    
    /* Combined info container */
    .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 */
    .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 layout */
    .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 */
    .action-buttons-custom {
        flex-direction: column;
    }
    
    .action-buttons-custom button {
        width: 100%;
    }
    
    /* Zoom slider */
    .quality-header-custom {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    /* Section titles */
    .section-title-custom {
        font-size: 0.9rem;
    }
    
    /* Crop preview modal */
    .crop-preview-modal-custom {
        max-height: 200px;
    }
    
    .download-modal-content-custom {
        max-width: 95%;
    }
    
    .stats-grid-custom {
        grid-template-columns: repeat(2, 1fr);
    }
}