﻿/* Make all elements that can receive htmx-request positioned relatively */
.htmx-container {
    position: relative;
}

/* Overlay with spinner applied to any element with htmx-request class */
.htmx-request::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
}

/* Spinner animation added to the center of any htmx-request element */
.htmx-request::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid #ddd;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    z-index: 1001;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

[data-no-preserve] {
    display: none;
}