/**
 * Mitrotech - Advanced Motion UI & Animations
 * Professional, stunning, unique animations
 */

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

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

/* Pulse Glow Animation */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(33, 94, 97, 0.2),
                    0 0 20px rgba(33, 94, 97, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(33, 94, 97, 0.4),
                    0 0 40px rgba(33, 94, 97, 0.2),
                    0 0 60px rgba(33, 94, 97, 0.1);
    }
}

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

/* Text Shimmer */
@keyframes textShimmer {
    0% { background-position: -500px 0; }
    100% { background-position: 500px 0; }
}

/* Morphing Border */
@keyframes morphBorder {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75% { border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%; }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Up Fade */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Stagger Reveal */
@keyframes staggerReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Icon Bounce */
@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translate(10px, -20px) rotate(90deg);
    }
    50% {
        transform: translate(-5px, -40px) rotate(180deg);
        opacity: 0.5;
    }
    75% {
        transform: translate(15px, -60px) rotate(270deg);
    }
    100% {
        transform: translate(0, -80px) rotate(360deg);
        opacity: 0;
    }
}

/* Typing Cursor */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Wave */
@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* ================================================
   HERO SECTION ANIMATIONS
   ================================================ */

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

/* Animated Background Gradient */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 25%,
        var(--dark) 50%,
        var(--primary-dark) 75%,
        var(--primary) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

/* Floating Particles */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -1;
}

.hero-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: particleFloat 8s infinite ease-in-out;
}

.hero-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.hero-particle:nth-child(2) { left: 30%; top: 60%; animation-delay: 1s; width: 15px; height: 15px; }
.hero-particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 2s; }
.hero-particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 3s; width: 8px; height: 8px; }
.hero-particle:nth-child(5) { left: 85%; top: 40%; animation-delay: 4s; }
.hero-particle:nth-child(6) { left: 20%; top: 80%; animation-delay: 5s; width: 12px; height: 12px; }

/* Hero Title Animation */
.hero-title {
    animation: slideUpFade 1s ease-out;
}

.hero-title .highlight {
    background: linear-gradient(
        90deg,
        var(--secondary),
        var(--accent),
        var(--secondary)
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s linear infinite;
}

/* Hero Description */
.hero-description {
    animation: slideUpFade 1s ease-out 0.2s both;
}

/* Hero Buttons */
.hero-buttons {
    animation: slideUpFade 1s ease-out 0.4s both;
}

/* Morphing Shape Background */
.hero-shape {
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(254, 127, 45, 0.1), rgba(255, 215, 0, 0.1));
    animation: morphBorder 8s ease-in-out infinite;
    z-index: -1;
}

.hero-shape-1 {
    top: -100px;
    right: -100px;
}

.hero-shape-2 {
    bottom: -150px;
    left: -150px;
    animation-delay: -4s;
}

/* ================================================
   SCROLL REVEAL ANIMATIONS
   ================================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation Variants */
.animate-slide-left {
    transform: translateX(-100px);
}
.animate-slide-left.visible {
    transform: translateX(0);
}

.animate-slide-right {
    transform: translateX(100px);
}
.animate-slide-right.visible {
    transform: translateX(0);
}

.animate-scale {
    transform: scale(0.8);
}
.animate-scale.visible {
    transform: scale(1);
}

.animate-rotate {
    transform: rotate(-10deg) scale(0.9);
}
.animate-rotate.visible {
    transform: rotate(0) scale(1);
}

/* Staggered Children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   BUTTON ANIMATIONS
   ================================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

/* Magnetic Button Effect */
.btn-magnetic {
    transition: transform 0.3s ease;
}

/* Glow Button */
.btn-glow {
    animation: pulseGlow 2s infinite;
}

.btn-glow:hover {
    animation: none;
    box-shadow: 0 0 30px rgba(254, 127, 45, 0.5),
                0 0 60px rgba(254, 127, 45, 0.3);
}

/* Slide Fill Button */
.btn-slide {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    z-index: 1;
}

.btn-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-slide:hover {
    color: white;
}

.btn-slide:hover::before {
    left: 0;
}

/* ================================================
   CARD ANIMATIONS
   ================================================ */

.card-hover-lift {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-hover-lift:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Card with Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.8s ease;
}

.card-shine:hover::before {
    transform: translateX(100%) rotate(45deg);
}

/* 3D Card Tilt */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* ================================================
   SERVICE CARD ANIMATIONS
   ================================================ */

.service-card {
    position: relative;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
    z-index: -1;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    color: white;
}

.service-card:hover .service-icon {
    animation: iconBounce 0.8s ease;
    color: white;
}

.service-card:hover .service-icon::before {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.2);
}

/* Icon Animation */
.service-icon {
    position: relative;
    transition: all 0.4s ease;
}

.service-icon::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(33, 94, 97, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

/* ================================================
   PRICING CARD ANIMATIONS
   ================================================ */

.pricing-card {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pricing-card:hover {
    transform: translateY(-20px) scale(1.03);
}

.pricing-card.popular {
    animation: pulseGlow 3s infinite;
}

.pricing-card.popular:hover {
    animation: none;
}

/* Price Counter Animation */
.pricing-price {
    position: relative;
}

.pricing-price .currency {
    display: inline-block;
    animation: slideUpFade 0.5s ease;
}

/* ================================================
   STATS COUNTER ANIMATIONS
   ================================================ */

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(254, 127, 45, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.stat-number {
    font-variant-numeric: tabular-nums;
}

.stat-icon {
    animation: float 3s ease-in-out infinite;
}

/* ================================================
   TESTIMONIAL SLIDER ANIMATIONS
   ================================================ */

.testimonial-slide {
    opacity: 0;
    transform: scale(0.95) translateX(50px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: absolute;
    width: 100%;
}

.testimonial-slide.active {
    opacity: 1;
    transform: scale(1) translateX(0);
    position: relative;
}

.testimonial-slide.prev {
    transform: scale(0.95) translateX(-50px);
}

/* Quote Animation */
.testimonial-quote-icon {
    animation: float 4s ease-in-out infinite;
}

/* ================================================
   PORTFOLIO/PROJECT ANIMATIONS
   ================================================ */

.project-card {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover {
    transform: translateY(-15px);
}

.project-card .project-image img {
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-image img {
    transform: scale(1.15) rotate(2deg);
}

.project-overlay {
    opacity: 0;
    transition: all 0.4s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay-content {
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.project-card:hover .project-overlay-content {
    transform: translateY(0);
}

/* ================================================
   TECH STACK ANIMATIONS
   ================================================ */

.tech-logo {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: grayscale(100%);
    opacity: 0.7;
}

.tech-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.2) translateY(-5px);
}

/* Continuous Scroll Animation */
.tech-scroll {
    display: flex;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tech-scroll:hover {
    animation-play-state: paused;
}

/* ================================================
   FORM ANIMATIONS
   ================================================ */

.form-input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(33, 94, 97, 0.1);
    transform: translateY(-2px);
}

/* Floating Label */
.form-group-floating .form-label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    pointer-events: none;
    color: var(--gray-400);
}

.form-group-floating .form-input:focus ~ .form-label,
.form-group-floating .form-input:not(:placeholder-shown) ~ .form-label {
    top: 0;
    left: 12px;
    font-size: 12px;
    padding: 0 4px;
    background: white;
    color: var(--primary);
}

/* ================================================
   FAQ ACCORDION ANIMATIONS
   ================================================ */

.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateX(5px);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-question i {
    transition: transform 0.4s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* ================================================
   WHATSAPP BUTTON ANIMATIONS
   ================================================ */

.whatsapp-float {
    animation: float 3s ease-in-out infinite, pulseGlow 2s infinite;
}

.whatsapp-float:hover {
    animation: none;
    transform: scale(1.1);
}

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: gradientShift 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ================================================
   CURSOR ANIMATIONS
   ================================================ */

.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, background 0.15s ease;
}

.custom-cursor.hover {
    transform: scale(1.5);
    background: rgba(33, 94, 97, 0.1);
}

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

.text-reveal {
    overflow: hidden;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-animated {
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--secondary),
        var(--accent),
        var(--primary)
    );
    background-size: 300% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 5s ease infinite;
}

/* ================================================
   SCROLL PROGRESS INDICATOR
   ================================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */

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

@media (max-width: 768px) {
    .hero-shape {
        width: 300px;
        height: 300px;
    }

    .hero-particle {
        display: none;
    }
}

/* ================================================
   SCROLL INDICATOR
   ================================================ */

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(15px);
        opacity: 0;
    }
}

/* ================================================
   GLASSMORPHISM EFFECTS
   ================================================ */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ================================================
   GRADIENT BORDERS
   ================================================ */

.gradient-border {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    border-radius: inherit;
    z-index: -1;
}

/* ================================================
   ANIMATED UNDERLINES
   ================================================ */

.underline-hover {
    position: relative;
    display: inline-block;
}

.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
}

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

/* ================================================
   ICON ANIMATIONS
   ================================================ */

.icon-float {
    animation: float 3s ease-in-out infinite;
}

.icon-pulse {
    animation: pulseGlow 2s infinite;
}

.icon-spin {
    animation: spin 2s linear infinite;
}

/* ================================================
   IMAGE EFFECTS
   ================================================ */

.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.img-zoom:hover img {
    transform: scale(1.1);
}

@media (max-width: 576px) {
    .scroll-indicator {
        display: none;
    }
}
