/* ===== Modern Animations & Design Enhancements ===== */

/* Smooth page transitions - Fixed to prevent layout shifting */
.page {
    /* Animation removed - handled by style.css with opacity-only fade */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Card hover effects with modern shadow */
.activity-card,
.stat-card,
.tip-card,
.person-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.activity-card::before,
.stat-card::before,
.tip-card::before,
.person-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.activity-card:hover,
.stat-card:hover,
.tip-card:hover,
.person-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(99, 102, 241, 0.2),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

.activity-card:hover::before,
.stat-card:hover::before,
.tip-card:hover::before,
.person-card:hover::before {
    opacity: 1;
}

/* Smooth button animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Glassmorphism effect for modals */
.modal.active {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .modal-content {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Micro-interactions for icons */
.fa, .fas, .far {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover .fa,
.btn:hover .fas,
.btn:hover .far,
.nav-link:hover .fa,
.nav-link:hover .fas {
    transform: scale(1.15) rotate(5deg);
}

.btn-icon:hover i {
    transform: rotate(180deg);
}

/* Smooth input focus animations */
input:focus,
textarea:focus,
select:focus {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(99, 102, 241, 0.2),
        0 0 0 3px rgba(99, 102, 241, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Nav link animations */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transform: translateX(-50%);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 3px 3px 0 0;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Stat value count-up animation */
.stat-value {
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading spinner with modern gradient */
.loader {
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stagger animation for lists */
.activities-list > *,
.people-grid > * {
    animation: staggerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.activities-list > *:nth-child(1) { animation-delay: 0.05s; }
.activities-list > *:nth-child(2) { animation-delay: 0.1s; }
.activities-list > *:nth-child(3) { animation-delay: 0.15s; }
.activities-list > *:nth-child(4) { animation-delay: 0.2s; }
.activities-list > *:nth-child(5) { animation-delay: 0.25s; }

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

/* Notification toast animations */
.notification {
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification.hiding {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

/* Ripple effect for clicks */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(
        90deg,
        #6366f1,
        #8b5cf6,
        #ec4899,
        #8b5cf6,
        #6366f1
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* Floating animation for hero elements */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse animation for important elements */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Parallax scrolling effect */
.parallax {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Badge animations */
.badge {
    animation: badgeAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Toggle switch smooth animation */
.toggle-switch input:checked + label::after {
    transform: translateX(20px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Tab switching animation */
.tab-content {
    animation: tabFade 0.4s ease;
}

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

/* Avatar animation on hover */
.avatar {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

/* Success checkmark animation */
.success-checkmark {
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .activity-card:hover,
    .stat-card:hover,
    .tip-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}
