/* 🍕 Animation de chargement avec tranche de pizza */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.loading-container {
    text-align: center;
    color: white;
    font-family: 'Arial', sans-serif;
}

.pizza-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.pizza-icon {
    width: 100%;
    height: 100%;
    /* Utilise vos images de favicon par ordre de préférence */
    background-image: url('images/apple-touch-icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    animation: spin 2s linear infinite;
    filter: drop-shadow(0 0 20px rgba(255, 140, 0, 0.5));
}

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

.loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-subtext {
    font-size: 14px;
    color: #cccccc;
    max-width: 300px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #ff8c00;
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation d'apparition */
.loading-container {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Variantes de couleur pour différents contextes */
.loading-overlay.rest-theme .pizza-icon {
    filter: drop-shadow(0 0 20px rgba(255, 87, 34, 0.5));
}

.loading-overlay.rest-theme .loading-dots span {
    background: #ff5722;
}

.loading-overlay.hateoas-theme .pizza-icon {
    filter: drop-shadow(0 0 20px rgba(63, 81, 181, 0.5));
}

.loading-overlay.hateoas-theme .loading-dots span {
    background: #3f51b5;
}

/* Responsive */
@media (max-width: 768px) {
    .pizza-spinner {
        width: 60px;
        height: 60px;
    }
    
    .loading-text {
        font-size: 16px;
    }
    
    .loading-subtext {
        font-size: 12px;
        max-width: 250px;
    }
}
