
/* 
	Aggiungere spinner al turbo frame per visualizzare uno spinner 
	Turbo mette automaticamente busy
	Mette lo spinner solo nel primo div che incontra dopo quello con busy spinner
*/

@keyframes spinner {
	to {
		transform:rotate(360deg);
	}
}

[busy][spinner] > div:first-of-type {
	position: relative;
}

[busy][spinner] > * {
	opacity: 0.25;
}

[busy][spinner] > div:first-of-type::after {
	content: '';
    box-sizing: border-box;
    position: absolute;
    
    /* Centratura Perfetta */
    top: 50%;      /* Sposta al centro verticale */
    left: 50%;     /* Sposta al centro orizzontale */
    width: 4rem;
    height: 4rem;
    
    /* Offset pari a metà della dimensione */
    margin-top: -2rem;  
    margin-left: -2rem; 
    
    border-radius: 50%;
    border: 0.275rem solid rgba(237, 233, 254, 0.7);
    border-top-color: var(--h-dark-blu-color);
    animation: spinner 0.6s linear infinite;
    z-index: 10;
}

/* Spinner generico */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

.spinner {
    animation: spin 2s linear infinite;
}

/* Loader a piena pagina */

#loader_container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #246da2;
    opacity: 0.8;
    z-index: 9999;

    /* Flexbox per centrare tutto */
    display: flex;
    flex-direction: column; /* Dispone testo e cerchio in verticale */
    justify-content: center; /* Centra verticalmente */
    align-items: center;    /* Centra orizzontalmente */
    gap: 20px;              /* Spazio tra il testo e il loader */
}

.loader_text {
    color: white;
    font-size: 24px;
    font-family: arial;
    font-weight: bold;
}

.loader {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #feba02;
    border-bottom: 16px solid #feba02;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}