﻿/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner {
    width: 40px;
    height: 40px;
    margin: 100px auto;
    background-color: var(--primary);
    border-radius: 100%;
    animation: sk-scaleout 1.0s infinite ease-in-out;
}

@keyframes sk-scaleout {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1.0);
        opacity: 0;
    }
}
/* ========================================
   LOADING SPINNER
   ======================================== */

/* Overlay per bloccare l'interfaccia durante il caricamento */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

    #loadingOverlay.show {
        display: flex !important;
    }

/* Container dello spinner */
.loading-spinner-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Spinner animato */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(4, 137, 177, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Testo sotto lo spinner */
.loading-text {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

/* Spinner inline (per tabelle) */
.spinner-inline {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid rgba(4, 137, 177, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

/* Spinner piccolo (per bottoni) */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner-rotate 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Stato loading del bottone cerca */
.cash-statistics-isolated .btn-search.loading {
    pointer-events: none;
    opacity: 0.7;
}

    .cash-statistics-isolated .btn-search.loading::before {
        content: '';
        display: inline-block;
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: white;
        border-radius: 50%;
        animation: spinner-rotate 0.6s linear infinite;
        margin-right: 8px;
        vertical-align: middle;
    }