/* =============================================
   Keyframe Animations
   ============================================= */

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

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

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

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

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

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

/* =============================================
   Scroll Animation Classes
   ============================================= */

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
}

.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* =============================================
   Staggered Animation Delays
   ============================================= */

.fade-in-up[data-delay="100"].visible {
    transition-delay: 0.1s;
}

.fade-in-up[data-delay="200"].visible {
    transition-delay: 0.2s;
}

.fade-in-up[data-delay="300"].visible {
    transition-delay: 0.3s;
}

.fade-in-up[data-delay="400"].visible {
    transition-delay: 0.4s;
}

.fade-in-up[data-delay="500"].visible {
    transition-delay: 0.5s;
}

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

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

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

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

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

.hover-glow {
    position: relative;
    transition: all 0.3s ease;
}

.hover-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: 0 0 20px rgba(74, 144, 164, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hover-glow:hover::after {
    opacity: 1;
}

/* =============================================
   Link Underline Animation
   ============================================= */

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

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

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

/* =============================================
   Page Load Animations
   ============================================= */

.hero-content {
    animation: fadeIn 1s ease 0.3s both;
}

.hero-title {
    animation: slideUp 0.8s ease 0.5s both;
}

.hero-tagline {
    animation: slideUp 0.8s ease 0.7s both;
}

.scroll-indicator {
    animation: fadeIn 0.8s ease 1.2s both;
}

/* =============================================
   Parallax Effect
   ============================================= */

.parallax {
    transition: transform 0.1s ease-out;
}

/* =============================================
   Loading State
   ============================================= */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--color-gray-medium);
    border-top-color: var(--color-nordic-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =============================================
   Smooth Transitions
   ============================================= */

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

.smooth-transition-fast {
    transition: all 0.2s ease;
}

.smooth-transition-slow {
    transition: all 0.6s ease;
}

/* =============================================
   Card Flip Animation (Optional)
   ============================================= */

.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* =============================================
   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;
        scroll-behavior: auto !important;
    }

    .parallax {
        transform: none !important;
    }

    .scroll-arrow {
        animation: none;
    }
}
