/*
 * Image Editor — stili del componente components/image-editor/image-editor.js
 * Pulsante "modifica" nella modale, canvas di annotazione, barra strumenti editor.
 */

/* pulsante "modifica" nello stack in alto a destra della modale (sotto il download) */
.ky-image-modal-edit {
    position: absolute;
    top: 15rem;
    right: 1.5rem;
    z-index: 10001;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, .22);
    outline: none;
    touch-action: manipulation;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

.ky-image-modal-edit svg {
    width: 1.15rem;
    height: 1.15rem;
}

.ky-image-modal-edit:hover,
.ky-image-modal-edit.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 .35rem .8rem rgba(0, 0, 0, .3);
}

/* canvas di annotazione sovrapposto all'immagine */
.ky-image-editor-canvas {
    z-index: 5;
    cursor: crosshair;
    touch-action: none;
}

/* barra strumenti editor (in basso, al centro) */
.ky-image-editor-bar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .6rem;
    border-radius: .9rem;
    z-index: 10002;
    background: var(--background-popup, rgba(0, 0, 0, .6));
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(1rem);
    backdrop-filter: blur(1rem);
}

.ky-image-editor-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: .6rem;
    cursor: pointer;
    color: #2b2b2b;
    background: rgba(255, 255, 255, .22);
    outline: none;
    touch-action: manipulation;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

.ky-image-editor-bar button svg {
    width: 1.1rem;
    height: 1.1rem;
}

.ky-image-editor-bar button:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.ky-image-editor-bar button:active {
    transform: translateY(0) scale(.94);
}

/* strumento attivo evidenziato */
.ky-image-editor-bar button[data-tool].active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}

/* separatore fra gruppi di controlli */
.ky-editor-sep {
    width: 1px;
    height: 1.6rem;
    background: rgba(255, 255, 255, .3);
    margin: 0 .15rem;
}

/* selettore colore */
.ky-image-editor-bar .ky-editor-color {
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: .6rem;
    background: transparent;
    cursor: pointer;
}

/* selettore spessore */
.ky-image-editor-bar .ky-editor-width {
    width: 6rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* adattamento mobile */
@media (max-width: 768px) {
    .ky-image-modal-edit {
        top: 12rem;
    }

    .ky-image-editor-bar {
        flex-wrap: wrap;
        max-width: 92vw;
        justify-content: center;
    }

    .ky-image-editor-bar .ky-editor-width {
        width: 4rem;
    }
}
