/* ============================================
   ANIMATIONS.CSS - Wave & Color Animations
   ============================================ */

/* Wave Animation for Navigation Logo */
.animated-name {
    display: inline-flex;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.wave-letter {
    display: inline-block;
    animation: wave 3s ease-in-out infinite, colorChange 6s linear infinite;
    transform-origin: center bottom;
}

/* Full name animation delays */
.wave-letter.full-name:nth-child(1) { animation-delay: 0s, 0s; }
.wave-letter.full-name:nth-child(2) { animation-delay: 0.1s, 0.5s; }
.wave-letter.full-name:nth-child(3) { animation-delay: 0.2s, 1s; }
.wave-letter.full-name:nth-child(4) { animation-delay: 0.3s, 1.5s; }
.wave-letter.full-name:nth-child(5) { animation-delay: 0.4s, 2s; }
.wave-letter.full-name:nth-child(6) { animation-delay: 0.5s, 2.5s; }
.wave-letter.full-name:nth-child(7) { animation-delay: 0.6s, 3s; }
.wave-letter.full-name:nth-child(8) { animation-delay: 0.7s, 3.5s; }

/* Short name animation delays (AJ) */
.wave-letter.short-name:nth-child(9) { animation-delay: 0s, 0s; }
.wave-letter.short-name:nth-child(10) { animation-delay: 0.2s, 1s; }

/* Wave Motion Keyframes */
@keyframes wave {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-15px) rotate(-5deg) scale(1.1);
    }
    50% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    75% {
        transform: translateY(-8px) rotate(3deg) scale(1.05);
    }
}

/* Color Change Animation */
@keyframes colorChange {
    0% { 
        color: #667eea;
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
    14% { 
        color: #764ba2;
        text-shadow: 0 0 20px rgba(118, 75, 162, 0.5);
    }
    28% { 
        color: #f093fb;
        text-shadow: 0 0 20px rgba(240, 147, 251, 0.5);
    }
    42% { 
        color: #4facfe;
        text-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
    }
    56% { 
        color: #43e97b;
        text-shadow: 0 0 20px rgba(67, 233, 123, 0.5);
    }
    70% { 
        color: #fa709a;
        text-shadow: 0 0 20px rgba(250, 112, 154, 0.5);
    }
    84% { 
        color: #fee140;
        text-shadow: 0 0 20px rgba(254, 225, 64, 0.5);
    }
    100% { 
        color: #667eea;
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
}

/* Hero Section Large Letters with Wave */
.wave-letter-hero {
    display: inline-block;
    font-size: inherit;
    animation: waveHero 4s ease-in-out infinite, colorChangeHero 8s linear infinite;
    transform-origin: center bottom;
}

.wave-letter-hero:nth-child(1) { animation-delay: 0s, 0s; }
.wave-letter-hero:nth-child(2) { animation-delay: 0.15s, 0.7s; }
.wave-letter-hero:nth-child(3) { animation-delay: 0.3s, 1.4s; }
.wave-letter-hero:nth-child(4) { animation-delay: 0.45s, 2.1s; }
.wave-letter-hero:nth-child(5) { animation-delay: 0.6s, 2.8s; }
.wave-letter-hero:nth-child(6) { animation-delay: 0.75s, 3.5s; }
.wave-letter-hero:nth-child(7) { animation-delay: 0.9s, 4.2s; }
.wave-letter-hero:nth-child(8) { animation-delay: 1.05s, 4.9s; }

@keyframes waveHero {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    20% {
        transform: translateY(-25px) rotate(-8deg) scale(1.15);
    }
    40% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    60% {
        transform: translateY(-15px) rotate(5deg) scale(1.08);
    }
    80% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes colorChangeHero {
    0% { 
        color: #667eea;
        text-shadow: 0 0 40px rgba(102, 126, 234, 0.8), 0 0 80px rgba(102, 126, 234, 0.4);
    }
    12.5% { 
        color: #764ba2;
        text-shadow: 0 0 40px rgba(118, 75, 162, 0.8), 0 0 80px rgba(118, 75, 162, 0.4);
    }
    25% { 
        color: #f093fb;
        text-shadow: 0 0 40px rgba(240, 147, 251, 0.8), 0 0 80px rgba(240, 147, 251, 0.4);
    }
    37.5% { 
        color: #4facfe;
        text-shadow: 0 0 40px rgba(79, 172, 254, 0.8), 0 0 80px rgba(79, 172, 254, 0.4);
    }
    50% { 
        color: #43e97b;
        text-shadow: 0 0 40px rgba(67, 233, 123, 0.8), 0 0 80px rgba(67, 233, 123, 0.4);
    }
    62.5% { 
        color: #fa709a;
        text-shadow: 0 0 40px rgba(250, 112, 154, 0.8), 0 0 80px rgba(250, 112, 154, 0.4);
    }
    75% { 
        color: #fee140;
        text-shadow: 0 0 40px rgba(254, 225, 64, 0.8), 0 0 80px rgba(254, 225, 64, 0.4);
    }
    87.5% { 
        color: #30cfd0;
        text-shadow: 0 0 40px rgba(48, 207, 208, 0.8), 0 0 80px rgba(48, 207, 208, 0.4);
    }
    100% { 
        color: #667eea;
        text-shadow: 0 0 40px rgba(102, 126, 234, 0.8), 0 0 80px rgba(102, 126, 234, 0.4);
    }
}

/* Footer Wave Animation (Subtle) */
.animated-name-footer .wave-letter {
    animation: waveSubtle 4s ease-in-out infinite, colorChangeSubtle 8s linear infinite;
}

@keyframes waveSubtle {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

@keyframes colorChangeSubtle {
    0%, 100% { 
        color: #667eea;
    }
    33% { 
        color: #4facfe;
    }
    66% { 
        color: #43e97b;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.5);
    }
}

/* Gradient Animation for Backgrounds */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Sun Rays Rotation */
@keyframes rotateSunRays {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* Typing Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

/* Utility Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

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

.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(102, 126, 234, 0.6);
}

/* Progress Bar Animation */
@keyframes progressBar {
    from {
        width: 0;
    }
}

/* Notification Slide In */
@keyframes slideInNotification {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Status Badge Pulse */
.status-dot {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Scroll Indicator Animation */
@keyframes scrollIndicator {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    50% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

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

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

/* Button Press Effect */
.btn-press {
    transition: transform 0.1s ease;
}

.btn-press:active {
    transform: scale(0.95);
}

/* Stagger Animation Delays */
.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; }

/* 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;
    }
    
    .wave-letter,
    .wave-letter-hero {
        animation: none !important;
    }
}
