/* Manual Compression Mode - Professional Style */

.manual-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.manual-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.manual-container {
    width: 90%;
    max-width: 900px;
    height: auto;
    max-height: 75vh;
    background: #f5f5fa;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Top Section - Image Comparison */
.manual-left {
    background: #f5f5fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    position: relative;
    flex: 1;
    min-height: 350px;
}

/* Comparison Container */
.comparison-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Side by Side Images */
.images-side-by-side {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.image-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f5f5fa;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 350px;
    max-width: 350px;
}

/* Image container to handle overflow */
.image-container {
    width: 320px;
    height: 250px;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
    order: 0;
}

.comparison-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: move;
    transition: object-position 0.1s ease;
    transform: scale(2.5);  /* Zoom for detail inspection */
    transform-origin: center;
}

.image-label {
    margin-bottom: 10px;
    color: #0061eb;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-align: center;
    order: -1;  /* Move to top */
}

.image-size {
    margin-top: 10px;
    font-size: 13px;
    color: #0061eb;
    font-weight: 600;
    text-align: center;
    order: 1;  /* Move to bottom */
}

/* Bottom Section - Controls */
.manual-right {
    padding: 1rem 2rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5fa;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.manual-close,
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #0061eb;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
    line-height: 1;
    z-index: 100;
}

.manual-close:hover,
.close-btn:hover {
    background: #0051c7;
}

.manual-header {
    margin-bottom: 0.75rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.manual-header h2 {
    font-size: 1.1rem;
    color: #1f2937;
    margin: 0;
    font-weight: 600;
}

.quality-info {
    display: none;
}

/* Quality Control Slider */
.quality-control {
    margin: 0 0 0.75rem 0;
    max-width: 400px;
    width: 100%;
}

.quality-control label {
    display: none;
}

/* Savings Display */
.size-info {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 400px;
}

.savings-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f5f5fa;
    border-radius: 8px;
}

.savings-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.savings-value {
    font-size: 16px;
    color: #0061eb;
    font-weight: 700;
}

.slider-container {
    position: relative;
    width: 100%;
}

#qualitySlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#qualitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0061eb;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#qualitySlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0061eb;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

.quality-value {
    color: #0061eb;
    font-weight: 600;
}

/* Size Preview - Removed as not used */
.size-preview {
    display: none;
}

.size-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.size-row span:first-child {
    color: #6b7280;
}

.size-row span:last-child {
    color: #1f2937;
    font-weight: 500;
}

.size-row .highlight {
    color: #0061eb;
    font-weight: 600;
}

.size-row .saved {
    color: #0061eb;
    font-weight: 600;
}

/* Compress Button - Refined Style */
.compress-button,
.apply-btn {
    background: #0061eb;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
    text-transform: none;
    letter-spacing: 0.02em;
}

.compress-button:hover,
.apply-btn:hover {
    background: #0051c7;
}

.compress-button:active,
.apply-btn:active {
    background: #0051c7;
}

.compress-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Controls wrapper for centering */
.manual-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .manual-container {
        flex-direction: column;
        height: 90vh;
        max-height: 90vh;
    }
    
    .manual-left {
        min-height: 300px;
        padding: 1rem;
    }
    
    .manual-right {
        width: 100%;
        overflow-y: auto;
        padding: 1rem;
    }
    
    .images-side-by-side {
        gap: 20px;
    }
    
    .image-box {
        width: 300px;
        padding: 10px;
    }
    
    .image-container {
        width: 280px;
        height: 220px;
    }
}