/* ==========================================================================
   AI Image Background Remover Stylesheet
   Before/After Comparison Slider, Checkerboard & Color Swatches
   ========================================================================== */

/* Transparent Checkerboard Background */
.checkerboard-pattern {
    background-color: #ffffff;
    background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                      linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                      linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.dark .checkerboard-pattern {
    background-color: #0f172a;
    background-image: linear-gradient(45deg, #1e293b 25%, transparent 25%),
                      linear-gradient(-45deg, #1e293b 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #1e293b 75%),
                      linear-gradient(-45deg, transparent 75%, #1e293b 75%);
}

/* Comparison Slider Container */
.comparison-container {
    position: relative;
    width: 100%;
    max-height: 520px;
    min-height: 380px;
    border-radius: 20px;
    overflow: hidden;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}

.comparison-image {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
}

/* Before Layer (Clipped to slider percentage) */
.comparison-before-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* Slider Handle & Divider Line */
.comparison-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 20;
    transition: none !important;
}

.comparison-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6366f1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5), 0 0 0 3px #ffffff;
    cursor: ew-resize;
    pointer-events: auto;
    z-index: 30;
}

/* Color Swatches */
.color-swatch-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-swatch-btn:hover {
    transform: scale(1.1);
}

.color-swatch-btn.active {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
}

/* Pulse Glow during processing */
@keyframes ai-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.ai-processing-active {
    animation: ai-pulse 2s infinite ease-in-out;
}
