﻿/* -------- Image Cropper Overlay -------- */

.crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--pill-gap);
}

.crop-container {
    background: #ffffff;
    border-radius: var(--medium-gap);
    padding: var(--medium-gap) var(--pill-gap) var(--pill-gap) var(--pill-gap);
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--pill-gap);
}

.crop-container h3 {
    padding-top: 0;
    margin: 0;
}

/* -------- Crop Viewport -------- */

.crop-viewport {
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: none;
    border-radius: var(--pill-gap);
    border: 1px solid var(--text-color);
    background: var(--gray-bg);
}

.crop-viewport:active {
    cursor: grabbing;
}

.crop-viewport--logo {
    width: min(80vw, 400px);
    aspect-ratio: 1 / 1;
}

.crop-viewport--banner {
    width: min(90vw, 800px);
    aspect-ratio: 4 / 1;
}

.crop-viewport--profile {
    width: min(80vw, 300px);
    aspect-ratio: 2 / 3;
}

.crop-viewport img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    /* pointer events should go to the viewport not the image */
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* -------- Buttons -------- */

.crop-buttons {
    display: flex;
    gap: var(--pill-gap);
    justify-content: flex-end;
    width: 100%;
    flex-wrap: wrap;
}

/* -------- Widget Preview -------- */

/*
    Widget is hidden, when checkbox "remove img" is checked
*/

.crop-widget-preview--hidden {
    display: none !important;
}
