/* ============================================
   IRON EMPIRE GYM - ADVANCED ANIMATIONS
   Stunning visual effects optimized for performance
   ============================================ */

/* === GRADIENT ANIMATIONS === */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(196, 30, 58, 0.5),
            0 0 10px rgba(196, 30, 58, 0.3),
            0 0 15px rgba(196, 30, 58, 0.2);
    }

    50% {
        box-shadow: 0 0 10px rgba(196, 30, 58, 0.8),
            0 0 20px rgba(196, 30, 58, 0.5),
            0 0 30px rgba(196, 30, 58, 0.3);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(196, 30, 58, 0.5),
            0 0 20px rgba(196, 30, 58, 0.3);
    }

    50% {
        text-shadow: 0 0 20px rgba(196, 30, 58, 0.8),
            0 0 40px rgba(196, 30, 58, 0.5),
            0 0 60px rgba(196, 30, 58, 0.3);
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(196, 30, 58, 0.5);
        box-shadow: inset 0 0 10px rgba(196, 30, 58, 0.2);
    }

    50% {
        border-color: rgba(196, 30, 58, 1);
        box-shadow: inset 0 0 20px rgba(196, 30, 58, 0.4);
    }
}

/* === ENHANCED BUTTON ANIMATIONS === */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #c41e3a, #a01828, #c41e3a);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    animation: glowPulse 1.5s ease-in-out infinite;
}

.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(196, 30, 58, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

.btn-secondary:hover {
    transform: translateY(-3px);
    border-color: var(--color-red-empire);
}

/* === ENHANCED CARD ANIMATIONS === */
.card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
            transparent,
            var(--color-red-empire),
            transparent);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover::after {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(196, 30, 58, 0.3);
}

.card:hover .card-icon {
    animation: float 2s ease-in-out infinite;
}

/* === IMAGE HOVER EFFECTS === */
.image-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(196, 30, 58, 0.3),
            transparent);
    transition: left 0.6s;
    z-index: 1;
}

.image-card:hover::before {
    left: 100%;
}

.image-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
}

/* === HERO ENHANCEMENTS === */
.hero-title {
    animation: slideInFromLeft 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
            var(--color-red-empire),
            transparent);
    animation: shimmer 2s infinite;
}

.hero-subtitle {
    animation: slideInFromRight 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.hero-cta {
    animation: scaleUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/* === SECTION TITLE EFFECTS === */
.section-title {
    position: relative;
    animation: rotateIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100px;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-red-empire));
}

.section-title::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -100px;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-red-empire), transparent);
}

/* === NAVBAR ENHANCEMENTS === */
.navbar {
    backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(13, 13, 13, 0.98);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(196, 30, 58, 0.2);
}

.navbar-menu a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-menu a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-red-empire);
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-menu a:hover::before,
.navbar-menu a.active::before {
    width: 100%;
}

.navbar-menu a:hover {
    transform: translateY(-2px);
}

/* === STATS COUNTER EFFECTS === */
.stat-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-number {
    background: linear-gradient(135deg, #c41e3a, #ff4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 2s ease-in-out infinite;
}

/* === TESTIMONIAL ENHANCEMENTS === */
.testimonial {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: borderGlow 3s ease-in-out infinite;
}

.testimonial:hover {
    transform: translateX(10px);
    box-shadow: -5px 0 20px rgba(196, 30, 58, 0.3);
}

/* === GALLERY GRID EFFECTS === */
.gallery-item {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 3rem;
    color: white;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

/* === FORM ENHANCEMENTS === */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    transform: scale(1.02);
    box-shadow:
        0 0 0 3px rgba(196, 30, 58, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

/* === TRAINER CARD EFFECTS === */
.trainer-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.trainer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg,
            transparent,
            var(--color-red-empire),
            transparent);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.trainer-card:hover::before {
    transform: scaleX(1);
}

.trainer-card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(196, 30, 58, 0.2);
}

/* === MEMBERSHIP TIER EFFECTS === */
.tier-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tier-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(196, 30, 58, 0.3);
}

.tier-card.featured {
    animation: glowPulse 3s ease-in-out infinite;
}

/* === SCROLL REVEAL ANIMATIONS === */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for grid items */
.reveal:nth-child(1) {
    transition-delay: 0.1s;
}

.reveal:nth-child(2) {
    transition-delay: 0.2s;
}

.reveal:nth-child(3) {
    transition-delay: 0.3s;
}

.reveal:nth-child(4) {
    transition-delay: 0.4s;
}

.reveal:nth-child(5) {
    transition-delay: 0.5s;
}

.reveal:nth-child(6) {
    transition-delay: 0.6s;
}

/* === LOADING OPTIMIZATION === */
/* Use will-change sparingly for performance */
.card:hover,
.image-card:hover,
.btn:hover {
    will-change: transform;
}

/* Remove will-change after animation */
.card,
.image-card,
.btn {
    will-change: auto;
}

/* === REDUCED MOTION SUPPORT === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */
/* Use transform and opacity for animations (GPU accelerated) */
/* Avoid animating: width, height, top, left, margin, padding */
/* Use will-change only when needed */
/* Enable hardware acceleration */
.card,
.image-card,
.btn,
.trainer-card,
.tier-card {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}