/* ============================================================
   ANIMATION STYLESHEET - Rise and Hope Foundation Trust
   ============================================================ */

/* ===========================
   SCROLL REVEAL
   =========================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-zoom {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-zoom.revealed {
    opacity: 1;
    transform: scale(1);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered Animation Delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ===========================
   FLOATING ANIMATION
   =========================== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

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

@keyframes floatUp {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(2deg); }
    66% { transform: translateY(-5px) rotate(-2deg); }
}

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

.float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

.float-up {
    animation: floatUp 10s ease-in-out infinite;
}

/* ===========================
   PULSE ANIMATION
   =========================== */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes pulseShadow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 116, 144, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(14, 116, 144, 0); }
}

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

.pulse-shadow {
    animation: pulseShadow 2s ease-in-out infinite;
}

/* ===========================
   GLOW ANIMATION
   =========================== */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary); }
    50% { box-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary); }
}

.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;
}

/* ===========================
   BOUNCE ANIMATION
   =========================== */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
    0%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-30px); }
    70% { transform: translateY(-15px); }
    90% { transform: translateY(-4px); }
}

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

/* ===========================
   FADE ANIMATIONS
   =========================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

.fade-in { animation: fadeIn 0.6s ease-in-out; }
.fade-in-up { animation: fadeInUp 0.6s ease-in-out; }
.fade-in-down { animation: fadeInDown 0.6s ease-in-out; }
.fade-in-left { animation: fadeInLeft 0.6s ease-in-out; }
.fade-in-right { animation: fadeInRight 0.6s ease-in-out; }

/* ===========================
   SLIDE ANIMATIONS
   =========================== */
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

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

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

.slide-in-left { animation: slideInLeft 0.6s ease-in-out; }
.slide-in-right { animation: slideInRight 0.6s ease-in-out; }
.slide-in-up { animation: slideInUp 0.6s ease-in-out; }
.slide-in-down { animation: slideInDown 0.6s ease-in-out; }

/* ===========================
   ZOOM ANIMATIONS
   =========================== */
@keyframes zoomIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes zoomOut {
    from { transform: scale(2); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.zoom-in { animation: zoomIn 0.6s ease-in-out; }
.zoom-out { animation: zoomOut 0.6s ease-in-out; }

/* ===========================
   SPIN ANIMATION
   =========================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.spin { animation: spin 1s linear infinite; }
.spin-slow { animation: spinSlow 20s linear infinite; }

/* ===========================
   RIPPLE EFFECT
   =========================== */
@keyframes ripple {
    0% { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
}

.ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* ===========================
   GRADIENT ANIMATION
   =========================== */
@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;
}

/* ===========================
   BORDER ANIMATION
   =========================== */
@keyframes borderGlow {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: var(--primary-light); }
}

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

/* ===========================
   BLOB ANIMATION
   =========================== */
@keyframes blob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

.blob {
    animation: blob 8s ease-in-out infinite;
}

/* ===========================
   COUNTER ANIMATION
   =========================== */
.counter-animate {
    display: inline-block;
    transition: all 0.5s ease-out;
}

/* ===========================
   HOVER EFFECTS
   =========================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(14, 116, 144, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: var(--shadow-2xl);
}

/* ===========================
   LOADING ANIMATION
   =========================== */
@keyframes loadingBar {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes loadingDots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

/* ===========================
   TYPING ANIMATION
   =========================== */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

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

/* ===========================
   PAGE TRANSITION
   =========================== */
.page-transition {
    animation: fadeIn 0.5s ease-in-out;
}

/* ===========================
   STAGGER CHILDREN
   =========================== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* ===========================
   MARQUEE ANIMATION
   =========================== */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

/* ===========================
   PARALLAX HINT
   =========================== */
.parallax-bg {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

/* ===========================
   PARTICLE EFFECTS
   =========================== */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
}

/* ===========================
   SKELETON LOADING
   =========================== */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

/* ===========================
   CONFETTI (for success)
   =========================== */
@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===========================
   REDUCED MOTION
   =========================== */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-zoom,
    .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .float,
    .float-slow,
    .float-up,
    .pulse,
    .pulse-shadow,
    .glow,
    .bounce,
    .spin,
    .spin-slow,
    .blob,
    .marquee-content {
        animation: none;
    }

    .stagger-children > * {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
