/* ============================================================
   Fluxeos Image Comparator — Frontend styles
   ============================================================ */

/* Wrapper optionnel gérant la largeur */
.fluxeos-comparator-wrap {
    display: block;
    max-width: 100%;
}

.fluxeos-comparator {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    cursor: ew-resize;
    background: #111;
}

/* ---- Images ----------------------------------------------- */

.fluxeos-comp-after,
.fluxeos-comp-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fluxeos-comp-after img,
.fluxeos-comp-before img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* ---- Masque clip-path (AVANT) — les deux images gardent leur taille réelle */

.fluxeos-comp-before {
    clip-path: inset(0 50% 0 0);
    will-change: clip-path;
}

/* ---- Ligne de séparation ---------------------------------- */

.fluxeos-comp-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 3px;
    background: rgba(255, 255, 255, .85);
    transform: translateX(-50%);
    will-change: left;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ligne glow subtile */
.fluxeos-comp-handle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, .3);
    box-shadow: 0 0 8px rgba(255, 255, 255, .5);
}

/* ---- Cercle de la poignée --------------------------------- */

.fluxeos-comp-handle-circle {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fluxeos-comparator:active .fluxeos-comp-handle-circle,
.fluxeos-comparator.dragging .fluxeos-comp-handle-circle {
    transform: scale(1.12);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .4);
}

.fluxeos-comp-handle-circle svg {
    width: 16px;
    height: 16px;
    color: #555;
    flex-shrink: 0;
}

/* ---- Étiquettes avant / après ----------------------------- */

.fluxeos-comp-label {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 12px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    white-space: nowrap;
    transition: left .05s linear;
}

/* ---- Message d'erreur ------------------------------------- */

.fluxeos-error {
    color: #c0392b;
    font-style: italic;
    padding: 8px 0;
}
