/* Animation Styles for Piano Waterfall Website */

/* Keyframe 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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@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 rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

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

@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.6), 0 0 30px rgba(37, 99, 235, 0.4);
    }
}

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

@keyframes wiggle {
    0%, 7%, 14%, 21%, 28%, 35%, 42%, 49%, 56%, 63%, 70%, 77%, 84%, 91%, 98%, 100% {
        transform: translateX(0);
    }
    3.5%, 10.5%, 17.5%, 24.5%, 31.5%, 38.5%, 45.5%, 52.5%, 59.5%, 66.5%, 73.5%, 80.5%, 87.5%, 94.5% {
        transform: translateX(-2px);
    }
}

/* Piano-specific Animations */
@keyframes keyPress {
    0% {
        transform: scaleY(1);
        background-color: white;
    }
    50% {
        transform: scaleY(0.95);
        background-color: #f0f0f0;
    }
    100% {
        transform: scaleY(1);
        background-color: white;
    }
}

@keyframes blackKeyPress {
    0% {
        transform: scaleY(1);
        background-color: #2d3748;
    }
    50% {
        transform: scaleY(0.9);
        background-color: #1a202c;
    }
    100% {
        transform: scaleY(1);
        background-color: #2d3748;
    }
}

@keyframes noteGlow {
    0% {
        box-shadow: 0 0 5px currentColor;
        opacity: 0.8;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 5px currentColor;
        opacity: 0.8;
    }
}

@keyframes waterfallFlow {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px));
        opacity: 0;
    }
}

@keyframes pianoWave {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(1deg);
    }
    75% {
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes musicNote {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-40px) rotate(180deg);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-60px) rotate(270deg);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-80px) rotate(360deg);
        opacity: 0;
    }
}

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

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

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

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes heartbeat {
    0%, 14%, 28%, 42%, 56%, 70%, 84%, 98% {
        transform: scale(1);
    }
    7%, 21%, 35%, 49%, 63%, 77%, 91% {
        transform: scale(1.1);
    }
}

@keyframes zoomInOut {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes slideShow {
    0%, 20% {
        opacity: 1;
        transform: translateX(0);
    }
    25%, 95% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
    }
}

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

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

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

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

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

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

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

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

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

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

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

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

.animate-key-press {
    animation: keyPress 0.2s ease-out;
}

.animate-black-key-press {
    animation: blackKeyPress 0.2s ease-out;
}

.animate-note-glow {
    animation: noteGlow 1.5s ease-in-out infinite;
}

.animate-waterfall-flow {
    animation: waterfallFlow 3s linear infinite;
}

.animate-piano-wave {
    animation: pianoWave 4s ease-in-out infinite;
}

.animate-music-note {
    animation: musicNote 2s ease-out forwards;
}

.animate-ripple {
    animation: ripple 0.6s linear;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

.animate-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid;
    animation: typewriter 3s steps(30) 1s both, blink 1s step-end infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-zoom-in-out {
    animation: zoomInOut 2s ease-in-out infinite;
}

/* Delay Classes */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Duration Classes */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }

/* Infinite Classes */
.infinite { animation-iteration-count: infinite; }

/* Hover Animations */
.hover-float:hover {
    animation: float 1s ease-in-out infinite;
}

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

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

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

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

.hover-lift:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform 0.3s ease;
}

/* Piano Waterfall Specific Animations */
.falling-notes-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.falling-note {
    position: absolute;
    width: 20px;
    height: 60px;
    border-radius: 4px;
    opacity: 0.8;
    animation: waterfallFlow 4s linear infinite;
}

.falling-note:nth-child(1) {
    left: 10%;
    background: #10b981;
    animation-delay: 0s;
}

.falling-note:nth-child(2) {
    left: 25%;
    background: #3b82f6;
    animation-delay: 0.8s;
}

.falling-note:nth-child(3) {
    left: 40%;
    background: #8b5cf6;
    animation-delay: 1.6s;
}

.falling-note:nth-child(4) {
    left: 55%;
    background: #f59e0b;
    animation-delay: 2.4s;
}

.falling-note:nth-child(5) {
    left: 70%;
    background: #ef4444;
    animation-delay: 3.2s;
}

.falling-note:nth-child(6) {
    left: 85%;
    background: #06b6d4;
    animation-delay: 4s;
}

/* Piano Keys Animation */
.piano-keys-animated {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.animated-key {
    width: 40px;
    height: 120px;
    background: white;
    border: 1px solid #ddd;
    margin: 0 1px;
    border-radius: 0 0 8px 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
}

.animated-key.black {
    width: 25px;
    height: 80px;
    background: #2d3748;
    position: absolute;
    z-index: 2;
    margin: 0;
}

.animated-key.active {
    animation: keyPress 0.3s ease-out;
}

.animated-key.black.active {
    animation: blackKeyPress 0.3s ease-out;
}

/* Loading Animations */
.loading-piano {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-piano div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: currentColor;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-piano div:nth-child(1) {
    left: 8px;
    animation: piano-load1 0.6s infinite;
}

.loading-piano div:nth-child(2) {
    left: 8px;
    animation: piano-load2 0.6s infinite;
}

.loading-piano div:nth-child(3) {
    left: 32px;
    animation: piano-load2 0.6s infinite;
}

.loading-piano div:nth-child(4) {
    left: 56px;
    animation: piano-load3 0.6s infinite;
}

@keyframes piano-load1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes piano-load3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes piano-load2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-animate.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Music Wave Animation */
.music-wave {
    display: inline-flex;
    align-items: end;
    gap: 2px;
    height: 20px;
}

.wave-bar {
    width: 3px;
    background: currentColor;
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 14px; animation-delay: 0.3s; }
.wave-bar:nth-child(5) { height: 12px; animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.3);
    }
}

/* Button Click Effect */
.btn-click-effect {
    position: relative;
    overflow: hidden;
}

.btn-click-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-click-effect:active::before {
    width: 300px;
    height: 300px;
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.animation-paused {
    animation-play-state: paused;
}

.animation-running {
    animation-play-state: running;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-waterfall-flow,
    .animate-float,
    .animate-pulse,
    .animate-glow {
        animation: none;
    }
} 