/* =============================================================================
   Animations CSS - Interactive elements and smooth transitions
   ============================================================================= */

/* =============================================================================
   Keyframe Animations
   ============================================================================= */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in down animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in left animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in right animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(-4px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Glow animation */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.8), 0 0 30px rgba(255, 107, 107, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
}

/* =============================================================================
   Animation Classes
   ============================================================================= */

/* Basic animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s infinite;
}

/* Delayed animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* =============================================================================
   Interactive Hover Effects
   ============================================================================= */

/* Hero CTA Button Hover Effects */
.hero__cta {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hero__cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.hero__cta:hover::before {
    left: 100%;
}

/* Feature Card Hover Effects */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card__icon {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-card__icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card__icon-emoji {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-card__icon-emoji {
    transform: scale(1.2);
}

.feature-card__content {
    position: relative;
    z-index: 2;
}

/* Community Card Hover Effects */
.community__card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.community__card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
}

.community__card:hover::before {
    transform: scale(1);
}

.community__title {
    transition: color 0.3s ease;
}

.community__card:hover .community__title {
    color: #667eea;
}

/* Footer Link Hover Effects */
.footer__privacy-link,
.footer__terms-link,
.footer__nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.footer__privacy-link::after,
.footer__terms-link::after,
.footer__nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.footer__privacy-link:hover::after,
.footer__terms-link:hover::after,
.footer__nav-link:hover::after {
    width: 100%;
}

/* =============================================================================
   Scroll Animations
   ============================================================================= */

/* Scroll reveal animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered scroll reveal */
.scroll-reveal-stagger {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-reveal-stagger.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-stagger.revealed:nth-child(1) {
    transition-delay: 0.1s;
}

.scroll-reveal-stagger.revealed:nth-child(2) {
    transition-delay: 0.2s;
}

.scroll-reveal-stagger.revealed:nth-child(3) {
    transition-delay: 0.3s;
}

/* =============================================================================
   Loading Animations
   ============================================================================= */

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* =============================================================================
   Focus States for Accessibility
   ============================================================================= */

/* Focus ring */
.focus-ring {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Focus visible */
.focus-visible:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000000;
    color: #ffffff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* =============================================================================
   Interactive States
   ============================================================================= */

/* Button states */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Link states */
.link {
    transition: all 0.3s ease;
    position: relative;
}

.link:active {
    color: #4a5568;
}

/* =============================================================================
   Parallax Effects
   ============================================================================= */

.parallax {
    transform: translateZ(0);
    will-change: transform;
}

.parallax-slow {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.parallax-fast {
    transform: translateY(0);
    transition: transform 0.05s ease-out;
}

/* =============================================================================
   Micro-interactions
   ============================================================================= */

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Shake animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Heartbeat animation */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* =============================================================================
   Performance optimizations
   ============================================================================= */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-all {
    will-change: all;
}

/* Hardware acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* =============================================================================
   Responsive animations
   ============================================================================= */

@media screen and (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-slide-in-left,
    .animate-slide-in-right {
        animation-duration: 0.6s;
    }
    
    .parallax {
        transform: none !important;
    }
    
    .parallax-slow,
    .parallax-fast {
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-slide-in-left,
    .animate-slide-in-right,
    .animate-scale-in,
    .animate-bounce,
    .animate-pulse,
    .animate-glow {
        animation: none !important;
    }
    
    .scroll-reveal,
    .scroll-reveal-stagger {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .parallax,
    .parallax-slow,
    .parallax-fast {
        transform: none !important;
    }
    
    .ripple::before {
        transition: none !important;
    }
}