/* Before/After Image Comparison Slider */

.ba-slider {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    line-height: 0;
}

.ba-img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.ba-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.ba-img--before {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: 100%;
    max-width: none;
}

/* Handle */
.ba-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.ba-handle-line {
    flex: 1;
    width: 3px;
    background: var(--color-primary, #b4ff00);
    box-shadow: 0 0 6px rgba(180, 255, 0, 0.4);
}

.ba-handle-knob {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary, #b4ff00);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

/* Labels */
.ba-label {
    position: absolute;
    bottom: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 5;
    letter-spacing: 0.3px;
}

.ba-label--before {
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.ba-label--after {
    right: 12px;
    background: var(--color-primary, #b4ff00);
    color: #1a1a1a;
}

/* Zoom hint */
.ba-zoom-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.3s;
}

.ba-slider.ba-dragged .ba-zoom-hint {
    opacity: 0;
}

/* Fullscreen overlay */
.ba-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s;
}

.ba-overlay.active {
    opacity: 1;
}

.ba-overlay .ba-slider {
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    border-color: rgba(255, 255, 255, 0.2);
}

.ba-overlay .ba-slider .ba-img--after {
    max-height: 90vh;
    width: auto;
    max-width: 100%;
}

.ba-close {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.2s;
}

.ba-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 600px) {
    .ba-handle-knob {
        width: 32px;
        height: 32px;
    }

    .ba-handle-knob svg {
        width: 16px;
        height: 16px;
    }

    .ba-label {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .ba-overlay {
        padding: 8px;
    }
}
