/* Animations */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide In */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Heart Beat */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1);
    }
}

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

/* Swing */
@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.6);
    }
}

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

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-slideInUp {
    animation: slideInUp 0.6s ease-out;
}

.animate-slideInDown {
    animation: slideInDown 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-zoomIn {
    animation: zoomIn 0.6s ease-out;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

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

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

.animate-rotate {
    animation: rotate 1s linear infinite;
}

.animate-swing {
    animation: swing 1s ease-in-out;
}

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

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

/* Stagger Animation */
.stagger-container {
    display: grid;
    gap: var(--space-lg);
}

.stagger-container > * {
    animation: slideInUp 0.6s ease-out both;
}

.stagger-container > :nth-child(1) {
    animation-delay: 0s;
}

.stagger-container > :nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-container > :nth-child(3) {
    animation-delay: 0.2s;
}

.stagger-container > :nth-child(4) {
    animation-delay: 0.3s;
}

.stagger-container > :nth-child(5) {
    animation-delay: 0.4s;
}

.stagger-container > :nth-child(6) {
    animation-delay: 0.5s;
}

/* Intersection Observer Animation */
.fade-in-on-scroll {
    opacity: 0;
    animation: slideInUp 0.8s ease-out forwards;
}

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

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

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Transform Hover */
.transform-hover {
    transition: transform var(--transition-fast);
}

.transform-hover:hover {
    transform: translateY(-4px);
}

.transform-hover-scale {
    transition: transform var(--transition-fast);
}

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

.transform-hover-rotate {
    transition: transform var(--transition-fast);
}

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

/* Text Animation */
.text-shimmer {
    background: linear-gradient(90deg, #000 25%, #333 50%, #000 75%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

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

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Animation */
@keyframes loadingDots {
    0%, 20% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.1;
        transform: scale(0.6);
    }
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Flip Animation */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }
    to {
        transform: perspective(400px) rotateY(360deg);
    }
}

.animate-flip {
    animation: flip 0.6s ease-out;
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-10px);
    }
}

.animate-wave {
    animation: wave 1s ease-in-out infinite;
}

/* Typewriter Animation */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 100% {
        border-right: 2px solid transparent;
    }
    50% {
        border-right: 2px solid var(--primary);
    }
}

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