/* ==========================================================================
   ADVANCED HERO - Parallax + Particles + Speed Effects
   ========================================================================== */

/* Hero Container with Parallax */
.hero-section-advanced {
    position: relative;
    height: 100vh;
    min-height: 700px;
    overflow: hidden;
    margin-top: 80px;
}

/* Multiple Background Layers for Parallax */
.hero-parallax-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    transform: translateZ(0);
}

.hero-parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.hero-parallax-layer-1 {
    transform: translateY(0);
    opacity: 0;
    animation: heroFadeIn 1.5s ease-out forwards;
}

.hero-parallax-layer-2 {
    transform: translateY(0);
    opacity: 0;
    animation: heroFadeIn 1.5s ease-out 0.5s forwards;
}

/* Particles Canvas */
#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Speed Lines Background */
.speed-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    opacity: 0.3;
}

.speed-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(227, 6, 19, 0.8), transparent);
    animation: speedLineMove 2s linear infinite;
}

.speed-line:nth-child(1) { top: 15%; width: 200px; animation-delay: 0s; }
.speed-line:nth-child(2) { top: 35%; width: 300px; animation-delay: 0.3s; }
.speed-line:nth-child(3) { top: 55%; width: 250px; animation-delay: 0.6s; }
.speed-line:nth-child(4) { top: 75%; width: 180px; animation-delay: 0.9s; }
.speed-line:nth-child(5) { top: 25%; width: 220px; animation-delay: 1.2s; }
.speed-line:nth-child(6) { top: 65%; width: 280px; animation-delay: 1.5s; }

@keyframes speedLineMove {
    0% {
        left: -300px;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Dynamic Gradient Overlay */
.hero-overlay-advanced {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    background: radial-gradient(ellipse at center, rgba(227, 6, 19, 0.3) 0%, rgba(26, 26, 26, 0.85) 50%, rgba(0, 0, 0, 0.95) 100%);
}

/* Animated Border Effect */
.hero-border-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.hero-border-line {
    position: absolute;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(227, 6, 19, 0.8), 
        rgba(255, 107, 53, 0.8), 
        transparent
    );
}

.hero-border-line.top {
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    animation: borderSlideRight 3s ease-in-out infinite;
}

.hero-border-line.bottom {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 3px;
    animation: borderSlideLeft 3s ease-in-out infinite;
}

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

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

/* Content Container with Enhanced Animations */
.hero-content-advanced {
    position: relative;
    z-index: 5;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}

.hero-content-inner {
    max-width: 1000px;
}

/* Glitch Effect for Title */
.hero-title-glitch {
    position: relative;
    font-size: 4.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--color-white);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-title-glitch::before,
.hero-title-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-title-glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--color-racing-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.hero-title-glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--color-racing-yellow);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(90px, 9999px, 10px, 0); }
    10% { clip: rect(50px, 9999px, 120px, 0); }
    20% { clip: rect(10px, 9999px, 80px, 0); }
    30% { clip: rect(130px, 9999px, 50px, 0); }
    40% { clip: rect(20px, 9999px, 140px, 0); }
    50% { clip: rect(100px, 9999px, 30px, 0); }
    60% { clip: rect(40px, 9999px, 110px, 0); }
    70% { clip: rect(120px, 9999px, 60px, 0); }
    80% { clip: rect(70px, 9999px, 20px, 0); }
    90% { clip: rect(30px, 9999px, 100px, 0); }
    100% { clip: rect(60px, 9999px, 90px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    10% { clip: rect(20px, 9999px, 140px, 0); }
    20% { clip: rect(120px, 9999px, 30px, 0); }
    30% { clip: rect(80px, 9999px, 70px, 0); }
    40% { clip: rect(10px, 9999px, 130px, 0); }
    50% { clip: rect(90px, 9999px, 40px, 0); }
    60% { clip: rect(50px, 9999px, 110px, 0); }
    70% { clip: rect(130px, 9999px, 20px, 0); }
    80% { clip: rect(40px, 9999px, 90px, 0); }
    90% { clip: rect(100px, 9999px, 60px, 0); }
    100% { clip: rect(30px, 9999px, 120px, 0); }
}

/* Subtitle with Neon Glow */
.hero-subtitle-neon {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--color-racing-yellow);
    margin-bottom: 1rem;
    text-shadow: 
        0 0 10px rgba(255, 210, 63, 0.8),
        0 0 20px rgba(255, 210, 63, 0.5),
        0 0 30px rgba(255, 210, 63, 0.3);
    animation: fadeInUp 1s ease-out 0.1s both, neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(255, 210, 63, 0.8),
            0 0 20px rgba(255, 210, 63, 0.5),
            0 0 30px rgba(255, 210, 63, 0.3);
    }
    50% {
        text-shadow: 
            0 0 15px rgba(255, 210, 63, 1),
            0 0 30px rgba(255, 210, 63, 0.8),
            0 0 45px rgba(255, 210, 63, 0.5);
    }
}

/* Description with Typing Effect */
.hero-description-typed {
    font-size: 1.3rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Enhanced CTA Buttons */
.hero-cta-advanced {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.7s both;
}

.btn-racing {
    position: relative;
    padding: 18px 45px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 50px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: 1;
}

.btn-racing::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn-racing:hover::before {
    width: 300px;
    height: 300px;
}

.btn-racing-primary {
    background: linear-gradient(135deg, var(--color-racing-red), var(--color-racing-orange));
    color: var(--color-white);
    box-shadow: 0 5px 20px rgba(227, 6, 19, 0.4);
}

.btn-racing-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(227, 6, 19, 0.6);
}

.btn-racing-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-racing-outline:hover {
    background: var(--color-white);
    color: var(--color-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    animation: fadeInUp 1s ease-out 1s both;
}

.scroll-indicator-icon {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    position: relative;
    cursor: pointer;
}

.scroll-indicator-icon::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 10px;
    background: var(--color-racing-red);
    border-radius: 3px;
    transform: translateX(-50%);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        top: 10px;
        opacity: 1;
    }
    50% {
        top: 25px;
        opacity: 0.5;
    }
}

.scroll-indicator-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
    font-weight: 600;
}

/* Floating Elements */
.floating-element {
    position: absolute;
    z-index: 2;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.floating-element-1 {
    top: 10%;
    left: 10%;
    font-size: 100px;
    color: var(--color-racing-red);
    animation-delay: 0s;
}

.floating-element-2 {
    top: 70%;
    right: 15%;
    font-size: 80px;
    color: var(--color-racing-yellow);
    animation-delay: 1s;
}

.floating-element-3 {
    bottom: 20%;
    left: 20%;
    font-size: 90px;
    color: var(--color-racing-orange);
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

/* Fade In Animation */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Adjustments */
@media (max-width: 968px) {
    .hero-title-glitch {
        font-size: 3rem;
    }
    
    .hero-subtitle-neon {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    .hero-description-typed {
        font-size: 1.1rem;
    }
    
    .btn-racing {
        padding: 15px 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .hero-section-advanced {
        min-height: 600px;
    }
    
    .hero-title-glitch {
        font-size: 2rem;
    }
    
    .hero-subtitle-neon {
        font-size: 0.9rem;
    }
    
    .hero-description-typed {
        font-size: 1rem;
    }
    
    .hero-cta-advanced {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-racing {
        width: 100%;
        padding: 15px 30px;
    }
}
