/* ==========================================================================
   ANIMATIONS
   Motion and transition effects
   ========================================================================== */

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

/* Fade In */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease-in-out;
}

/* Slide In */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out forwards;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* Gentle Bounce */
@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.gentle-bounce {
    animation: gentleBounce 3s ease-in-out infinite;
}

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

.rotate {
    animation: rotate 20s linear infinite;
}

/* Breathing Circle Animation */
.breathing-circle {
    animation: breathe var(--breath-duration) infinite ease-in-out;
}

/* Button Hover Effects */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease-out;
}

.btn-hover-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn-hover-effect:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Page Load Animation */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-load {
    animation: pageLoad 0.6s ease-out forwards;
}

/* Staggered Animation for Grid Items */
.state-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

.state-card:nth-child(1) { animation-delay: 0.1s; }
.state-card:nth-child(2) { animation-delay: 0.2s; }
.state-card:nth-child(3) { animation-delay: 0.3s; }
.state-card:nth-child(4) { animation-delay: 0.4s; }

/* Breathing Exercise Animation */
@keyframes breathIn {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes breathOut {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.breath-in {
    animation: breathIn 4s infinite ease-in-out;
}

.breath-out {
    animation: breathOut 4s infinite ease-in-out;
}

/* Button Press Effect */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.button-press {
    animation: buttonPress 0.2s ease-out;
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slight Hover Lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Accessibility: Reduced Motion Override */
@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;
    }
    
    .breathing-circle,
    .breath-in,
    .breath-out,
    .pulse,
    .gentle-bounce,
    .rotate {
        animation: none !important;
    }
    
    .fade-in,
    .slide-in-up,
    .fade-in-up,
    .state-card {
        animation: fadeIn 0.5s ease-out forwards !important;
    }
}
