/* Keyframe Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--bright-blue);
    }
    50% {
        box-shadow: 0 0 20px var(--bright-blue), 0 0 30px var(--bright-blue);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

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

/* Animation Classes */
.animate-slide-up {
    animation: slideInUp 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

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

/* Page Load Animations */
.card:nth-child(1) {
    animation: slideInUp 0.6s ease-out 0.1s both;
}

.card:nth-child(2) {
    animation: slideInUp 0.6s ease-out 0.2s both;
}

.card:nth-child(3) {
    animation: slideInUp 0.6s ease-out 0.3s both;
}

.card:nth-child(4) {
    animation: slideInUp 0.6s ease-out 0.4s both;
}

.card:nth-child(5) {
    animation: slideInUp 0.6s ease-out 0.5s both;
}

.card:nth-child(6) {
    animation: slideInUp 0.6s ease-out 0.6s both;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(64, 224, 255, 0.2), transparent);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Hover Animations */
.card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn,
.add-btn,
.send-btn,
.save-btn,
.task-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-day {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Success/Error States */
.success-feedback {
    animation: bounce 0.6s ease-in-out, glow 0.8s ease-in-out;
}

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

/* Progress Animation */
.progress-fill {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Notification Animations */
.notification {
    animation: slideInRight 0.5s ease-out;
}

.notification.removing {
    animation: slideInRight 0.5s ease-out reverse;
}

/* Status Indicator Pulse */
.status-indicator {
    animation: pulse 2s ease-in-out infinite;
}

.status-online {
    animation: glow 2s ease-in-out infinite;
}

/* Weather Animation */
.weather-temp {
    transition: all 0.3s ease;
}

.weather-temp:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px var(--bright-blue);
}

/* Form Focus Animations */
input:focus,
textarea:focus {
    animation: glow 0.3s ease-out;
}

/* Mobile Animations */
@media (max-width: 768px) {
    /* Reduce motion for mobile */
    .card {
        transition: all 0.2s ease;
    }
    
    .card:hover {
        transform: translateY(-2px);
    }
    
    /* Faster animations for mobile */
    .animate-slide-up,
    .animate-slide-left,
    .animate-slide-right {
        animation-duration: 0.4s;
    }
}

/* Prefers 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;
    }
    
    .animate-pulse,
    .animate-glow,
    .animate-rotate,
    .loading::after,
    .status-indicator {
        animation: none !important;
    }
}