/**
 * GenerAuto - Motion Design & 3D Luxury Experience
 * Camada Premium de Animações, Efeitos 3D, Parallax e Preloader de Luxo
 */

/* ==========================================================================
   1. PRELOADER CINEMATOGRÁFICO DE LUXO COM LOGO
   ========================================================================== */
#generauto-preloader {
    will-change: opacity, transform;
}

@keyframes preloaderLogoGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(229, 9, 20, 0.65));
    }
    50% {
        transform: scale(1.04);
        filter: drop-shadow(0 0 35px rgba(229, 9, 20, 0.95)) drop-shadow(0 0 60px rgba(255, 50, 75, 0.4));
    }
}

.preloader-logo-wrap img {
    animation: preloaderLogoGlow 2s ease-in-out infinite;
    will-change: transform, filter;
}

/* ==========================================================================
   2. HARDWARE ACCELERATION & PERSPECTIVA 3D
   ========================================================================== */
.perspective-container {
    perspective: 1200px;
    -webkit-perspective: 1200px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.perspective-grid {
    perspective: 1400px;
    transform-style: preserve-3d;
}

.will-change-transform {
    will-change: transform, opacity;
}

/* ==========================================================================
   3. 3D TILT & AMBIENT GLARE EFFECT NOS CARDS DE VEÍCULOS E SERVIÇOS
   ========================================================================== */
.featured-card,
.vehicle-card-item,
.service-card,
.differential-card-item,
.cta-feature-pill {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.35s ease, border-color 0.3s ease;
    position: relative;
}

/* Efeito de Reflexo / Glare Dinâmico que segue o mouse */
.card-glare-effect {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(
        circle 240px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.18),
        rgba(229, 9, 20, 0.08) 45%,
        transparent 75%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: overlay;
    z-index: 25;
}

.featured-card:hover .card-glare-effect,
.vehicle-card-item:hover .card-glare-effect,
.service-card:hover .card-glare-effect,
.differential-card-item:hover .card-glare-effect,
.cta-feature-pill:hover .card-glare-effect {
    opacity: 1;
}

/* Borda com iluminação neon sutil ao passar o mouse */
.featured-card:hover,
.vehicle-card-item:hover {
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.75), 0 0 30px -5px rgba(229, 9, 20, 0.35) !important;
    border-color: rgba(229, 9, 20, 0.6) !important;
}

.service-card:hover {
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.25), 0 0 20px -3px rgba(229, 9, 20, 0.3) !important;
}

/* ==========================================================================
   4. EFEITO MAGNÉTICO EM BOTÕES DE AÇÃO
   ========================================================================== */
.btn-magnetic {
    display: inline-flex;
    will-change: transform;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   5. ILUMINAÇÃO NEON PULSANTE DE AMBIENTE (SHOWROOM GLOW)
   ========================================================================== */
@keyframes ambientGlowPulse {
    0%, 100% {
        opacity: 0.18;
        transform: scale(1);
    }
    50% {
        opacity: 0.32;
        transform: scale(1.08);
    }
}

.hero-ambient-glow {
    animation: ambientGlowPulse 5s ease-in-out infinite;
    will-change: transform, opacity;
}

/* ==========================================================================
   6. TRANSIÇÃO ELEGANTE ENTRE PÁGINAS (LUXURY CURTAIN)
   ========================================================================== */
#luxury-page-transition {
    position: fixed;
    inset: 0;
    background: #08080a;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.32s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#luxury-page-transition.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

#luxury-page-transition .transition-glow {
    width: 240px;
    height: 3.5px;
    background: linear-gradient(90deg, transparent, #e50914, #ff334b, transparent);
    box-shadow: 0 0 25px #e50914;
    border-radius: 9999px;
    animation: transitionPulse 0.6s infinite alternate ease-in-out;
}

@keyframes transitionPulse {
    0% { transform: scaleX(0.7); opacity: 0.6; }
    100% { transform: scaleX(1.3); opacity: 1; }
}
