/* =========================================
   ANIMATIONS & MICRO-INTERACTIONS
   ========================================= */

/* 1. Global Utilities */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.slide-up-delay-1 {
    animation-delay: 0.1s;
}

.slide-up-delay-2 {
    animation-delay: 0.2s;
}

.slide-up-delay-3 {
    animation-delay: 0.3s;
}

/* 2. Keyframes */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

/* 3. Component Interactions */

/* Cards (Toolkit, About) */
.card-hover {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    will-change: transform;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(96, 165, 250, 0.3);
    /* Accent Blue */
}

/* Navbar Links */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: translateX(-101%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(0);
}

.nav-link:hover {
    transform: translateY(-1px);
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

/* 4. Chat Specifics */
.message {
    animation: messageSlide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform-origin: bottom left;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

@keyframes messageSlide {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.status-dot {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }

    50% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 8px #22c55e;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

/* Typing Indicator (Bouncing Dots) */
.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* 5. Background Ambient */
.bg-blob {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    animation: blob 20s infinite linear;
}

/* 6. Buttons */
.btn:active {
    transform: scale(0.96);
}

/* 7. Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01s !important;
        scroll-behavior: auto !important;
    }
}