/* ==============================================
   ANIMATIONS CSS
   Smooth Transitions & Micro-interactions
   ============================================== */

/* ========== 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);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.4s ease-out;
}

/* ========== SLIDE ANIMATIONS ========== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

/* ========== SCALE ANIMATIONS ========== */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ========== BOUNCE ANIMATION ========== */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out;
}

/* ========== TYPING INDICATOR ========== */
@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* ========== SHIMMER LOADING ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            var(--bg-card) 0%,
            var(--bg-hover) 50%,
            var(--bg-card) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========== GLOW EFFECT ========== */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* ========== SHAKE ANIMATION ========== */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ========== GRADIENT ANIMATION ========== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(270deg,
            var(--primary),
            var(--secondary),
            var(--accent-pink));
    background-size: 400% 400%;
    animation: gradientShift 5s ease infinite;
}

/* ========== FLOAT ANIMATION ========== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ========== ROTATE ANIMATION ========== */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* ========== HOVER EFFECTS ========== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow:hover {
    box-shadow: var(--glow-primary);
}

/* ========== TRANSITIONS ========== */
.transition-all {
    transition: all var(--transition-base);
}

.transition-fast {
    transition: all var(--transition-fast);
}

.transition-slow {
    transition: all var(--transition-slow);
}

/* ========== STAGGER ANIMATION ========== */
.stagger-fade-in>* {
    animation: fadeInUp 0.4s ease-out backwards;
}

.stagger-fade-in>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-fade-in>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-fade-in>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-fade-in>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-fade-in>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-fade-in>*:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-fade-in>*:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-fade-in>*:nth-child(8) {
    animation-delay: 0.8s;
}

/* ========== PAGE TRANSITION ========== */
.page-transition {
    animation: fadeInUp 0.5s ease-out;
}

/* ========== PROGRESS BAR ANIMATION ========== */
@keyframes progress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: progress 2s ease-out;
    border-radius: var(--radius-full);
}

/* ========== RIPPLE EFFECT ========== */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 100px;
    height: 100px;
}