/* Material Design Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader-content {
    text-align: center;
    max-width: 300px;
}

.spinner-container {
    margin-bottom: 24px;
    position: relative;
    width: 70px;
    height: 70px;
}

.spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 5px solid transparent;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-inner {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 5px solid transparent;
    border-top-color: #bbdefb;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse;
}

.spinner-center {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1976d2;
    border-radius: 50%;
}

.spinner-center::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 50%;
}

.loader-text {
    color: #1976d2;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.loader-subtext {
    color: rgba(0, 0, 0, 0.6);
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(25, 118, 210, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 16px;
}

.progress-value {
    width: 0;
    height: 100%;
    background-color: #1976d2;
    border-radius: 2px;
    /* L'animazione verrà gestita via JavaScript per sincronizzarla con i timeout */
    transition: width 0.1s linear;
}

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

/* L'animazione progressAnimation è stata sostituita con animazione JavaScript */