/* Modified CSS to avoid conflicts with Font Awesome */
:root {
    --primary: #1ba4c8;
    --primary-dark: #1892B2;
    --secondary: #1892B2;
    --light-bg: #F8FCFF;
    --border: #e1e5f1;
    --text: #333;
    --text-light: #666;
    --danger: #ff6b6b;
    --success: #06d6a0;
    --warning: #ffd166;
}

/* 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; line-height: 10px; }
.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 325px;
    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: 10px;
    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;
}

/* Format 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: block;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 2px;
    border-radius: 2px;
    cursor: pointer;
}

.format-preview-custom.webp { 
    color: #4285f4; 
    background: rgba(66, 133, 244, 0.1);
}
.format-preview-custom.jpeg { 
    color: #ea4335; 
    background: rgba(234, 67, 53, 0.1);
}
.format-preview-custom.png { 
    color: #34a853; 
    background: rgba(52, 168, 83, 0.1);
}
.format-preview-custom.avif { 
    color: #9c27b0; 
    background: rgba(156, 39, 176, 0.1);
}

/* Compression Levels - REDUCED HEIGHT */
.compression-levels-custom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 2px;
}

.compression-level-custom {
    padding: 4px 4px; /* Reduced padding */
    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;
    min-height: 28px; /* Reduced from 35px */
}

.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;
}

.compression-level-custom i {
    font-size: 12px; /* Smaller icon */
    color: var(--primary);
    flex-shrink: 0;
}

.compression-level-custom span {
    white-space: nowrap;
}

.compression-level-custom[data-level="smart"] i { color: #6f42c1; }
.compression-level-custom[data-level="balanced"] i { color: #20c997; }
.compression-level-custom[data-level="aggressive"] i { color: #fd7e14; }
.compression-level-custom[data-level="lossless"] i { color: #17a2b8; }

/* Resize Options */
.resize-options-container-custom {
    margin-top: 2px;
}

.resize-toggle-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

.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);
}

/* Web Presets 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;
}

/* Resize Options Group */
.resize-options-group-custom {
    display: block;
    margin-bottom: 8px;
}

.resize-inputs-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.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);
}

.dimension-separator-custom {
    color: var(--text-light);
    font-weight: 600;
    padding: 0 4px;
}

.aspect-ratio-toggle-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Crop Options - show/hide based on aspect ratio toggle */
.crop-options-custom {
    margin-top: 8px;
    display: none; /* Initially hidden */
}

/* Show when aspect ratio is off */
.aspect-ratio-toggle-custom:has(input:not(:checked)) + .crop-options-custom {
    display: block;
}

/* Quality 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, 85%), #e0e0e0 var(--slider-percent, 85%), #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);
}

/* Advanced Options */
.advanced-options-custom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.advanced-option-toggle-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* Action Buttons */
.action-buttons-custom {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.action-buttons-custom button {
    width: 100%;
}

/* 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;
}

.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;
}

#previewImage {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: none;
    margin: auto;
}

.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;
}

/* Comparison Slider */
.preview-comparison-custom {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    user-select: none;
    cursor: default;
    background: #f8f9fa;
}

.preview-comparison-custom.active {
    display: block;
}

.preview-comparison-custom img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: contain;
    transition: clip-path 0.2s ease;
    background: transparent !important;
}

#previewBefore {
    z-index: 1;
    background: #f8f9fa !important;
}

#previewAfter {
    z-index: 2;
    background: #f8f9fa !important;
    clip-path: inset(0 50% 0 0);
}

.comparison-slider-custom {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background: var(--primary);
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
    transition: left 0.2s ease;
    pointer-events: auto;
}

.slider-handle-custom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    cursor: ew-resize;
    color: white;
    transition: background-color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.slider-handle-custom:hover {
    background: var(--primary-dark);
}

.slider-handle-custom:active {
    cursor: grabbing;
}

.slider-handle-custom i {
    font-size: 1rem;
    transition: transform 0.2s;
}

/* Image Labels */
.preview-label-custom {
    position: absolute;
    top: 15px;
    padding: 8px 20px;
    background-color: rgba(255, 255, 255, 0.5);
    color: #1F2022;
    border-radius: 6px;
    z-index: 5;
    user-select: none;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    pointer-events: none;
}

.preview-label-custom:first-of-type {
    left: 15px;
    background-color: rgba(67, 97, 238, 0.85);
    border-left: 4px solid #4cc9f0;
}

.preview-label-custom:last-of-type {
    right: 15px;
    background-color: rgba(76, 201, 240, 0.85);
    border-right: 4px solid #4361ee;
}

/* Image Info */
.image-info-custom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.4);
    color: #131315;
    padding: 8px 15px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    z-index: 50;
    pointer-events: none;
    backdrop-filter: blur(5px);
}

.image-info-custom span {
    display: inline-block;
    margin: 0 5px;
    white-space: nowrap;
}

/* Combined Info Container - FIXED POSITION */
.combined-info-container-custom {
    display: none;
    position: relative;
    background: rgb(31 31 32 / 49%);
    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;
}

.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: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dimension-row-custom .label-custom {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    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: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

.savings-percent {
    color: #06d6a0;
    font-weight: 700;
}

/* 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);
}

.compressed-label {
    font-weight: 600;
    color: var(--text);
    margin-left: 8px;
}

.file-compressed-info-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.file-compressed-size {
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    font-size: 11px;
}

.file-reduction {
    color: var(--success);
    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;
}

/* Processing Modal */
.gradient-picker-modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.gradient-picker-content-custom {
    background: white;
    padding: 15px;
    border-radius: 10px;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin: 10px auto;
}

.modal-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.modal-header-custom h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-custom {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close-custom:hover {
    background: #f5f5f5;
}

.modal-body-custom {
    padding: 10px 0;
}

.modal-actions-custom {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* Processing Stats */
.processing-stats-custom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.processing-stat-custom {
    text-align: center;
}

.processing-stat-custom .stat-label-custom {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.processing-stat-custom .stat-value-custom {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.processing-progress-custom {
    margin: 15px 0;
}

.progress-bar-custom {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-custom.large {
    height: 10px;
}

.progress-fill-custom {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 3px;
}

.current-file-custom {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 10px;
    padding: 8px;
    background: var(--light-bg);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Success 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: 420px;
    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;
}

.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(2, 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);
}

/* 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: 60px;
        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);
    }
    
    .slider-handle-custom {
        width: 35px;
        height: 35px;
    }
    
    .preview-label-custom {
        top: 10px;
        padding: 6px 15px;
        font-size: 0.8rem;
    }
    
    .preview-label-custom:first-of-type {
        left: 10px;
    }
    
    .preview-label-custom:last-of-type {
        right: 10px;
    }
    
    .file-name-custom {
        max-width: 150px;
    }
    
    .file-details-row-custom {
        font-size: 9px;
    }
    
    .file-compressed-size {
        font-size: 10px;
    }
    
    .file-reduction {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    /* Compression levels - 2 per row on mobile */
    .compression-levels-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Format selector - 1 per row on mobile (can be changed to 2 if you prefer) */
    .format-selector-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Web presets and resize 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: 55px;
        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;
    }
    
    /* Comparison slider */
    .slider-handle-custom {
        width: 30px;
        height: 30px;
    }
    
    .slider-handle-custom i {
        font-size: 0.9rem;
    }
    
    /* Preview labels */
    .preview-label-custom {
        top: 8px;
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    
    /* File details row layout */
    .file-details-row-custom {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .file-size-original-custom {
        flex-basis: 100%;
        margin-bottom: 2px;
    }
    
    .file-compressed-info-custom {
        margin-left: 0;
    }
    
    /* Processing modal adjustments */
    .processing-stats-custom {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Download modal adjustments */
    .download-option-custom {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .download-option-icon-custom {
        margin-bottom: 10px;
    }
    
    /* Action buttons */
    .action-buttons-custom {
        flex-direction: column;
    }
    
    .action-buttons-custom button {
        width: 100%;
    }
    
    /* Quality slider */
    .quality-header-custom {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    /* Section titles */
    .section-title-custom {
        font-size: 0.9rem;
    }
}