/* ========================================
   DailyCal - Animations & Transitions
   Smooth scroll animations and effects
   ======================================== */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale Animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.2);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(211, 255, 86, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(211, 255, 86, 0.8);
    }
}

/* Slide Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

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

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

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   Animation Classes
   ======================================== */

/* Fade Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

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

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

/* Float Class */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Class */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Glow Class */
.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Zoom Classes */
.animate-zoom-in {
    animation: zoomIn 0.6s ease-out forwards;
}

.animate-zoom-out {
    animation: zoomOut 0.6s ease-out forwards;
}

/* Bounce Class */
.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* ========================================
   Scroll-triggered Animations
   ======================================== */

/* Elements that will animate on scroll */
[data-aos] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"].aos-animate {
    animation: fadeInUp 0.8s ease-out forwards;
}

[data-aos="fade-down"].aos-animate {
    animation: fadeInDown 0.8s ease-out forwards;
}

[data-aos="fade-left"].aos-animate {
    animation: fadeInLeft 0.8s ease-out forwards;
}

[data-aos="fade-right"].aos-animate {
    animation: fadeInRight 0.8s ease-out forwards;
}

[data-aos="zoom-in"].aos-animate {
    animation: zoomIn 0.8s ease-out forwards;
}

[data-aos="zoom-out"].aos-animate {
    animation: zoomOut 0.8s ease-out forwards;
}

/* Animation Delays */
[data-aos-delay="100"] {
    transition-delay: 0.1s;
}

[data-aos-delay="200"] {
    transition-delay: 0.2s;
}

[data-aos-delay="300"] {
    transition-delay: 0.3s;
}

[data-aos-delay="400"] {
    transition-delay: 0.4s;
}

[data-aos-delay="500"] {
    transition-delay: 0.5s;
}

/* ========================================
   Hover Effects
   ======================================== */

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(211, 255, 86, 0.6);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ========================================
   Loading Animations
   ======================================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* ========================================
   Transition Utilities
   ======================================== */

.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

/* ========================================
   Page Transitions
   ======================================== */

.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   Text Effects
   ======================================== */

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(211, 255, 86, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(211, 255, 86, 0.8);
    }
}

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

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(90deg, var(--primary-color), #ffffff, var(--primary-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   Button Animations
   ======================================== */

.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   Card Animations
   ======================================== */

.card-hover-3d {
    transition: transform 0.3s ease;
}

.card-hover-3d:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(-5deg);
}

/* ========================================
   Stagger Animation
   ======================================== */

.stagger-animation > *:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animation > *:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animation > *:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animation > *:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animation > *:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animation > *:nth-child(6) {
    animation-delay: 0.6s;
}

/* ========================================
   Accessibility - Respect User Preferences
   ======================================== */

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