/* Manual Compression Inline Styles */
.manual-compress-section {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f5f5fa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.manual-compress-section.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.manual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.manual-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #171717;
}

.manual-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #737373;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.manual-close:hover {
    color: #171717;
}

.manual-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Comparison Slider */
.comparison-container {
    position: relative;
    flex: 1;
    min-width: 400px;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f5f5f5;
    height: 330px;
}

/* Wrapper for scaling both images together */
.comparison-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transform: scale(1.2);
    transform-origin: center;
}

/* Both images share same base styling */
.comparison-image {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    object-fit: cover !important; /* Force cover to fill container */
    object-position: center;
}

/* Base compressed image */
#comparisonBase {
    z-index: 1;
}

/* Original image on top */
#comparisonOriginal {
    z-index: 2;
    clip-path: inset(0 0 0 50%); /* Initially show right 50% of original */
}

/* Overlay is just for interaction, not visual */
.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #f5f5fa;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
}

.comparison-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #f5f5fa;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    background: #f5f5fa;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
}

.comparison-slider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #171717;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}


/* Labels */
.comparison-labels {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.comparison-label {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Quality Slider */
.quality-controls {
    background: #f5f5fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    width: 200px; /* Reduced from 220px */
    flex-shrink: 0;
}

.quality-slider-container {
    margin-bottom: 15px;
}

.quality-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quality-label span {
    font-weight: 500;
    color: #171717;
}

.quality-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #171717;
    background: #f5f5fa;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
    display: inline-block;
}

.quality-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e5e5;
    border-radius: 4px;
    outline: none;
    transition: background 0.2s;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #171717;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.quality-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #171717;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

/* File Stats */
.file-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 0.75rem; /* Reduced from 0.875rem */
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
    font-weight: 600;
}

.stat-label {
    color: #666;
    font-size: 0.75rem; /* Explicitly set smaller */
}

.stat-value {
    font-weight: 500;
    color: #171717;
    font-size: 0.75rem; /* Reduced from default */
}

/* Action Buttons */
.manual-footer {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.size-info {
    font-size: 0.875rem;
    color: #525252;
}

.manual-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel {
    padding: 10px 24px;
    background: #f5f5fa;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-apply {
    padding: 10px 24px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-apply:hover {
    background: #0052a3;
}

/* Loading State */
.quality-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(245, 245, 250, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Responsive */
@media (min-width: 1024px) {
    .comparison-container {
        min-width: 500px; /* Larger minimum on desktop */
    }
}

@media (max-width: 768px) {
    .manual-compress-section {
        padding: 15px;
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .manual-body {
        flex-direction: column;
    }
    
    .quality-controls {
        width: 100%;
    }
    
    .comparison-container {
        max-width: 100%;
        min-width: auto;
    }
}