/* ========================================
   MUSTANG FENCING AND GATES - ANIMATIONS
   Scroll Animations & Effects
   ======================================== */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Rotate Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(212, 175, 55, 0.6);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

/* ===== SCROLL ANIMATION CLASSES ===== */

/* Base State - Hidden */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

/* Animated State - Visible */
[data-aos].aos-animate {
    opacity: 1;
}

/* Fade Up */
[data-aos="fade-up"] {
    transform: translateY(50px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

/* Fade Down */
[data-aos="fade-down"] {
    transform: translateY(-50px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

/* Fade Left */
[data-aos="fade-left"] {
    transform: translateX(50px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

/* Fade Right */
[data-aos="fade-right"] {
    transform: translateX(-50px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* Zoom In */
[data-aos="zoom-in"] {
    transform: scale(0.6);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* Zoom In Up */
[data-aos="zoom-in-up"] {
    transform: scale(0.6) translateY(50px);
}

[data-aos="zoom-in-up"].aos-animate {
    transform: scale(1) translateY(0);
}

/* Flip Up */
[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(-100deg);
}

[data-aos="flip-up"].aos-animate {
    transform: perspective(2500px) rotateX(0);
}

/* Flip Left */
[data-aos="flip-left"] {
    transform: perspective(2500px) rotateY(-100deg);
}

[data-aos="flip-left"].aos-animate {
    transform: perspective(2500px) rotateY(0);
}

/* Slide Up */
[data-aos="slide-up"] {
    transform: translateY(100%);
}

[data-aos="slide-up"].aos-animate {
    transform: translateY(0);
}

/* ===== DELAY CLASSES ===== */
[data-aos-delay="100"] { transition-delay: 100ms; }
[data-aos-delay="200"] { transition-delay: 200ms; }
[data-aos-delay="300"] { transition-delay: 300ms; }
[data-aos-delay="400"] { transition-delay: 400ms; }
[data-aos-delay="500"] { transition-delay: 500ms; }
[data-aos-delay="600"] { transition-delay: 600ms; }
[data-aos-delay="700"] { transition-delay: 700ms; }
[data-aos-delay="800"] { transition-delay: 800ms; }

/* ===== DURATION CLASSES ===== */
[data-aos-duration="300"] { transition-duration: 300ms; }
[data-aos-duration="400"] { transition-duration: 400ms; }
[data-aos-duration="500"] { transition-duration: 500ms; }
[data-aos-duration="600"] { transition-duration: 600ms; }
[data-aos-duration="700"] { transition-duration: 700ms; }
[data-aos-duration="800"] { transition-duration: 800ms; }
[data-aos-duration="1000"] { transition-duration: 1000ms; }
[data-aos-duration="1200"] { transition-duration: 1200ms; }

/* ===== EASING CLASSES ===== */
[data-aos-easing="linear"] { transition-timing-function: linear; }
[data-aos-easing="ease"] { transition-timing-function: ease; }
[data-aos-easing="ease-in"] { transition-timing-function: ease-in; }
[data-aos-easing="ease-out"] { transition-timing-function: ease-out; }
[data-aos-easing="ease-in-out"] { transition-timing-function: ease-in-out; }
[data-aos-easing="ease-in-back"] { transition-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045); }
[data-aos-easing="ease-out-back"] { transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
[data-aos-easing="ease-in-out-back"] { transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* ===== PARALLAX EFFECTS ===== */
.parallax {
    position: relative;
    overflow: hidden;
}

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

/* ===== HOVER ANIMATIONS ===== */

/* Hover Lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Hover Scale */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover Glow */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.5);
}

/* Hover Shine */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Hover Border */
.hover-border {
    position: relative;
}

.hover-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold-gradient);
    transition: width 0.3s ease;
}

.hover-border:hover::after {
    width: 100%;
}

/* ===== LOADING ANIMATIONS ===== */

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--accent-gold-border);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dots */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--gold-primary);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

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

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gold-gradient);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ===== TEXT ANIMATIONS ===== */

/* Reveal Text */
.reveal-text {
    overflow: hidden;
}

.reveal-text span {
    display: inline-block;
    transform: translateY(100%);
    animation: revealText 0.6s ease forwards;
}

@keyframes revealText {
    to {
        transform: translateY(0);
    }
}

/* Gradient Text Animation */
.animated-gradient-text {
    background: linear-gradient(
        90deg,
        var(--gold-dark),
        var(--gold-primary),
        var(--gold-light),
        var(--gold-primary),
        var(--gold-dark)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    to {
        background-position: 200% center;
    }
}

/* ===== STAGGER ANIMATIONS ===== */

/* Stagger Children */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* ===== SPECIAL EFFECTS ===== */

/* Gold Glow Effect */
.gold-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Floating Element */
.floating {
    animation: float 3s ease-in-out infinite;
}

/* Bouncing Element */
.bouncing {
    animation: bounce 2s ease infinite;
}

/* Pulsing Element */
.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== PAGE TRANSITIONS ===== */

.page-transition {
    animation: fadeIn 0.5s ease;
}

.page-transition-exit {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
