/* Image Cropper Custom Styles */

/* Cropper.js overrides */
.cropper-container {
    border-radius: 0.75rem;
    overflow: hidden;
}

.cropper-view-box {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    border-radius: 4px;
}

.cropper-dashed {
    border-color: rgba(59, 130, 246, 0.5);
}

.cropper-center::before,
.cropper-center::after {
    background-color: #3b82f6;
}

.cropper-point {
    background-color: #3b82f6;
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 10px;
    height: 10px;
}

.cropper-point:hover {
    background-color: #2563eb;
    transform: scale(1.2);
}

.cropper-line {
    background-color: transparent;
}

.cropper-line:hover {
    background-color: rgba(59, 130, 246, 0.3);
}

/* Drop Zone Styles */
.drop-zone-active {
    border-color: #3b82f6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
}

.drop-zone-active #dropOverlay {
    opacity: 1;
}

/* Quality Range Slider */
#qualityRange {
    background: linear-gradient(to right, #ef4444 0%, #f59e0b 25%, #10b981 50%, #10b981 100%);
}

#qualityRange::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

#qualityRange::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

#qualityRange::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: none;
}

#qualityRange::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Preset Button Active State */
.preset-btn.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Processing Overlay Animation */
#processingOverlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

#processingOverlay .bg-white {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Upload Progress */
#progressBar {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    transition: width 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cropper-container {
        max-height: 400px;
    }

    .cropper-point {
        width: 12px;
        height: 12px;
    }

    #qualityRange::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    #qualityRange::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .cropper-point {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

/* Focus States for Accessibility */
.preset-btn:focus,
#browseBtn:focus,
#cropButton:focus,
#resetCrop:focus,
#newImage:focus,
#cropAnother:focus,
#downloadResult:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Image Preview Styles */
#croppedPreview {
    transition: transform 0.3s ease;
}

#croppedPreview:hover {
    transform: scale(1.02);
}

/* Result Cards */
#resultInfo,
.bg-blue-50 {
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
