/* ============================================
   Manila Polyclinic - Enhanced Animations & Effects
   ============================================ */

/* ============================================
   LOADING SCREEN
   ============================================ */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s infinite;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ============================================
   MICRO-ANIMATIONS
   ============================================ */

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card:hover {
    transform: translateY(-8px) rotateX(2deg);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

/* Icon Bounce on Hover */
.card-icon {
    transition: transform var(--transition-normal);
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    animation: bounce 0.5s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1.1) translateY(0);
    }

    50% {
        transform: scale(1.1) translateY(-5px);
    }
}

/* Link Underline Animation */
.navbar-link::after,
.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width var(--transition-normal);
}

.navbar-link:hover::after,
.footer-links a:hover::after {
    width: 100%;
}

/* ============================================
   PARALLAX & SCROLL EFFECTS
   ============================================ */
.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    z-index: -1;
    will-change: transform;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-hero);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.float-delay-1 {
    animation-delay: 0s;
}

.float-delay-2 {
    animation-delay: 2s;
}

.float-delay-3 {
    animation-delay: 4s;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 45px;
    height: 45px;
    background: var(--color-white);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: var(--z-fixed);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-5px);
}

/* ============================================
   FLOATING WHATSAPP BUTTON
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 55px;
    height: 55px;
    background: #25D366;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: var(--z-fixed);
    transition: all var(--transition-normal);
    animation: whatsappPulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    color: white;
}

@keyframes whatsappPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 40px rgba(37, 211, 102, 0.6);
    }
}

/* ============================================
   TESTIMONIAL CAROUSEL
   ============================================ */
.testimonials-carousel {
    position: relative;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonials-track .testimonial-card {
    min-width: 100%;
    flex-shrink: 0;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .testimonials-track .testimonial-card {
        min-width: 50%;
    }
}

@media (min-width: 1024px) {
    .testimonials-track .testimonial-card {
        min-width: 33.333%;
    }
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-gray-300);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-gray-900);
    color: var(--color-white);
    padding: 1rem;
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content {
    max-width: var(--container-xl);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.cookie-text {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   SKELETON LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-gray-200) 25%,
            var(--color-gray-100) 50%,
            var(--color-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-image {
    height: 200px;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

/* ============================================
   GLASSMORPHISM ENHANCED
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
.glow {
    box-shadow: 0 0 30px rgba(10, 77, 104, 0.3);
}

.glow-hover:hover {
    box-shadow: 0 0 50px rgba(10, 77, 104, 0.5);
}

/* Text Gradient */
.text-gradient {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   ANIMATED COUNTER
   ============================================ */
.stat-number {
    display: inline-block;
}

.stat-number.counting {
    animation: countPulse 0.3s ease;
}

@keyframes countPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   IMAGE HOVER EFFECTS
   ============================================ */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

.img-overlay {
    position: relative;
    overflow: hidden;
}

.img-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.img-overlay:hover::after {
    opacity: 1;
}

/* ============================================
   STAGGERED ANIMATIONS
   ============================================ */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

.stagger-6 {
    animation-delay: 0.6s;
}

/* ============================================
   CUSTOM SCROLLBAR THEME
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
