/* ============================================
   IRON EMPIRE GYM - ADVANCED ANIMATIONS
   Additional detailed animations and effects
   ============================================ */

/* === STAGGERED TEXT REVEAL === */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-dark);
    transform-origin: left;
    animation: revealText 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes revealText {
    0% {
        transform: scaleX(0);
    }

    50% {
        transform: scaleX(1);
        transform-origin: left;
    }

    50.1% {
        transform-origin: right;
    }

    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* === NUMBER COUNTER ANIMATION === */
.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* === IMAGE ZOOM ON SCROLL === */
.zoom-on-scroll {
    overflow: hidden;
}

.zoom-on-scroll img {
    transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1.2);
}

.zoom-on-scroll.active img {
    transform: scale(1);
}

/* === CARD FLIP EFFECT === */
.card-flip {
    perspective: 1000px;
    position: relative;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* === PROGRESS BARS === */
.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(192, 197, 206, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c41e3a, #ff4757);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.6);
}

.progress-bar.active .progress-bar-fill {
    transform: scaleX(1);
}


/* === ICON ANIMATIONS === */
.icon-bounce {
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

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

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

.icon-rotate {
    animation: iconRotate 3s linear infinite;
}

@keyframes iconRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* === SLIDING PANELS === */
.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* === TYPEWRITER EFFECT === */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #c41e3a;
    white-space: nowrap;
    animation:
        typing 3s steps(40, end),
        blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #c41e3a;
    }
}

/* === ENHANCED HOVER STATES === */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow:
        0 0 20px rgba(196, 30, 58, 0.6),
        0 0 40px rgba(196, 30, 58, 0.4),
        0 0 60px rgba(196, 30, 58, 0.2);
}

/* === BACKGROUND ANIMATIONS === */
.bg-gradient-animate {
    background: linear-gradient(-45deg,
            #2a2d34,
            #1a1d24,
            #2a2d34,
            #1a1d24);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {

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

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

/* === SPOTLIGHT EFFECT === */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(196, 30, 58, 0.3) 0%,
            transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.spotlight:hover::before {
    opacity: 1;
    animation: spotlightMove 2s ease-in-out infinite;
}

@keyframes spotlightMove {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(10%, 10%);
    }

    50% {
        transform: translate(-10%, 10%);
    }

    75% {
        transform: translate(10%, -10%);
    }
}

/* === WAVE ANIMATION === */
.wave {
    position: relative;
    overflow: hidden;
}

.wave::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(196, 30, 58, 0.1),
            transparent);
    animation: wave 3s linear infinite;
}

@keyframes wave {
    from {
        transform: translateX(-50%);
    }

    to {
        transform: translateX(0);
    }
}

/* === GLITCH EFFECT === */
.glitch {
    position: relative;
}

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

.glitch:hover::before {
    animation: glitch1 0.3s infinite;
    color: #c41e3a;
    z-index: -1;
}

.glitch:hover::after {
    animation: glitch2 0.3s infinite;
    color: #ff4757;
    z-index: -2;
}

@keyframes glitch1 {

    0%,
    100% {
        transform: translate(0);
        opacity: 0;
    }

    50% {
        transform: translate(-2px, 2px);
        opacity: 0.7;
    }
}

@keyframes glitch2 {

    0%,
    100% {
        transform: translate(0);
        opacity: 0;
    }

    50% {
        transform: translate(2px, -2px);
        opacity: 0.7;
    }
}

/* === BREATHING ANIMATION === */
.breathe {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* === ENHANCED CARD ENTRANCE === */
.card-entrance {
    opacity: 0;
    transform: translateY(50px) rotateX(-15deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-entrance.active {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

/* === BORDER DRAWING === */
.draw-border {
    position: relative;
}

.draw-border::before,
.draw-border::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    transition: all 0.5s ease;
}

.draw-border::before {
    top: 0;
    left: 0;
    border-top: 2px solid #c41e3a;
    border-left: 2px solid #c41e3a;
}

.draw-border::after {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid #c41e3a;
    border-right: 2px solid #c41e3a;
}

.draw-border:hover::before,
.draw-border:hover::after {
    width: 100%;
    height: 100%;
}

/* === ENHANCED TRANSITIONS === */
.smooth-all {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === PERFORMANCE OPTIMIZATIONS === */
.card-entrance,
.hover-lift,
.zoom-on-scroll img {
    will-change: transform;
}

/* Remove will-change after animation */
.card-entrance.active {
    will-change: auto;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
    .card-flip:hover .card-flip-inner {
        transform: none;
    }

    .spotlight::before {
        display: none;
    }

    .glitch:hover::before,
    .glitch:hover::after {
        display: none;
    }
}

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

    .icon-bounce,
    .icon-rotate,
    .icon-pulse,
    .breathe,
    .bg-gradient-animate,
    .wave::after,
    .typewriter {
        animation: none !important;
    }
}