/* BA Image Compare — Frontend */

.baic-compare {
    position: relative;
    overflow: hidden;
    line-height: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: col-resize;
    border-radius: 6px;
}
.baic-dir-vertical.baic-compare { cursor: row-resize; }

/* Layers */
.baic-compare img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}
.baic-layer--before {
    position: relative;
    z-index: 0;
}
.baic-layer--after {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
.baic-layer--after img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

/* Labels */
.baic-label {
    position: absolute;
    bottom: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    pointer-events: none;
    z-index: 5;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.baic-label--before { left: 12px; }
.baic-label--after  { right: 12px; }
.baic-dir-vertical .baic-label--before { left: 12px; bottom: auto; top: 12px; }
.baic-dir-vertical .baic-label--after  { right: auto; left: 12px; bottom: 12px; }

/* Handle */
.baic-handle {
    position: absolute;
    top: 0;
    z-index: 3;
    pointer-events: none;
}

/* Horizontal handle */
.baic-dir-horizontal .baic-handle {
    width: 0; height: 100%;
    transform: translateX(-50%);
}
.baic-dir-horizontal .baic-handle__line {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 3px; height: 100%;
    background: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
}
.baic-dir-horizontal .baic-handle__grip {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}

/* Vertical handle */
.baic-dir-vertical .baic-handle {
    left: 0; width: 100%; height: 0;
    transform: translateY(-50%);
}
.baic-dir-vertical .baic-handle__line {
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    height: 3px; width: 100%;
    background: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
}
.baic-dir-vertical .baic-handle__grip {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%,-50%) rotate(90deg);
}

/* Grip circle */
.baic-handle__grip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    border: 2px solid #fff;
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.15s ease, background 0.15s ease;
}
.baic-dragging .baic-handle__grip {
    transform: translate(-50%,-50%) scale(1.12);
    background: rgba(0,0,0,0.5);
}
.baic-dir-vertical .baic-dragging .baic-handle__grip {
    transform: translate(-50%,-50%) rotate(90deg) scale(1.12);
}

/* Hidden range input for accessibility */
.baic-range-input {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    margin: 0; padding: 0;
    opacity: 0;
    cursor: inherit;
    z-index: 4;
}
.baic-range-input:focus-visible ~ .baic-handle .baic-handle__grip {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
}
