/* Simple Image Comparison Widget */
.simple-comparison-widget {
    width: 100%;
    height: 100%;
    position: relative;
}

.simple-comparison-view {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-comparison-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 600px;
    overflow: hidden;
    background: transparent;
}

/* Images Container */
.simple-comparison-after,
.simple-comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-comparison-after {
    z-index: 1;
}

.simple-comparison-before {
    z-index: 2;
    pointer-events: none;
}

.simple-comparison-before-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: inset(0 50% 0 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Images */
.simple-comparison-after img,
.simple-comparison-before-inner img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* For bike images specifically */
.simple-comparison-after img,
.simple-comparison-before-inner img {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

/* Slider Handle */
.simple-comparison-handle {
    position: absolute;
    top: 0;
    width: 48px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    left: 50%;
    transform: translateX(-50%);
    transition: none;
}

.simple-comparison-handle-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

.simple-comparison-handle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.simple-comparison-handle-button svg {
    width: 24px;
    height: 24px;
    color: #333;
}

/* Hover Effects */
.simple-comparison-handle:hover .simple-comparison-handle-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.simple-comparison-handle:hover .simple-comparison-handle-line {
    background: #4CAF50;
}

/* Active/Dragging State */
.simple-comparison-widget.is-dragging .simple-comparison-handle-button {
    transform: translate(-50%, -50%) scale(0.95);
}

.simple-comparison-widget.is-dragging .simple-comparison-handle-line {
    background: #4CAF50;
}

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

.simple-label {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.simple-label.before-label {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.simple-label.after-label {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Hide labels on mobile for more space */
@media (max-width: 576px) {
    .simple-comparison-labels {
        display: none;
    }
}

/* Focus State for Accessibility */
.simple-comparison-widget:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* When used inside GASP ScrollTrigger */
.gasp-image-area .simple-comparison-widget {
    width: 100%;
    height: 100%;
}

.gasp-image-step .simple-comparison-view {
    min-height: 100%;
}

.gasp-image-area .simple-image-comparison {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .simple-comparison-handle {
        width: 40px;
    }
    
    .simple-comparison-handle-button {
        width: 40px;
        height: 40px;
    }
    
    .simple-comparison-handle-button svg {
        width: 20px;
        height: 20px;
    }
    
    .simple-comparison-handle-line {
        width: 3px;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.simple-comparison-widget {
    animation: fadeIn 0.5s ease-in;
}

/* Ensure proper layering in complex layouts */
.simple-comparison-wrapper * {
    box-sizing: border-box;
}

/* Prevent text selection during drag */
.simple-comparison-widget.is-dragging {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}