/* ===========================================
   MICRO-INTERACTIONS & ANIMATIONS
   =========================================== */

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Stagger Animation for Lists */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item {
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }

/* Ripple Effect */
.ripple-container {
    position: relative;
    overflow: hidden !important;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Image Load Animation */
.image-container img {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.image-container img.loaded {
    opacity: 1;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

/* Scale on Active */
.scale-active:active {
    transform: scale(0.97);
}

/* Pulse Effect */
@keyframes pulse-subtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.pulse-subtle {
    animation: pulse-subtle 2s ease-in-out infinite;
}

/* Shine Effect */
.shine {
    position: relative;
    overflow: hidden !important;
}

.shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.shine:hover::after {
    left: 100%;
}

/* Underline Expand Effect */
.underline-expand {
    position: relative;
}

.underline-expand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease, left 0.3s ease;
}

.underline-expand:hover::after {
    width: 100%;
    left: 0;
}

/* Bounce In */
@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-in {
    animation: bounceIn 0.6s ease-out;
}

/* Rotate Icon on Hover */
.rotate-on-hover {
    transition: transform 0.3s ease;
}

.rotate-on-hover:hover {
    transform: rotate(90deg);
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #2563EB, #8B5CF6);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Fade In Up (for scroll reveal) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Blur Fade In */
@keyframes blurFadeIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.blur-fade-in {
    animation: blurFadeIn 0.6s ease-out;
}

/* Skeleton Shimmer */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Touch Feedback */
@media (hover: none) {
    .touch-feedback:active {
        background-color: rgba(0, 0, 0, 0.05);
        transform: scale(0.98);
    }
}

/* Smooth Height Transition */
.smooth-height {
    transition: height 0.3s ease-out;
    overflow: hidden !important;
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* ===========================================
   FOOTER ANIMATIONS
   =========================================== */

/* Footer Slide Up on Page Load */
@keyframes slideUpFooter {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

footer {
    animation: slideUpFooter 0.5s ease-out 0.3s backwards;
}

/* Heart Beat Animation */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

footer svg[fill="currentColor"] {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Scroll to Top Button Pulse */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
    }
}

button[onclick="scrollToTop()"]:hover {
    animation: buttonPulse 1.5s infinite;
}

/* Footer Link Hover Effect */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}
