/* Animation Keyframes - Enhanced with modern easing */

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

/* Slide Up Animation with bounce */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

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

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

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

/* Breathing Animation */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Stagger Animation Classes */
.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease-out forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) ease-out forwards;
    opacity: 0;
}

.animate-slide-in-left {
    animation: slideInLeft var(--transition-slow) ease-out forwards;
    opacity: 0;
}

.animate-slide-in-right {
    animation: slideInRight var(--transition-slow) ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn var(--transition-slow) ease-out forwards;
    opacity: 0;
}

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

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

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

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

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

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

.animate-breathe {
    animation: breathe 4s ease-in-out infinite;
}

/* Animation Delays for Staggered Effects */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-400 {
    animation-delay: 0.4s;
}

.animate-delay-500 {
    animation-delay: 0.5s;
}

.animate-delay-600 {
    animation-delay: 0.6s;
}

.animate-delay-700 {
    animation-delay: 0.7s;
}

.animate-delay-800 {
    animation-delay: 0.8s;
}

.animate-delay-900 {
    animation-delay: 0.9s;
}

.animate-delay-250 {
    animation-delay: 0.25s;
}

/* Hover Animations */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

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

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(31, 71, 136, 0.3);
}

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

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

/* Entrance Animations for Scroll Triggers */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

/* Staggered entrance animations */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Performance Optimizations */
.will-animate {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Hero Section Specific Animations */
.hero-section .animate-fade-in,
.hero-section .animate-slide-up,
.hero-section .animate-slide-in-right {
    opacity: 0;
}

/* Ensure animations are visible when they run */
.hero-section .animate-fade-in.loaded,
.hero-section .animate-slide-up.loaded,
.hero-section .animate-slide-in-right.loaded {
    opacity: 1;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-slide-up,
    .animate-slide-in-left,
    .animate-slide-in-right,
    .animate-scale-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .animate-pulse,
    .animate-float,
    .animate-breathe,
    .animate-spin {
        animation: none !important;
    }
    
    .scroll-animate {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none !important;
    }
    
    .phone-frame {
        animation: none !important;
    }
    
    .preview-card {
        animation: none !important;
    }
}

/* Custom Easing Functions */
.ease-out-cubic {
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

.ease-out-quart {
    transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ease-out-expo {
    transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Click feedback animation */
@keyframes click-feedback-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Enhanced single-page animations */
.animate-fade-in {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* In-view state */
.in-view {
    opacity: 1 !important;
    transform: none !important;
}

/* Delay classes for staggered animations */
.animate-delay-100 { animation-delay: 0.1s; transition-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; transition-delay: 0.2s; }
.animate-delay-250 { animation-delay: 0.25s; transition-delay: 0.25s; }
.animate-delay-300 { animation-delay: 0.3s; transition-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; transition-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; transition-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; transition-delay: 0.6s; }
.animate-delay-700 { animation-delay: 0.7s; transition-delay: 0.7s; }
.animate-delay-800 { animation-delay: 0.8s; transition-delay: 0.8s; }
.animate-delay-900 { animation-delay: 0.9s; transition-delay: 0.9s; }
.animate-delay-1000 { animation-delay: 1s; transition-delay: 1s; }

/* Smooth state transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Interactive element states */
.interactive-element {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

.interactive-element:active {
    transform: translateY(0) scale(0.98);
}

.interactive-element.focused {
    outline: 2px solid #1F4788;
    outline-offset: 2px;
}

/* Loading state animations */
.loading-pulse {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal transition enhancements */
.modal-enter {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-exit {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.modal-exit-active {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accessibility: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-slide-up,
    .animate-slide-in-right,
    .animate-scale-in,
    .smooth-transition,
    .interactive-element,
    .loading-pulse,
    .loading-spin,
    .modal-enter-active,
    .modal-exit-active {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    
    .in-view {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .interactive-element.focused {
        outline: 3px solid;
        outline-offset: 3px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .interactive-element:hover {
        transform: none;
    }
    
    .interactive-element:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}/* 
Ripple animation for micro-interactions */
@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Enhanced micro-interaction animations */
@keyframes micro-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes micro-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes success-pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: scale(1);
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(1);
    }
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Prompt animations */
.reengagement-prompt {
    animation: prompt-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes prompt-slide-in {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Smart tooltip animations */
.smart-tooltip {
    animation: tooltip-fade-in 0.2s ease-out;
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Micro-feedback animations */
.micro-feedback {
    animation: feedback-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes feedback-slide-in {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Progressive disclosure animations */
.expandable-content {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-trigger {
    transition: transform 0.2s ease;
}

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

.expand-trigger.expanded {
    transform: rotate(180deg);
}

/* Enhanced focus animations */
.focused {
    animation: focus-pulse 0.3s ease-out;
}

@keyframes focus-pulse {
    0% {
        outline-width: 0px;
        outline-offset: 0px;
    }
    100% {
        outline-width: 2px;
        outline-offset: 2px;
    }
}

/* Attention-grabbing animations */
.attention-grabber::before {
    animation: attention-glow 2s ease-in-out infinite;
}

@keyframes attention-glow {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.02);
    }
}

/* Performance optimizations for micro-interactions */
.micro-bounce,
.micro-shake,
.success-feedback,
.error-feedback {
    will-change: transform;
    backface-visibility: hidden;
}

/* Reduced motion support for micro-interactions */
@media (prefers-reduced-motion: reduce) {
    .micro-bounce,
    .micro-shake,
    .success-feedback,
    .error-feedback,
    .reengagement-prompt,
    .smart-tooltip,
    .micro-feedback,
    .expand-trigger,
    .attention-grabber::before {
        animation: none !important;
        transition: none !important;
    }
    
    .focused {
        animation: none !important;
    }
    
    .expand-trigger:hover,
    .expand-trigger.expanded {
        transform: none !important;
    }
}