/**
 * Image Marker Field styles.
 *
 * Selectors are class-based. The previous #imageCanvas / #resetCanvas / #undoCanvas
 * rules never matched on the front end, where the ids carry a field-id suffix
 * (imageCanvas_7, resetCanvas_7), so the canvas border, crosshair cursor and
 * button styling silently did nothing outside the form editor.
 */

.gf-image-marker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.gf-image-marker-container .canvas-wrapper {
    width: 100%;
}

.gf-image-marker-container canvas {
    border: 2px solid #000;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Keyboard users need to see which canvas has focus. */
.gf-image-marker-container canvas:focus-visible {
    outline: 3px solid #0b5cff;
    outline-offset: 2px;
}

.gf-image-marker-container img {
    user-select: none;
    -webkit-user-select: none;
}

.gf-image-marker-instructions {
    font-size: 0.85em;
    line-height: 1.4;
    margin: 0 0 8px;
    max-width: 60ch;
    text-align: center;
    opacity: 0.8;
}

.marker-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.marker-buttons button {
    padding: 8px 12px;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
}

.marker-buttons button:focus-visible {
    outline: 3px solid #0b5cff;
    outline-offset: 2px;
}

.gf-image-marker-reset {
    background-color: #c62828;
}

.gf-image-marker-reset:hover {
    background-color: #8e0000;
}

.gf-image-marker-undo {
    background-color: #1565c0;
}

.gf-image-marker-undo:hover {
    background-color: #003c8f;
}

/* Announcements for screen readers; visible to them, out of the way visually. */
.gf-image-marker-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.gf-image-marker-unlicensed {
    border: 1px dashed #ccd0d4;
    background: #f6f7f7;
    padding: 24px;
    text-align: center;
    color: #50575e;
}

.gf-image-marker-unlicensed p {
    margin: 0;
}

.gf-image-marker-license-notice {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px;
    margin: 10px 0;
    color: #856404;
    text-align: center;
}

/* Form editor field settings */
.update-size-button,
.match-aspect-button {
    margin-top: 5px;
    padding: 6px 10px;
    background-color: #2e7d32;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    border-radius: 3px;
}

.update-size-button:hover {
    background-color: #1b5e20;
}

.match-aspect-button {
    background-color: #ef6c00;
}

.match-aspect-button:hover {
    background-color: #b53d00;
}
