/* ============================================
   ANIMATIONS - Transitions & Effects
   ============================================ */

/* ---- Page Transition ---- */
.page-content {
    animation: fadeInUp 0.4s ease;
}

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

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

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

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

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

/* ---- Pulse Glow ---- */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(97, 218, 251, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(97, 218, 251, 0.4);
    }
}

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

/* ---- Gradient Shift ---- */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* ---- Stagger Children ---- */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }
.stagger-children > *:nth-child(7) { animation-delay: 360ms; }
.stagger-children > *:nth-child(8) { animation-delay: 420ms; }

/* ---- Card Hover Shine ---- */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.02),
        transparent
    );
    transition: left 0.6s ease;
    pointer-events: none;
}

.card:hover::after {
    left: 100%;
}

/* ---- Floating Animation ---- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* ---- Typing Cursor ---- */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    color: var(--accent-react);
    animation: blink 0.8s step-end infinite;
    margin-left: 2px;
}

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-card) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ---- Code Block Line Highlight ---- */
.code-block pre code .highlight-line {
    background: rgba(97, 218, 251, 0.08);
    display: block;
    margin: 0 -1rem;
    padding: 0 1rem;
    border-left: 3px solid var(--accent-react);
}

/* ---- Hero Section Animation ---- */
.hero-section {
    animation: fadeInUp 0.5s ease;
}

.hero-section .hero-badges {
    animation: fadeInUp 0.5s ease 0.2s both;
}

/* ---- Smooth Section Transitions ---- */
.concept-def,
.card,
.mini-card,
.alert,
.code-block,
.comparison,
.flow-diagram,
.accordion-item {
    animation: fadeInUp 0.35s ease both;
}

/* ---- Interactive Hover States ---- */
.feature-item {
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

.feature-item:hover::before {
    opacity: 0.03;
}

.feature-item > * {
    position: relative;
    z-index: 1;
}

/* ---- Active Nav Indicator ---- */
.tree-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-react);
    border-radius: 3px 0 0 3px;
    animation: scaleIn 0.2s ease;
}
