/* =====================================================
   CENTRAL HOSPITAL - Animations
   ===================================================== */

/* =====================================================
   Keyframe 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);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(30, 64, 175, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   Animation Classes (Applied via JS)
   ===================================================== */
.animate {
    opacity: 0;
}

.animate.animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

.animate-fade-in.animated {
    animation-name: fadeIn;
}

.animate-fade-up.animated {
    animation-name: fadeInUp;
}

.animate-fade-down.animated {
    animation-name: fadeInDown;
}

.animate-fade-left.animated {
    animation-name: fadeInLeft;
}

.animate-fade-right.animated {
    animation-name: fadeInRight;
}

.animate-scale.animated {
    animation-name: scaleIn;
}

.animate-slide-up.animated {
    animation-name: slideInFromBottom;
}

/* Animation Delays */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

.delay-7 {
    animation-delay: 0.7s;
}

.delay-8 {
    animation-delay: 0.8s;
}

/* =====================================================
   Hover Animations
   ===================================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.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-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(30, 64, 175, 0.3);
}

/* =====================================================
   Continuous Animations
   ===================================================== */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-rotate {
    animation: rotate 10s linear infinite;
}

/* =====================================================
   Loading Animation
   ===================================================== */
.loading-skeleton {
    background: linear-gradient(90deg, var(--light-grey) 25%, var(--off-white) 50%, var(--light-grey) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* =====================================================
   Counter Animation Support
   ===================================================== */
.counter {
    display: inline-block;
}

/* =====================================================
   Page Transition
   ===================================================== */
.page-transition {
    animation: fadeIn 0.5s ease;
}

/* =====================================================
   Scroll Progress Bar
   ===================================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-green) 100%);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* =====================================================
   Back to Top Button
   ===================================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-green);
    transform: translateY(-5px);
}

/* =====================================================
   WhatsApp Button
   ===================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
}

/* =====================================================
   Responsive Animation Adjustments
   ===================================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {

    .back-to-top,
    .whatsapp-float {
        right: 1rem;
    }

    .back-to-top {
        bottom: 1rem;
        width: 45px;
        height: 45px;
    }

    .whatsapp-float {
        bottom: 4rem;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}