/* Animations and Micro-interactions */

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

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

/* Slide In Animation */
@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Apply Animations to Elements */
[data-animate] {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

[data-animate="scale"] {
    animation: scaleIn 0.5s ease-out forwards;
}

[data-animate="slide"] {
    animation: slideIn 0.5s ease-out forwards;
}

/* Stagger child animations */
[data-animate-stagger] > * {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

[data-animate-stagger] > *:nth-child(1) { animation-delay: 0.1s; }
[data-animate-stagger] > *:nth-child(2) { animation-delay: 0.2s; }
[data-animate-stagger] > *:nth-child(3) { animation-delay: 0.3s; }
[data-animate-stagger] > *:nth-child(4) { animation-delay: 0.4s; }
[data-animate-stagger] > *:nth-child(5) { animation-delay: 0.5s; }

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-base);
}

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

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

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

/* Button Interactions */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(0);
    border-radius: inherit;
    transition: transform 0.4s ease-out;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Form Field Interactions */
.form-field {
    position: relative;
}

.form-field input:focus + label {
    color: var(--brand-primary);
    transform: translateY(-24px) scale(0.8);
}

/* Success Animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: checkmark 0.5s ease-out forwards;
}

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

.error-animation {
    animation: shake 0.4s ease-in-out;
}

/* Page Transition */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease-out 0.2s forwards;
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--brand-primary);
    transform-origin: left;
    z-index: 1000;
}