/* Edge handles of the grid items stretched with the pointer: tasks of the daily planning (top and bottom edges) and
   events of the calendar (left and right edges). Behaviour in Shared/EdgeResize/EdgeResizeHost.razor.js. */

.edge-handle {
    position: absolute;
    z-index: 4;
    touch-action: none;
}

.edge-handle-y {
    left: 0;
    right: 0;
    height: 7px;
    cursor: ns-resize;
}

    .edge-handle-y.edge-start {
        top: 0;
    }

    .edge-handle-y.edge-end {
        bottom: 0;
    }

.edge-handle-x {
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
}

    .edge-handle-x.edge-start {
        left: 0;
    }

    .edge-handle-x.edge-end {
        right: 0;
    }

/* The grip: shown when the item is hovered, always on touch screens */
.edge-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    background-color: var(--gray-medium);
    opacity: 0;
    transition: opacity .15s;
}

.edge-handle-y::after {
    width: 2rem;
    height: 3px;
}

.edge-handle-x::after {
    width: 3px;
    height: 1.5rem;
}

[data-resize-item]:hover .edge-handle::after,
.edge-handle:hover::after,
.edge-resizing .edge-handle::after {
    opacity: 1;
}

.edge-handle:hover::after,
.edge-resizing .edge-handle::after {
    background-color: var(--main-color-1);
}

@media (hover: none) {
    .edge-handle::after {
        opacity: .6;
    }

    .edge-handle-y {
        height: 14px;
    }

    .edge-handle-x {
        width: 14px;
    }
}

/* The item being stretched, above its neighbours */
.edge-resizing {
    z-index: 5 !important;
    box-shadow: 0 0 0 2px var(--main-color-1);
}

body.edge-resizing-y,
body.edge-resizing-y * {
    cursor: ns-resize !important;
    user-select: none;
}

body.edge-resizing-x,
body.edge-resizing-x * {
    cursor: ew-resize !important;
    user-select: none;
}

/* The days an event will cover once its edge is dropped, in every week shown */
.edge-resize-day {
    background-color: var(--main-color-2-op) !important;
    box-shadow: inset 0 -3px 0 var(--main-color-1);
}

/* The new bounds, next to the pointer */
.edge-resize-label {
    position: fixed;
    z-index: 10000;
    padding: .2rem .5rem;
    border-radius: var(--r-md);
    background-color: var(--main-color-1);
    color: white;
    font-size: var(--fs-200);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 6px rgb(0 0 0 / .2);
}
