/**
 * Advanced Animations CSS
 * This file contains custom animations and effects for HanuPay website
 */

/* Fade In animations with different delays */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

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

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

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

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

/* Slide In animations */
.slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.8s ease forwards;
}

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

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

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

/* Scale animations */
.scale-in {
    opacity: 0;
    animation: scaleIn 0.8s ease forwards;
}

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

/* Bounce animation */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    opacity: 0;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); }
    20% { transform: scale3d(1.1, 1.1, 1.1); }
    40% { transform: scale3d(0.9, 0.9, 0.9); }
    60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); }
    80% { transform: scale3d(0.97, 0.97, 0.97); }
    100% { opacity: 1; transform: scale3d(1, 1, 1); }
}

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

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

/* Pulse animation */
.pulse {
    animation: pulse 2s infinite;
}

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

/* Shimmer effect for buttons */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

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

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

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

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(90deg, #4f46e5, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Typing animation */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid #4f46e5;
    white-space: nowrap;
    margin: 0 auto;
    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: #4f46e5 }
}

/* Scroll reveal animations */
.reveal-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-on-scroll.from-bottom {
    transform: translateY(50px);
}

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

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

/* Parallax effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Animated background gradient */
.animated-gradient {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

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

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollIndicator 2s infinite;
}

@keyframes scrollIndicator {
    0% { transform: translate(-50%, 0); opacity: 1; }
    50% { transform: translate(-50%, 10px); opacity: 0.5; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

/* 3D card effect */
.card-3d {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(10deg);
}

/* Custom animations for specific elements */
.hero-image img {
    animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
    0% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-10px) rotate(1deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(10px) rotate(-1deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Preloader animation */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile menu animation */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3730a3;
}
