.image-compare {
    position: relative;
    overflow: hidden;
    margin: 0;

    &.full {
        overflow: hidden;
        flex: 1;
        width: 100%;
        height: 100%;

        img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
    }

    img {
        display: block;
        max-width: none;
    }

    .after-name,
    .before-name {
        font-size: 1rem;
        position: absolute;
        bottom: 0;
        overflow: hidden;
        padding: 0.5rem 1rem;
        white-space: nowrap;
        text-overflow: ellipsis;
        pointer-events: none;
        background-color: white;

        .size {
            font-family: monospace;
            font-size: 1.2rem;
            margin-top: 2px;
            color: gray;
        }
    }

    .after-name {
        z-index: 5;
        left: 0;
        border-top-right-radius: 0.75rem;
    }

    .before-name {
        right: 0;
        border-top-left-radius: 0.75rem;

        .size {
            text-align: right;
        }
    }

    .dropzone {
        font-size: 50px;
        position: absolute;
        z-index: 10;
        top: 0;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        pointer-events: none;
        opacity: 0;
        color: white;
        background-color: rgba(black, 0.5);

        &.visible {
            pointer-events: all;
            opacity: 1;
        }
    }
}

.image-compare-wrapper,
.image-compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
}

.image-compare-wrapper {
    z-index: 1;
    left: 0;
    overflow: hidden;
    width: 100%;
    transform: translateZ(0);
    will-change: width;
}

.image-compare-handle {
    z-index: 2;
    width: 2px;
    cursor: ew-resize;
    transform: translateX(-50%) translateZ(0);
    color: #fff;
    background-color: currentColor;
    will-change: left;
}

.image-compare-handle-icon {
    font-size: 2rem;
    line-height: normal;
    position: absolute;
    top: 50%;
    left: 50%;
    color: currentColor;

    &.left {
        padding-right: 10px;
        transform: translate(-100%, -50%);
    }

    &.right {
        padding-left: 10px;
        transform: translate(0, -50%);
    }
}
