/* ============================================
   AGHA Corporate Website - Animations
   Modern, Subtle, Performance-Optimized
   ============================================ */

/* ============================================
   Fade In Animation
   ============================================ */

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

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.fade-in--slow {
    animation: fadeIn 1s ease forwards;
}

/* ============================================
   Slide Up Animation
   ============================================ */

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

.slide-up {
    animation: slideUp 0.6s ease forwards;
}

.slide-up--slow {
    animation: slideUp 1s ease forwards;
}

/* ============================================
   Scale Animation
   ============================================ */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.5s ease forwards;
}

/* ============================================
   Parallax Hero Background
   ============================================ */

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.hero__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: blobFloat 20s ease-in-out infinite;
}

.hero__blob--1 {
    width: 600px;
    height: 600px;
    background: var(--color-primary-blue);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.hero__blob--2 {
    width: 500px;
    height: 500px;
    background: var(--color-secondary-purple);
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.hero__blob--3 {
    width: 400px;
    height: 400px;
    background: #60A5FA;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }
    75% {
        transform: translate(-50px, -30px) scale(1.05);
    }
}

/* ============================================
   Hover Effects
   ============================================ */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.hover-glow {
    position: relative;
    transition: all var(--transition-base);
}

.hover-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base);
    filter: blur(8px);
}

.hover-glow:hover::before {
    opacity: 0.6;
}

/* ============================================
   Animated Buttons
   ============================================ */

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

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

.btn-animated:hover::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   Ripple Effect
   ============================================ */

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

.ripple__effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   Floating Illustrations
   ============================================ */

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

.floating--slow {
    animation: floating 4s ease-in-out infinite;
}

.floating--reverse {
    animation: floating 3s ease-in-out infinite reverse;
}

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

/* ============================================
   Card Lift Effect
   ============================================ */

.card-lift {
    transition: all var(--transition-base);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-lift:hover {
    transform: translateY(-12px) rotateX(5deg);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   Glassmorphism
   ============================================ */

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

/* ============================================
   Gradient Animations
   ============================================ */

.gradient-animated {
    background: linear-gradient(90deg, #2F80FF, #8B5CF6, #2F80FF);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

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

/* ============================================
   Mouse Interactions
   ============================================ */

.mouse-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-primary);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.1s ease;
    mix-blend-mode: difference;
}

.mouse-follower--active {
    opacity: 0.5;
}

/* ============================================
   Scroll Reveal
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal--left {
    transform: translateX(-50px);
}

.reveal--right {
    transform: translateX(50px);
}

.reveal--left.reveal--active,
.reveal--right.reveal--active {
    transform: translateX(0);
}

/* ============================================
   Staggered Animations
   ============================================ */

.stagger > * {
    opacity: 0;
    animation: slideUp 0.6s ease forwards;
}

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

/* ============================================
   Magnetic Buttons
   ============================================ */

.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Animated Underline
   ============================================ */

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

.underline-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-base);
}

.underline-animated:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ============================================
   Hero Background Motion
   ============================================ */

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

.hero-motion__layer {
    position: absolute;
    inset: 0;
    will-change: transform;
}

/* ============================================
   Morphing Gradient
   ============================================ */

.morphing-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    filter: blur(100px);
    opacity: 0.3;
    animation: morphGradient 15s ease-in-out infinite;
}

@keyframes morphGradient {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(180deg);
    }
}

/* ============================================
   Loading Animation
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen--hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

.loading-logo {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* ============================================
   Typing Effect
   ============================================ */

.typing {
    overflow: hidden;
    border-right: 3px solid var(--color-primary-blue);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-primary-blue);
    }
}

/* ============================================
   Image Zoom
   ============================================ */

.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform var(--transition-slow);
}

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

/* ============================================
   Accordion Animation
   ============================================ */

.accordion__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base) ease;
}

.accordion__item--open .accordion__content {
    max-height: 500px;
}

.accordion__icon {
    transition: transform var(--transition-base);
}

.accordion__item--open .accordion__icon {
    transform: rotate(180deg);
}

/* ============================================
   Progress Animations
   ============================================ */

.progress-bar {
    width: 0%;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.progress-bar--animated {
    animation: progressFill 2s ease forwards;
}

@keyframes progressFill {
    to {
        width: var(--progress, 100%);
    }
}

/* ============================================
   Navigation Hover Indicator
   ============================================ */

.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all var(--transition-base);
    border-radius: var(--radius-full);
}

/* ============================================
   Icon Animations
   ============================================ */

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

.icon-bounce {
    animation: bounce 1s ease infinite;
}

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

/* ============================================
   Page Transitions
   ============================================ */

.page-transition {
    animation: pageIn 0.5s ease forwards;
}

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

/* ============================================
   Smooth Scrolling
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   Hardware Accelerated Animations
   ============================================ */

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* ============================================
   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;
    }
    
    .hero__blob,
    .floating,
    .morphing-gradient {
        animation: none;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
