/* 
 * animations.css
 * Keyframe animations and animation utility classes
 * Used throughout the application
 */

/* ========================================
   FADE ANIMATIONS
   ======================================== */

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

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

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

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

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

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

/* ========================================
   SLIDE ANIMATIONS
   ======================================== */

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

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

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

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

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

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

/* ========================================
   SCALE & ZOOM ANIMATIONS
   ======================================== */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ========================================
   ROTATE ANIMATIONS
   ======================================== */

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

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

/* ========================================
   PULSE & BLINK ANIMATIONS
   ======================================== */

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

@keyframes pulseBorder {
    0%, 100% {
        border-color: var(--accent-cyan);
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
    }
    50% {
        border-color: var(--accent-purple);
        box-shadow: 0 0 10px rgba(123, 44, 191, 0.5);
    }
}

@keyframes blink {
    0%, 19%, 21%, 100% {
        opacity: 1;
    }
    20% {
        opacity: 0;
    }
}

/* ========================================
   GLOW ANIMATIONS
   ======================================== */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
    }
}

@keyframes glowPurple {
    0%, 100% {
        box-shadow: 0 0 5px rgba(123, 44, 191, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(123, 44, 191, 0.8);
    }
}

/* ========================================
   BOUNCE ANIMATIONS
   ======================================== */

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounceOut {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* ========================================
   SHAKE ANIMATIONS
   ======================================== */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ========================================
   FLIP ANIMATIONS
   ======================================== */

@keyframes flipX {
    0% {
        transform: perspective(400px) rotateX(0);
        opacity: 1;
    }
    40% {
        transform: perspective(400px) rotateX(170deg);
    }
    100% {
        transform: perspective(400px) rotateX(190deg);
        opacity: 0;
    }
}

/* ========================================
   GRADIENT ANIMATIONS
   ======================================== */

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

/* ========================================
   ANIMATION UTILITY CLASSES
   ======================================== */

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

.animate-fade-out {
    animation: fadeOut 0.3s ease-out;
}

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

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

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

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

.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

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

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

.animate-slide-out-left {
    animation: slideOutLeft 0.3s ease-out;
}

.animate-slide-out-right {
    animation: slideOutRight 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-scale-out {
    animation: scaleOut 0.3s ease-out;
}

.animate-zoom-in {
    animation: zoomIn 0.3s ease-out;
}

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

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-pulse-border {
    animation: pulseBorder 2s ease-in-out infinite;
}

.animate-blink {
    animation: blink 1.4s steps(1) infinite;
}

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

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

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

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-bounce-out {
    animation: bounceOut 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.animate-flip-x {
    animation: flipX 0.6s ease-out;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   ANIMATION SPEED MODIFIERS
   ======================================== */

.animate-slow {
    animation-duration: 1s;
}

.animate-normal {
    animation-duration: 0.6s;
}

.animate-fast {
    animation-duration: 0.3s;
}

.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-500 {
    animation-delay: 0.5s;
}

/* ========================================
   TRANSITION UTILITIES
   ======================================== */

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

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

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

.transition-colors {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

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

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

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

/* ========================================
   HOVER ANIMATIONS
   ======================================== */

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

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.hover-glow-purple:hover {
    box-shadow: 0 0 20px rgba(123, 44, 191, 0.5);
}

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

.hover-scale-lg:hover {
    transform: scale(1.1);
}

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

.hover-blur:hover {
    filter: blur(1px);
}

.hover-brighten:hover {
    filter: brightness(1.1);
}

/* ========================================
   FOCUS ANIMATIONS
   ======================================== */

.focus-glow:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.5);
}

.focus-ring:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* ========================================
   SPINNER ANIMATIONS
   ======================================== */

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinner-grow {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

.spinner-grow {
    animation: spinner-grow 0.75s linear infinite;
}

/* ========================================
   LOADING BAR ANIMATION
   ======================================== */

@keyframes loading {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    50% {
        transform-origin: left;
    }
    50.1% {
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

.loading-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    animation: loading 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ========================================
   GRADIENT ANIMATIONS
   ======================================== */

.gradient-animated {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-cyan));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   PAGE TRANSITION ANIMATIONS
   ======================================== */

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

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

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

/* ========================================
   RESPONSIVE ANIMATION ADJUSTMENTS
   ======================================== */

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

@media (max-width: 768px) {
    .animate-slow {
        animation-duration: 0.6s;
    }
    
    .hover-lift:hover {
        transform: translateY(-1px);
    }
}
