/* ============================================
   ADVANCED ENTERPRISE ANIMATIONS
   Noticeable, sophisticated scroll & hover effects
   ============================================ */

/* ============================================
   PARALLAX SCROLL EFFECTS
   ============================================ */

/* Parallax layers with depth */
.parallax-layer {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.parallax-slow {
    transform: translateY(var(--scroll-offset-slow, 0));
}

.parallax-medium {
    transform: translateY(var(--scroll-offset-medium, 0));
}

.parallax-fast {
    transform: translateY(var(--scroll-offset-fast, 0));
}

/* Scroll-triggered zoom */
@keyframes scrollZoom {
    0% {
        transform: scale(0.85) translateY(50px);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.animate-scroll-zoom {
    animation: scrollZoom 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
}

/* Scroll-triggered 3D rotation */
@keyframes scroll3DRotate {
    0% {
        transform: perspective(1000px) rotateY(-15deg) translateX(-50px);
        opacity: 0;
    }
    100% {
        transform: perspective(1000px) rotateY(0) translateX(0);
        opacity: 1;
    }
}

.animate-3d-rotate {
    animation: scroll3DRotate 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
    transform-style: preserve-3d;
}

/* Depth reveal with shadow */
@keyframes depthReveal {
    0% {
        transform: translateZ(-100px) scale(0.9);
        opacity: 0;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    100% {
        transform: translateZ(0) scale(1);
        opacity: 1;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
}

.animate-depth-reveal {
    animation: depthReveal 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
    transform-style: preserve-3d;
}

/* ============================================
   ADVANCED HOVER EFFECTS
   ============================================ */

/* 3D Tilt on hover */
.hover-tilt {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(20px);
}

/* Magnetic hover effect */
.hover-magnetic {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.hover-magnetic:hover {
    transform: translate(var(--mouse-x, 0), var(--mouse-y, 0));
}

/* Expanding border on hover */
.hover-border-expand {
    position: relative;
    overflow: hidden;
}

.hover-border-expand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #1e40af;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

.hover-border-expand:hover::before {
    transform: scale(1);
}

/* Glowing pulse on hover */
.hover-glow-pulse {
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.hover-glow-pulse:hover {
    box-shadow:
        0 0 20px rgba(30, 64, 175, 0.6),
        0 0 40px rgba(30, 64, 175, 0.4),
        0 0 60px rgba(30, 64, 175, 0.2);
    transform: translateY(-8px) scale(1.02);
}

/* Sliding gradient overlay */
.hover-gradient-slide {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hover-gradient-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(30, 64, 175, 0.3) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
    z-index: -1;
}

.hover-gradient-slide:hover::before {
    left: 100%;
}

/* Expanding background */
.hover-expand-bg {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hover-expand-bg::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(30, 64, 175, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: -1;
}

.hover-expand-bg:hover::after {
    width: 300%;
    height: 300%;
}

/* Split text reveal on hover */
.hover-text-split {
    position: relative;
    overflow: hidden;
}

.hover-text-split span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.hover-text-split:hover span:nth-child(odd) {
    transform: translateY(-5px);
}

.hover-text-split:hover span:nth-child(even) {
    transform: translateY(5px);
}

/* Morphing shadow */
.hover-morph-shadow {
    transition: box-shadow 0.4s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.hover-morph-shadow:hover {
    box-shadow:
        -20px 20px 60px rgba(30, 64, 175, 0.3),
        20px -20px 60px rgba(148, 163, 184, 0.3);
    transform: translateY(-5px);
}

/* ============================================
   TEXT REVEAL ANIMATIONS
   ============================================ */

/* Slide up reveal with mask */
@keyframes textSlideUpMask {
    0% {
        transform: translateY(100%);
    }
    100% {
        transform: translateY(0);
    }
}

.text-reveal-mask {
    overflow: hidden;
    display: inline-block;
}

.text-reveal-mask span {
    display: inline-block;
    animation: textSlideUpMask 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Split text stagger */
.text-split-stagger {
    display: inline-block;
}

.text-split-stagger span {
    display: inline-block;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.text-split-stagger span:nth-child(1) { animation-delay: 0.05s; }
.text-split-stagger span:nth-child(2) { animation-delay: 0.1s; }
.text-split-stagger span:nth-child(3) { animation-delay: 0.15s; }
.text-split-stagger span:nth-child(4) { animation-delay: 0.2s; }
.text-split-stagger span:nth-child(5) { animation-delay: 0.25s; }
.text-split-stagger span:nth-child(6) { animation-delay: 0.3s; }
.text-split-stagger span:nth-child(7) { animation-delay: 0.35s; }
.text-split-stagger span:nth-child(8) { animation-delay: 0.4s; }
.text-split-stagger span:nth-child(9) { animation-delay: 0.45s; }
.text-split-stagger span:nth-child(10) { animation-delay: 0.5s; }

/* Gradient text reveal */
@keyframes gradientTextReveal {
    0% {
        background-position: 200% center;
        opacity: 0;
    }
    100% {
        background-position: 0% center;
        opacity: 1;
    }
}

.text-gradient-reveal {
    background: linear-gradient(
        90deg,
        transparent 0%,
        #1e40af 30%,
        #3b82f6 50%,
        #60a5fa 70%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientTextReveal 2s ease-out forwards;
}

/* ============================================
   SCROLL PROGRESS INDICATORS
   ============================================ */

/* Scrolling progress bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        #1e40af 0%,
        #3b82f6 50%,
        #60a5fa 100%
    );
    transform: scaleX(var(--scroll-progress, 0));
    transform-origin: left;
    z-index: 10000;
    transition: transform 0.1s ease-out;
}

/* Circular scroll indicator */
.scroll-indicator-circle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(30, 64, 175, 0.3);
    z-index: 9999;
}

.scroll-indicator-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 3px solid #1e40af;
    border-top-color: transparent;
    border-right-color: transparent;
    transform: translate(-50%, -50%) rotate(calc(var(--scroll-progress, 0) * 360deg));
    transition: transform 0.1s ease-out;
}

/* ============================================
   CLIP PATH REVEALS
   ============================================ */

/* Diagonal wipe reveal */
@keyframes diagonalWipe {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.animate-diagonal-wipe {
    animation: diagonalWipe 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Circle expand reveal */
@keyframes circleExpand {
    0% {
        clip-path: circle(0% at 50% 50%);
    }
    100% {
        clip-path: circle(150% at 50% 50%);
    }
}

.animate-circle-expand {
    animation: circleExpand 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Curtain reveal */
@keyframes curtainReveal {
    0% {
        clip-path: inset(0 50% 0 50%);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.animate-curtain-reveal {
    animation: curtainReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */

.glass-morph {
    background: rgba(30, 64, 175, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.glass-morph:hover {
    background: rgba(30, 64, 175, 0.2);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(30, 64, 175, 0.3);
}

/* ============================================
   ELASTIC BOUNCE EFFECTS
   ============================================ */

@keyframes elasticBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-elastic-bounce {
    animation: elasticBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

/* ============================================
   STAGGERED SECTION REVEALS
   ============================================ */

@keyframes sectionSlideReveal {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-section-slide-left {
    animation: sectionSlideReveal 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
}

@keyframes sectionSlideRevealRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-section-slide-right {
    animation: sectionSlideRevealRight 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

@keyframes floatSmooth {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.animate-float {
    animation: floatSmooth 4s ease-in-out infinite;
}

@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-15px) rotate(5deg);
    }
    66% {
        transform: translateY(-5px) rotate(-5deg);
    }
}

.animate-float-rotate {
    animation: floatRotate 6s ease-in-out infinite;
}

/* ============================================
   ADVANCED CARD EFFECTS
   ============================================ */

/* Card 3D flip on hover */
.card-flip-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.card-flip-3d:hover {
    transform: rotateY(180deg);
}

.card-flip-3d .card-front,
.card-flip-3d .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-flip-3d .card-back {
    transform: rotateY(180deg);
}

/* Card spotlight effect */
.card-spotlight {
    position: relative;
    overflow: hidden;
}

.card-spotlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card-spotlight:hover::before {
    opacity: 1;
}

/* Card split reveal */
@keyframes cardSplitTop {
    0% {
        transform: translateY(-100%) scaleY(0);
    }
    100% {
        transform: translateY(0) scaleY(1);
    }
}

@keyframes cardSplitBottom {
    0% {
        transform: translateY(100%) scaleY(0);
    }
    100% {
        transform: translateY(0) scaleY(1);
    }
}

.card-split-reveal .card-top {
    animation: cardSplitTop 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.card-split-reveal .card-bottom {
    animation: cardSplitBottom 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* ============================================
   GRADIENT ANIMATIONS
   ============================================ */

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient-shift {
    background: linear-gradient(
        270deg,
        #1e40af,
        #3b82f6,
        #60a5fa,
        #1e40af
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* ============================================
   BUTTON ADVANCED EFFECTS
   ============================================ */

/* Button ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:hover::after {
    width: 300px;
    height: 300px;
}

/* Button glow expand */
@keyframes btnGlowExpand {
    0%, 100% {
        box-shadow: 0 0 10px rgba(30, 64, 175, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(30, 64, 175, 0.8),
                    0 0 60px rgba(30, 64, 175, 0.4);
    }
}

.btn-glow-expand {
    animation: btnGlowExpand 2s ease-in-out infinite;
}

/* Button sheen effect */
.btn-sheen {
    position: relative;
    overflow: hidden;
}

.btn-sheen::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-sheen:hover::before {
    left: 150%;
}

/* ============================================
   IMAGE HOVER EFFECTS
   ============================================ */

/* Image zoom and rotate */
.img-zoom-rotate {
    overflow: hidden;
}

.img-zoom-rotate img {
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.img-zoom-rotate:hover img {
    transform: scale(1.2) rotate(5deg);
}

/* Image Ken Burns effect */
@keyframes kenBurns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.2) translate(-5%, -5%);
    }
}

.img-ken-burns {
    overflow: hidden;
}

.img-ken-burns img {
    animation: kenBurns 20s ease-out infinite alternate;
}

/* ============================================
   SCROLL-TRIGGERED COUNTERS
   ============================================ */

.counter-animated {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

.animate-scroll-zoom,
.animate-3d-rotate,
.animate-depth-reveal,
.animate-diagonal-wipe,
.animate-circle-expand,
.animate-curtain-reveal,
.animate-elastic-bounce,
.animate-section-slide-left,
.animate-section-slide-right {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Remove will-change after animation */
.animation-complete {
    will-change: auto !important;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .hover-tilt:hover {
        transform: perspective(1000px) rotateX(3deg) rotateY(-3deg) translateZ(10px);
    }

    .hover-glow-pulse:hover {
        transform: translateY(-5px) scale(1.01);
    }

    .scroll-indicator-circle {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .animate-float-rotate,
    .animate-gradient-shift,
    .btn-glow-expand,
    .img-ken-burns img {
        animation: none !important;
    }
}
