/* ===================================
   ANIMATIONS - World-Class Smooth Animations
   =================================== */

/* ===================================
   FADE IN ANIMATIONS
   =================================== */

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

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

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

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

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

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

/* ===================================
   SCALE ANIMATIONS
   =================================== */

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

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

.scale-up {
    animation: scaleUp 0.6s ease-out forwards;
    opacity: 0;
}

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
}

/* ===================================
   SLIDE ANIMATIONS
   =================================== */

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

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@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;
    }
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out forwards;
}

.slide-in-down {
    animation: slideInDown 0.8s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* ===================================
   ROTATION ANIMATIONS
   =================================== */

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-90deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
    opacity: 0;
}

/* ===================================
   BOUNCE ANIMATIONS
   =================================== */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

.bounce {
    animation: bounce 2s infinite;
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

/* ===================================
   PULSE ANIMATIONS
   =================================== */

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
}

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

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===================================
   FLIP ANIMATIONS
   =================================== */

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

.flip-in-x {
    animation: flipInX 0.8s ease-out forwards;
    opacity: 0;
}

.flip-in-y {
    animation: flipInY 0.8s ease-out forwards;
    opacity: 0;
}

/* ===================================
   SHAKE ANIMATION
   =================================== */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

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

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

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* ===================================
   GRADIENT ANIMATIONS
   =================================== */

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

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ===================================
   FLOATING ANIMATION
   =================================== */

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

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

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

.float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

/* ===================================
   TYPEWRITER ANIMATION
   =================================== */

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

@keyframes blinkCursor {
    50% {
        border-color: transparent;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blinkCursor 0.5s steps(40) infinite normal;
}

/* ===================================
   GLOW ANIMATION
   =================================== */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 53, 0.5),
                    0 0 10px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.8),
                    0 0 30px rgba(255, 107, 53, 0.5);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* ===================================
   ZOOM ANIMATIONS
   =================================== */

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

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

.zoom-in {
    animation: zoomIn 0.6s ease-out forwards;
    opacity: 0;
}

.zoom-out {
    animation: zoomOut 0.6s ease-out forwards;
}

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

@keyframes revealFromLeft {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealFromRight {
    from {
        clip-path: inset(0 0 0 100%);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealFromTop {
    from {
        clip-path: inset(0 0 100% 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealFromBottom {
    from {
        clip-path: inset(100% 0 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-left {
    animation: revealFromLeft 1s ease-out forwards;
}

.reveal-right {
    animation: revealFromRight 1s ease-out forwards;
}

.reveal-top {
    animation: revealFromTop 1s ease-out forwards;
}

.reveal-bottom {
    animation: revealFromBottom 1s ease-out forwards;
}

/* ===================================
   STAGGER DELAYS (for sequential animations)
   =================================== */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }
.stagger-9 { animation-delay: 0.9s; }
.stagger-10 { animation-delay: 1s; }

/* ===================================
   HOVER EFFECTS
   =================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(44, 62, 80, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ===================================
   INTERSECTION OBSERVER SUPPORT
   =================================== */

/* Elements start hidden and animate when visible */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ===================================
   SMOOTH TRANSITIONS
   =================================== */

.smooth-all {
    transition: all 0.3s ease;
}

.smooth-colors {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.smooth-transform {
    transition: transform 0.3s ease;
}

.smooth-opacity {
    transition: opacity 0.3s ease;
}

/* ===================================
   PAGE LOAD ANIMATIONS
   =================================== */

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

body {
    animation: pageLoad 0.5s ease-out;
}

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

@keyframes scrollDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

.scroll-indicator {
    animation: scrollDown 2s ease-in-out infinite;
}

/* ===================================
   PERFORMANCE OPTIMIZATION
   =================================== */

/* GPU acceleration for smoother animations */
.gpu-accelerate,
.fade-in-up,
.fade-in-down,
.fade-in-left,
.fade-in-right,
.scale-up,
.scale-in {
    will-change: transform, opacity;
}

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

/* ===================================
   LOADING STATES
   =================================== */

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #e0e0e0 40px,
        #f0f0f0 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

.animated-underline {
    position: relative;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

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

/* ===================================
   RIPPLE EFFECT
   =================================== */

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

.ripple-effect::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%);
}

.ripple-effect:active::after {
    width: 100px;
    height: 100px;
    animation: ripple 0.6s ease-out;
}

/* ===================================
   END OF ANIMATIONS
   =================================== */

