/* ============================================
   Animations & Visual Effects
   ============================================ */

/* ---- KEYFRAME ANIMATIONS ---- */

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(230, 57, 70, 0.8);
    }
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes blink {
    0%, 49%, 100% {
        opacity: 1;
    }
    50%, 99% {
        opacity: 0;
    }
}

@keyframes rotateShape {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes moveShapeSmall {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(30px, -40px);
    }
    66% {
        transform: translate(-30px, 40px);
    }
}

@keyframes moveShapeLarge {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(-50px, 30px);
    }
    66% {
        transform: translate(50px, -30px);
    }
}

/* ---- ANIMATED SHAPES (Hero Background) ---- */

.gradient-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: moveShapeLarge 15s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-2) 100%);
    top: -100px;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-1) 100%);
    bottom: -50px;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--primary) 100%);
    top: 40%;
    right: 5%;
    animation-delay: 4s;
}

/* ---- PARTICLE ANIMATION ---- */

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(230, 57, 70, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s infinite ease-in-out;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(var(--tx));
    }
}

/* ---- CUSTOM CURSOR ---- */

.cursor {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    display: none;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    display: none;
}

/* Show cursor only on desktop */
@media (hover: hover) and (pointer: fine) {
    .cursor,
    .cursor-ring {
        display: block;
    }
}

/* ---- SCROLL ANIMATIONS ---- */

.reveal {
    opacity: 0;
}

.reveal.active {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.reveal-left {
    opacity: 0;
}

.reveal-left.active {
    animation: slideInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.reveal-right {
    opacity: 0;
}

.reveal-right.active {
    animation: slideInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Stagger animation for child elements */
.reveal-child {
    opacity: 0;
}

.reveal.active .reveal-child {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.reveal.active .reveal-child:nth-child(1) { animation-delay: 0s; }
.reveal.active .reveal-child:nth-child(2) { animation-delay: 0.1s; }
.reveal.active .reveal-child:nth-child(3) { animation-delay: 0.2s; }
.reveal.active .reveal-child:nth-child(4) { animation-delay: 0.3s; }
.reveal.active .reveal-child:nth-child(5) { animation-delay: 0.4s; }
.reveal.active .reveal-child:nth-child(6) { animation-delay: 0.5s; }

/* ---- PARALLAX EFFECT ---- */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ---- HOVER EFFECTS ---- */

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: var(--transition);
}

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

.hover-glow {
    transition: var(--transition);
}

.hover-glow:hover {
    box-shadow: var(--glow-lg);
}

/* ---- TYPING EFFECT ---- */

.typing {
    border-right: 2px solid var(--primary);
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* ---- COUNTER ANIMATION ---- */

.stat-number {
    transition: all 0.5s ease-out;
}

/* ---- NAV ANIMATIONS ---- */

.nav-mobile-enter {
    animation: slideDown 0.3s ease-out;
}

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

/* ---- BUTTON ANIMATIONS ---- */

.btn {
    position: relative;
    overflow: hidden;
}

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

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
}

/* ---- CARD ANIMATIONS ---- */

.service-card,
.feature-box,
.pricing-card {
    position: relative;
    overflow: hidden;
}

.service-card::after,
.feature-box::after,
.pricing-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.service-card:hover::after,
.feature-box:hover::after,
.pricing-card:hover::after {
    left: 100%;
}

/* ---- TRANSITION UTILITIES ---- */

.transition-fast {
    transition: var(--transition-fast);
}

.transition-normal {
    transition: var(--transition);
}

.transition-slow {
    transition: var(--transition-slow);
}

/* ---- MODAL/OVERLAY ANIMATIONS ---- */

.modal {
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: slideInUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ---- FORM ANIMATIONS ---- */

.form-group {
    animation: fadeInUp 0.5s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0s; }
.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.3s; }
.form-group:nth-child(5) { animation-delay: 0.4s; }
.form-group:nth-child(6) { animation-delay: 0.5s; }
.form-group:nth-child(7) { animation-delay: 0.6s; }

/* ---- SUCCESS/ERROR ANIMATIONS ---- */

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

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

/* ---- LOAD ANIMATION ---- */

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ---- NEW STUNNING ANIMATIONS ---- */

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(230, 57, 70, 0.5), 0 0 40px rgba(230, 57, 70, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(230, 57, 70, 0.8), 0 0 80px rgba(230, 57, 70, 0.5);
        transform: scale(1.02);
    }
}

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

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes infiniteFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    25% {
        transform: translateY(-15px);
    }
    75% {
        transform: translateY(10px);
    }
}

@keyframes colorShift {
    0%, 100% {
        color: var(--primary);
        text-shadow: 0 0 20px rgba(230, 57, 70, 0.6);
    }
    50% {
        color: var(--accent-1);
        text-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(230, 57, 70, 0.5);
        box-shadow: inset 0 0 10px rgba(230, 57, 70, 0.2), 0 0 10px rgba(230, 57, 70, 0.3);
    }
    50% {
        border-color: rgba(230, 57, 70, 0.8);
        box-shadow: inset 0 0 20px rgba(230, 57, 70, 0.4), 0 0 20px rgba(230, 57, 70, 0.6);
    }
}

@keyframes scaleHover {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ---- TEXT ANIMATIONS ---- */

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
}

/* Apply animations to elements */
a, button, input, textarea, select {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:hover {
    animation: scaleHover 0.3s ease-out;
}

button:hover {
    animation: scaleHover 0.3s ease-out;
}

input:focus, textarea:focus, select:focus {
    animation: borderGlow 0.6s ease-in-out infinite;
}

/* ============================================
   ENHANCED ANIMATIONS - Stunning Effects
   ============================================ */

/* Parallax Float Effect */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-20px) translateX(0px);
    }
    75% {
        transform: translateY(-10px) translateX(-5px);
    }
}

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

/* Slide and Fade Combo */
@keyframes slideUpWithFade {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Rotate and Glow */
@keyframes rotateGlow {
    0%, 100% {
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.4);
    }
    50% {
        transform: rotate(5deg);
        box-shadow: 0 0 40px rgba(220, 20, 60, 0.7);
    }
}

/* Wave Pulse */
@keyframes wavePulse {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.1);
    }
}

/* Shimmer Line */
@keyframes shimmerLine {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Elastic Bounce */
@keyframes elasticBounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-15px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-8px);
    }
}

/* Gradient Shift */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Morphing Circle to Square */
@keyframes morphShape {
    0%, 100% {
        border-radius: 50%;
    }
    50% {
        border-radius: 20%;
    }
}

/* Pulse and Glow Combined */
@keyframes pulseGlowCombined {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(220, 20, 60, 0.8);
    }
}

/* Cascading Fade */
@keyframes cascadingFade {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flip Horizontal */
@keyframes flipHorizontal {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
}

/* Rainbow Glow */
@keyframes rainbowGlow {
    0% {
        box-shadow: 0 0 10px rgba(220, 20, 60, 0.6);
    }
    25% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
    }
    50% {
        box-shadow: 0 0 30px rgba(139, 0, 0, 0.6);
    }
    75% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
    }
    100% {
        box-shadow: 0 0 10px rgba(220, 20, 60, 0.6);
    }
}

/* Swing Animation */
@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* ---- APPLY ANIMATIONS TO ELEMENTS ---- */

/* Apply parallax float to floating elements */
.float-element {
    animation: parallaxFloat 6s ease-in-out infinite !important;
}

/* Apply bounce pulse to buttons */
.btn:hover {
    animation: bouncePulse 0.6s ease-in-out !important;
}

/* Apply to hero sections */
.hero-page h1 {
    animation: slideUpWithFade 0.8s ease-out !important;
}

.hero-page p {
    animation: slideUpWithFade 0.8s ease-out 0.2s both !important;
}

/* Glow effect on primary elements */
.highlight {
    animation: rotateGlow 3s ease-in-out infinite !important;
}

/* ---- ACCESSIBILITY ---- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
