/**
 * Animation Definitions
 * Keyframes and animation classes for modern registration page
 */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Fade In Up - Stagger elements on page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slide In Left - For left panel */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right - For right panel */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Rotate Pattern - Background pattern rotation */
@keyframes rotatePattern {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Float Orb - Floating orb movement */
@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(-5px, -20px);
    }
    75% {
        transform: translate(-10px, -5px);
    }
}

/* Pulse - Subtle pulsing effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* Glow - Subtle glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px hsla(45, 90%, 55%, 0.2);
    }
    50% {
        box-shadow: 0 0 40px hsla(45, 90%, 55%, 0.4);
    }
}

/* ===== APPLIED ANIMATIONS ===== */

/* Panel Animations */
.left-panel {
    animation: slideInLeft 0.8s ease-out;
}

.right-panel {
    animation: slideInRight 0.8s ease-out;
}

/* Pattern Overlay Animation */
.pattern-overlay {
    animation: rotatePattern 180s linear infinite;
}

/* Floating Orbs */
.orb {
    animation: floatOrb 20s ease-in-out infinite;
}

.orb-1 {
    animation-duration: 15s;
    animation-delay: 0s;
}

.orb-2 {
    animation-duration: 20s;
    animation-delay: 5s;
}

.orb-3 {
    animation-duration: 18s;
    animation-delay: 2s;
}

/* Left Panel Content - Staggered Fade In */
.logo-section {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.headline {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.subtitle {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.journey-carousel {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.stats-grid {
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.trust-section {
    animation: fadeInUp 0.6s ease-out 1s both;
}

/* Right Panel Content - Staggered Fade In */
.form-header {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.alert {
    animation: fadeInUp 0.4s ease-out both;
}

.form-group {
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) {
    animation-delay: 0.4s;
}

.form-group:nth-child(2) {
    animation-delay: 0.5s;
}

.form-group:nth-child(3) {
    animation-delay: 0.6s;
}

.form-group:nth-child(4) {
    animation-delay: 0.7s;
}

.btn-primary {
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.social-divider {
    animation: fadeInUp 0.6s ease-out 0.9s both;
}

.social-buttons {
    animation: fadeInUp 0.6s ease-out 1s both;
}

.form-trust-indicators {
    animation: fadeInUp 0.6s ease-out 1.1s both;
}

.login-link {
    animation: fadeInUp 0.6s ease-out 1.2s both;
}

/* Rocket Icon Subtle Glow */
.rocket-icon-wrapper {
    animation: glow 3s ease-in-out infinite;
}

/* ===== INTERACTION ANIMATIONS ===== */

/* Button Hover State */
.btn-primary:hover:not(:disabled) {
    animation: none; /* Remove entrance animation on hover */
}

/* Loading State - Spinning */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* ===== REDUCED MOTION SUPPORT ===== */

/*
 * Respect user preference for reduced motion
 * Disable all animations for users who prefer reduced motion
 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Disable specific animations */
    .pattern-overlay,
    .orb {
        animation: none !important;
    }
    
    .rocket-icon-wrapper {
        animation: none !important;
    }
}

/* ===== UTILITY ANIMATION CLASSES ===== */

/* Add these classes via JavaScript for dynamic animations */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Pause animation utility */
.animation-paused {
    animation-play-state: paused !important;
}
