/* ============================================
   ITBS Website - Scroll & Entrance Animations
   ============================================ */

/* ---- Fade Up Animation ---- */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ---- Scale In ---- */
.animate-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ---- Particle animation for hero ---- */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(20px, -30px) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-10px, -60px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(15px, -40px) scale(1.05);
        opacity: 0.5;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(79, 70, 229, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

/* ---- Gradient text shimmer ---- */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.hero-title .gradient-text {
    background-size: 200% auto;
    animation: shimmer 4s linear infinite;
}

/* ---- Counter glow on complete ---- */
@keyframes counter-glow {
    0% { text-shadow: none; }
    50% { text-shadow: 0 0 20px rgba(79, 70, 229, 0.3); }
    100% { text-shadow: none; }
}

.stat-number.counted {
    animation: counter-glow 1s ease-out;
}

/* ---- Card hover lift ---- */
@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Loading skeleton ---- */
@keyframes skeleton {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ---- Chatbot entrance ---- */
@keyframes chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-window.open {
    animation: chatbot-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- Typing indicator ---- */
@keyframes typing-dot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    display: block;
    width: 7px;
    height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing-dot 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ---- Notification ping ---- */
@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    75%, 100% { transform: scale(2); opacity: 0; }
}

.chatbot-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #DC2626;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ---- Floating background bubbles ---- */
.bg-bubbles {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.bg-bubbles span {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: bubble-float linear infinite;
}

/* Bubble sizes, colors & positions — smaller, slower */
.bg-bubbles span:nth-child(1)  { width: 40px;  height: 40px;  left: 8%;   background: rgba(156,163,175,0.07); animation-duration: 35s; animation-delay: 0s; }
.bg-bubbles span:nth-child(2)  { width: 70px;  height: 70px;  left: 20%;  background: rgba(107,114,128,0.05); animation-duration: 42s; animation-delay: 4s; }
.bg-bubbles span:nth-child(3)  { width: 30px;  height: 30px;  left: 35%;  background: rgba(156,163,175,0.08); animation-duration: 30s; animation-delay: 8s; }
.bg-bubbles span:nth-child(4)  { width: 55px;  height: 55px;  left: 50%;  background: rgba(107,114,128,0.05); animation-duration: 45s; animation-delay: 2s; }
.bg-bubbles span:nth-child(5)  { width: 35px;  height: 35px;  left: 60%;  background: rgba(156,163,175,0.06); animation-duration: 38s; animation-delay: 6s; }
.bg-bubbles span:nth-child(6)  { width: 50px;  height: 50px;  left: 72%;  background: rgba(107,114,128,0.07); animation-duration: 40s; animation-delay: 10s; }

@keyframes bubble-float {
    0% {
        bottom: -80px;
        opacity: 0;
        transform: translateX(0) scale(0.9);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateX(20px) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 110vh;
        opacity: 0;
        transform: translateX(-15px) scale(0.95);
    }
}

/* ---- Reduce motion for accessibility ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate-fade-up {
        opacity: 1;
        transform: none;
    }
    .marquee-track { animation: none; }
    .bg-bubbles { display: none; }
}
