/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

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

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

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

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

.fade-out {
    animation: fadeOut 0.5s ease-in-out;
}

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

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

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

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

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

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

.slide-in-down {
    animation: slideInDown 0.5s ease-out;
}

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

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

/* ============================================
   SCALE 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);
    }
}

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

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

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

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

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

.bounce {
    animation: bounce 1s infinite;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   SPIN ANIMATIONS
   ============================================ */

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

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

.spin {
    animation: spin 1s linear infinite;
}

.spin-reverse {
    animation: spinReverse 1s linear infinite;
}

/* ============================================
   SHIMMER ANIMATION (Loading)
   ============================================ */

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

.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

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

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

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

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

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

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

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

.flip-y {
    animation: flipY 0.6s ease-in-out;
}

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

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

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

/* ============================================
   WAVE ANIMATIONS
   ============================================ */

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

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

/* ============================================
   TYPING ANIMATION
   ============================================ */

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 49% {
        border-right-color: rgba(0, 0, 0, 0.75);
    }
    50%, 100% {
        border-right-color: transparent;
    }
}

.typing {
    overflow: hidden;
    border-right: 3px solid;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

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

.transition-fast {
    transition: all 150ms ease-in-out;
}

.transition-base {
    transition: all 200ms ease-in-out;
}

.transition-slow {
    transition: all 300ms ease-in-out;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

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

.hover-scale {
    transition: transform 200ms ease-out;
}

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

.hover-glow {
    transition: box-shadow 200ms ease-out;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.hover-color {
    transition: color 200ms ease-out;
}

.hover-color:hover {
    color: var(--primary-color);
}

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */

.stagger-item {
    animation: slideInUp 0.5s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(n+6) { animation-delay: 0.6s; }

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.scroll-fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.scroll-slide-in {
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--spacing-sm);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-xl);
}

