
/* --- Overlay Global --- */
.loading-overlay {
    display: none; /* Remplacé par flex via JS */
    position: fixed;
    inset: 0;
    /* Fond sombre avec effet de flou moderne (Glassmorphism) */
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* --- Conteneur central --- */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px; /* S'adapte sur mobile */
    padding: 20px;
	
}

/* --- Wrapper du train --- */
.train-wrapper {
    position: relative;
    width: 250px; /* Plus large pour ce nouveau train */
    height: 80px; /* Plus haut pour le pantographe */
    margin-bottom: 30px;
}

/* --- Animation du Train --- */
.train-svg {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    animation: trainBounce 0.4s infinite alternate ease-in-out;
}
.light-beam {
    animation: pulseBeam 1.5s infinite alternate ease-in-out;
    transform-origin: 240px 68px;
}
@keyframes pulseBeam {
    0% { opacity: 0.4; transform: scaleX(0.95); }
    100% { opacity: 1; transform: scaleX(1.05); }
}
@keyframes trainBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

/* --- Animation du Phare --- */
.headlight {
    animation: pulseLight 1.5s infinite alternate;
}

@keyframes pulseLight {
    0% { opacity: 0.6; filter: drop-shadow(0 0 2px #fbbf24); }
    100% { opacity: 1; filter: drop-shadow(0 0 8px #fbbf24); }
}

.modern-track {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 4px;

    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.8) 0px,
        rgba(255, 255, 255, 0.8) 30px,
        transparent 30px,
        transparent 50px
    );
    background-size: 50px 100%;
    animation: moveTrack 0.3s linear infinite;
}

@keyframes moveTrack {
    0% { background-position: 50px 0; }
    100% { background-position: 0 0; }
}

/* --- Texte de chargement --- */
.loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
    display: block;
    height: 3.5rem;
    margin-top: 15px;
}


.loading-text.fade-out {
    opacity: 0;
}

.dots {
    display: inline-block;
    width: 1.5rem;
    text-align: left;
}

.dots::after {
    content: '';
    animation: typingDots 1.5s infinite step-start;
}

@keyframes typingDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}