/**
 * MasrDoctors Homepage Animations
 * Modern gradients and smooth motion design
 */

/* ============================================
   GRADIENT TEXT - Medical Red Theme
   ============================================ */

.gradient-text {
    background: linear-gradient(135deg, #cd0000 0%, #ff4757 50%, #cd0000 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.gradient-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(205, 0, 0, 0.3) 0%, rgba(255, 71, 87, 0.3) 50%, rgba(205, 0, 0, 0.3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: blur(10px);
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   FADE UP ANIMATION
   ============================================ */

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* ============================================
   SCALE IN ANIMATION (Stats)
   ============================================ */

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scale-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

/* ============================================
   CARD POP ANIMATION (Specialty Cards)
   ============================================ */

@keyframes card-pop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-card-pop {
    animation: card-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

/* ============================================
   FLOATING ANIMATION (Hero Image)
   ============================================ */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* ============================================
   PULSE GLOW EFFECT (Buttons & CTAs)
   ============================================ */

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(205, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(205, 0, 0, 0.8);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   HOVER EFFECTS - Enhanced Interactions
   ============================================ */

.md-specialty-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.md-specialty-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(205, 0, 0, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.md-specialty-card:hover::before {
    width: 300px;
    height: 300px;
}

.md-specialty-card:hover {
    transform: translateY(-8px) scale(1.03);
}

.md-specialty-icon {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.md-specialty-card:hover .md-specialty-icon {
    transform: scale(1.2) rotate(5deg);
}

/* ============================================
   SEARCH BAR ENHANCEMENTS
   ============================================ */

.md-search-container {
    position: relative;
    overflow: hidden;
}

.md-search-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #cd0000, #ff4757, #cd0000, #8b0000);
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradient-shift 3s ease infinite;
}

.md-search-container:hover::before {
    opacity: 0.3;
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.md-btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.md-btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.md-btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.md-btn-primary:active {
    transform: scale(0.95);
}

/* ============================================
   SECTION TITLE UNDERLINE ANIMATION
   ============================================ */

.md-section-title::after {
    animation: expand-line 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    width: 0;
}

@keyframes expand-line {
    from {
        width: 0;
    }
    to {
        width: 4rem;
    }
}

/* ============================================
   STATS COUNTER EFFECT
   ============================================ */

.animate-scale-in .gradient-text {
    display: inline-block;
    transition: transform 0.3s ease;
}

.animate-scale-in:hover .gradient-text {
    transform: scale(1.1);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .animate-fade-up,
    .animate-scale-in,
    .animate-card-pop {
        animation-duration: 0.5s;
    }

    .animate-float {
        animation: none;
    }
}

/* ============================================
   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-float {
        animation: none;
    }
}
