:root {
    --position: 50%;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden; /* Prevent scrolling on mobile */
    height: 100dvh;
    width: 100vw;
}

#juxtapose-container {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: none; /* crucial for smooth touch dragging */
    cursor: ew-resize;
}

#img-after, #img-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Prevent images from interfering with drag events */
}

#img-before {
    /* Use clip-path to reveal a percentage of the left image based on a CSS variable */
    clip-path: polygon(0 0, var(--position) 0, var(--position) 100%, 0 100%);
}

#slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position);
    width: 4px;
    background: #fff;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    color: #111;
}

.slider-button svg {
    width: 18px;
    height: 18px;
}

/* Subtly nudge icons inward for better visual balance */
.slider-button svg:first-child { margin-right: -4px; }
.slider-button svg:last-child { margin-left: -4px; }

.prominent-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 15, 20, 0.85);
    color: #00d2ff;
    padding: 16px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    z-index: 50;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Let drag events pass through to container */
}

.prominent-banner a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
    pointer-events: auto; /* Keep the email link clickable */
}

.prominent-banner a:hover {
    color: #00d2ff;
}

.controls {
    position: absolute;
    bottom: 32px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 20;
    pointer-events: none; /* Let container handle drags passing through empty space */
}

.upload-btn {
    pointer-events: auto;
    background: rgba(20, 20, 20, 0.75);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.upload-btn:active {
    transform: scale(0.96);
    background: rgba(20, 20, 20, 0.9);
}

.upload-btn svg {
    width: 18px;
    height: 18px;
}

.upload-btn input {
    display: none;
}