/* Eye Editor (/eye-color-changer): the photo with the edited eyes on the stage (the circles drawn on it), the looks as
   chips, the colors as round swatches. Panels, sliders, chips and buttons come from the app kit. */

/* The stage shows the theme's checkerboard (--component-checkerboard in root.css), like the other photo apps. */
.eye-color-changer-landing-app.ak-app > .filter-landing-stage.ak-stage {
    background: var(--component-checkerboard);
}

/* The picture, straight on the stage: the script sets its shape (--eye-aspect, the photo's). A photo can be dropped on
   the stage; the circles on the eyes are dragged with the pointer, so the page does not scroll under a finger there. */
.eye-color-changer-landing-app .eye-frame {
    position: relative;
    width: 100%;
    max-width: min(760px, calc(68vh * var(--eye-aspect, 1)));
}

.eye-color-changer-landing-app .eye-canvas {
    display: block;
    width: 100%;
    aspect-ratio: var(--eye-aspect, 1);
    border-radius: var(--ak-radius-sm, 6px);
    touch-action: none;
}

/* Looking for the eyes, or none found: a line over the bottom of the picture. */
.eye-color-changer-landing-app .eye-status {
    position: absolute;
    left: 50%;
    bottom: 0.75rem;
    max-width: calc(100% - 1.5rem);
    margin: 0;
    padding: 0.3rem 0.75rem;
    border-radius: var(--ak-radius-pill, 999px);
    background: rgba(0, 0, 0, 0.62);
    color: #ffffff;
    font-size: var(--ak-fs-xs, 0.75rem);
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
}

.eye-color-changer-landing-app .eye-status[hidden] {
    display: none;
}

/* The colors: round swatches; Original is the iris of a photo (a split of brown and blue), Custom the color picked. */
.eye-color-changer-landing-app .eye-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.eye-color-changer-landing-app .eye-swatch {
    --eye-swatch: #888888;
    position: relative;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--ak-text) 25%, transparent);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #111111 0 22%, transparent 24%),
        radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--eye-swatch) 80%, #ffffff) 0 40%, var(--eye-swatch) 62%, color-mix(in srgb, var(--eye-swatch) 70%, #000000) 100%);
    cursor: pointer;
}

.eye-color-changer-landing-app .eye-swatch--original {
    --eye-swatch: #6d5a3c;
    background:
        radial-gradient(circle at 50% 50%, #111111 0 22%, transparent 24%),
        conic-gradient(#7a4a2a 0 25%, #4a86d0 0 50%, #5aa866 0 75%, #9c7e40 0);
}

.eye-color-changer-landing-app .eye-swatch--custom::after {
    content: "+";
    position: absolute;
    right: -0.2rem;
    bottom: -0.25rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--ak-accent, #2563eb);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 0.9rem;
    text-align: center;
}

.eye-color-changer-landing-app .eye-swatch:hover {
    transform: scale(1.08);
}

.eye-color-changer-landing-app .eye-swatch[aria-checked="true"] {
    box-shadow: 0 0 0 2px var(--ak-panel, #ffffff), 0 0 0 4px var(--ak-accent, #2563eb);
}

.eye-color-changer-landing-app .eye-swatch:focus-visible {
    outline: 2px solid var(--ak-accent, #2563eb);
    outline-offset: 3px;
}

.eye-color-changer-landing-app .eye-custom-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.eye-color-changer-landing-app .eye-custom-row[hidden] {
    display: none;
}

.eye-color-changer-landing-app .eye-color-input {
    width: 2.5rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm, 6px);
    background: none;
    cursor: pointer;
}

/* The pupils: seven buttons that wrap. */
.eye-color-changer-landing-app .eye-pupils {
    flex-wrap: wrap;
}

.eye-color-changer-landing-app .eye-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Compare is held: it shows pressed while the original shows. */
.eye-color-changer-landing-app [data-ak-ref="compare"] {
    touch-action: none;
    user-select: none;
}

.eye-color-changer-landing-app [data-ak-ref="compare"][aria-pressed="true"] {
    background: var(--ak-accent, #2563eb);
    color: #ffffff;
}
