/* ==========================================================================
   Veistin Preloader - Animação de Carregamento
   Cores: Azul (#035cd4) e Verde (#22c55e) - Tema Veistin
   ========================================================================== */

/* Container do Preloader */
#veistin-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #035cd4 0%, #0247a8 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#veistin-preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

/* Container da Animação */
.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Logo Animado */
.preloader-logo {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -1px;
    animation: logoFade 1.5s ease-in-out infinite;
}

.preloader-logo span {
    color: #22c55e;
    animation: logoHighlight 1.5s ease-in-out infinite;
}

@keyframes logoFade {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

@keyframes logoHighlight {
    0%, 100% { color: #22c55e; }
    50% { color: #4ade80; }
}

/* Animação de Carros (Dots em movimento) */
.preloader-animation {
    display: flex;
    gap: 8px;
    align-items: center;
}

.preloader-dot {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.preloader-dot:nth-child(1) { animation-delay: 0s; }
.preloader-dot:nth-child(2) { animation-delay: 0.2s; }
.preloader-dot:nth-child(3) { animation-delay: 0.4s; }
.preloader-dot:nth-child(4) { animation-delay: 0.6s; }
.preloader-dot:nth-child(5) { animation-delay: 0.8s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        background-color: rgba(255, 255, 255, 0.4);
    }
    40% {
        transform: scale(1);
        background-color: #22c55e;
    }
}

/* Ícone de Carro Animado */
.preloader-car {
    position: relative;
    width: 80px;
    height: 40px;
}

.car-body {
    position: absolute;
    width: 60px;
    height: 20px;
    background: #ffffff;
    border-radius: 10px 30px 5px 5px;
    top: 5px;
    left: 10px;
    animation: carMove 2s ease-in-out infinite;
}

.car-body::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px 8px 0 0;
    top: -10px;
    left: 15px;
}

.car-wheel {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #1a1a1a;
    border-radius: 50%;
    bottom: 0;
    animation: wheelSpin 0.5s linear infinite;
}

.car-wheel::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.car-wheel.front { left: 55px; }
.car-wheel.back { left: 15px; }

@keyframes carMove {
    0%, 100% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
}

@keyframes wheelSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Barra de Progresso */
.preloader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.preloader-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 2px;
    animation: progressLoad 2s ease-in-out infinite;
}

@keyframes progressLoad {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Texto de Carregamento */
.preloader-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Responsivo */
@media (max-width: 768px) {
    .preloader-logo {
        font-size: 36px;
    }
    
    .preloader-car {
        transform: scale(0.8);
    }
    
    .preloader-progress {
        width: 150px;
    }
}
