/* ========================================
   CUSTOM MODERN ANIMATIONS & EFFECTS
   ======================================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* ========== FADE & SLIDE ANIMATIONS ========== */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce in animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

/* Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(93, 178, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(93, 178, 255, 0.6);
    }
}

/* ========== APPLY ANIMATIONS TO ELEMENTS ========== */

/* Header animations */
.header-area {
    animation: slideDown 0.8s ease-out;
}

.header-top_area {
    animation: fadeInUp 0.6s ease-out;
}

/* Logo bounce in */
.logo {
    animation: bounceIn 1s ease-out;
}

/* Menu items stagger animation */
.main-menu ul li {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.main-menu ul li:nth-child(1) { animation-delay: 0.1s; }
.main-menu ul li:nth-child(2) { animation-delay: 0.2s; }
.main-menu ul li:nth-child(3) { animation-delay: 0.3s; }
.main-menu ul li:nth-child(4) { animation-delay: 0.4s; }
.main-menu ul li:nth-child(5) { animation-delay: 0.5s; }
.main-menu ul li:nth-child(6) { animation-delay: 0.6s; }

/* Slider text animations */
.slider_text h3 {
    animation: fadeInLeft 1s ease-out 0.3s both;
}

.slider_text p {
    animation: fadeInLeft 1s ease-out 0.6s both;
}

.slider_text .boxed-btn3 {
    animation: fadeInUp 1s ease-out 0.9s both;
}

/* Service cards animation */
.single_service {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    transition: all 0.4s ease;
}

.single_service:nth-child(1) { animation-delay: 0.2s; }
.single_service:nth-child(2) { animation-delay: 0.4s; }
.single_service:nth-child(3) { animation-delay: 0.6s; }

.single_service:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 157, 255, 0.2);
}

.single_service .icon {
    transition: all 0.4s ease;
}

.single_service:hover .icon {
    transform: scale(1.1) rotate(5deg);
    animation: pulse 1s infinite;
}

/* Welcome section animations */
.welcome_thumb .thumb_1 {
    animation: fadeInLeft 1s ease-out;
}

.welcome_thumb .thumb_2 {
    animation: fadeInRight 1s ease-out 0.3s both;
    /* Removed continuous float - slides in once and stops */
}

.welcome_docmed_info h2 {
    animation: fadeInRight 0.8s ease-out;
}

.welcome_docmed_info h3 {
    animation: fadeInRight 0.8s ease-out 0.2s both;
}

.welcome_docmed_info p {
    animation: fadeInRight 0.8s ease-out 0.4s both;
}

.welcome_docmed_info ul li {
    opacity: 0;
    animation: fadeInRight 0.6s ease-out forwards;
}

.welcome_docmed_info ul li:nth-child(1) { animation-delay: 0.5s; }
.welcome_docmed_info ul li:nth-child(2) { animation-delay: 0.6s; }
.welcome_docmed_info ul li:nth-child(3) { animation-delay: 0.7s; }

/* Department cards */
.single_department {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.single_department:nth-child(1) { animation-delay: 0.1s; }
.single_department:nth-child(2) { animation-delay: 0.2s; }
.single_department:nth-child(3) { animation-delay: 0.3s; }
.single_department:nth-child(4) { animation-delay: 0.4s; }
.single_department:nth-child(5) { animation-delay: 0.5s; }
.single_department:nth-child(6) { animation-delay: 0.6s; }

.single_department:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 35px rgba(93, 178, 255, 0.3);
}

.single_department .department_thumb img {
    transition: transform 0.5s ease;
}

.single_department:hover .department_thumb img {
    transform: scale(1.1);
}

/* Section titles */
.section_title h3 {
    animation: fadeInUp 0.8s ease-out;
}

.section_title p {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Expert doctors cards */
.single_expert {
    transition: all 0.4s ease;
}

.single_expert:hover {
    transform: translateY(-10px);
}

.single_expert .expert_thumb {
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.4s ease;
}

.single_expert:hover .expert_thumb {
    animation: glow 2s infinite;
}

.single_expert .expert_thumb img {
    transition: transform 0.6s ease;
}

.single_expert:hover .expert_thumb img {
    transform: scale(1.15) rotate(2deg);
}

/* Business info section */
.business_info {
    animation: fadeInLeft 1s ease-out;
}

.business_thumb {
    animation: fadeInRight 1s ease-out;
}

.business_info .icon {
    animation: bounceIn 1s ease-out 0.3s both;
}

/* Buttons hover effects */
.boxed-btn3, .boxed-btn3-white, .boxed-btn3-white-2 {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.boxed-btn3::before,
.boxed-btn3-white::before,
.boxed-btn3-white-2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.boxed-btn3:hover::before,
.boxed-btn3-white:hover::before,
.boxed-btn3-white-2:hover::before {
    width: 300px;
    height: 300px;
}

.boxed-btn3:hover,
.boxed-btn3-white:hover,
.boxed-btn3-white-2:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 157, 255, 0.3);
}

/* Appointment button pulse */
.book_btn a {
    animation: pulse 2s infinite;
}

/* Testimonial animation */
.testmonial_info {
    animation: fadeInUp 1s ease-out;
}

.quote i {
    animation: bounceIn 1s ease-out 0.3s both;
}

/* Tab navigation */
.business_tabs_area .nav-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.business_tabs_area .nav-item:nth-child(1) { animation-delay: 0.1s; }
.business_tabs_area .nav-item:nth-child(2) { animation-delay: 0.2s; }
.business_tabs_area .nav-item:nth-child(3) { animation-delay: 0.3s; }

.business_tabs_area .nav-link {
    transition: all 0.3s ease;
    position: relative;
}

.business_tabs_area .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #5DB2FF;
    transition: all 0.4s ease;
    transform: translateX(-50%);
}

.business_tabs_area .nav-link:hover::after,
.business_tabs_area .nav-link.active::after {
    width: 100%;
}

/* Scroll reveal animation class */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

/* Parallax effect for images */
.parallax-img {
    transition: transform 0.3s ease-out;
}

/* Smooth transitions for all links */
a {
    transition: all 0.3s ease;
}

/* Icon animations */
i {
    transition: all 0.3s ease;
}

a:hover i {
    transform: scale(1.2);
}

/* Image hover effects */
img {
    transition: all 0.4s ease;
}

/* Social media links */
.social_media_links a {
    transition: all 0.3s ease;
    display: inline-block;
}

.social_media_links a:hover {
    transform: translateY(-3px) rotate(5deg);
}

/* Learn more links */
.learn_more {
    position: relative;
    transition: all 0.3s ease;
}

.learn_more::after {
    content: '→';
    position: absolute;
    right: -20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.learn_more:hover::after {
    right: -25px;
    opacity: 1;
}

/* Responsive animations - reduce on mobile */
@media (max-width: 767px) {
    .welcome_thumb .thumb_2 {
        animation: none;
    }
    
    .single_service:hover,
    .single_department:hover,
    .single_expert:hover {
        transform: translateY(-5px);
    }
}

/* Loading animation for page */
@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: pageLoad 0.5s ease-out;
}


/* ========== ADVANCED MODERN EFFECTS ========== */

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

.slider_text h3 span {
    background: linear-gradient(45deg, #0181f5, #5db2ff, #00d4ff, #5db2ff, #0181f5);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Glowing border effect */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(93, 178, 255, 0.3);
        box-shadow: 0 0 10px rgba(93, 178, 255, 0.2);
    }
    50% {
        border-color: rgba(93, 178, 255, 0.8);
        box-shadow: 0 0 30px rgba(93, 178, 255, 0.5);
    }
}

.single_service {
    border: 2px solid transparent;
}

.single_service:hover {
    animation: borderGlow 2s ease-in-out infinite;
}

/* Morphing shapes background */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.department_thumb::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #5db2ff, #0181f5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: morph 8s ease-in-out infinite;
    filter: blur(10px);
}

.single_department:hover .department_thumb::before {
    opacity: 0.7;
}

/* Text reveal animation */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.section_title h3 {
    animation: textReveal 1s ease-out, fadeInUp 0.8s ease-out;
}

/* Particle effect on hover */
.expert_thumb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(93, 178, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
    border-radius: 50%;
    pointer-events: none;
}

.single_expert:hover .expert_thumb::after {
    transform: translate(-50%, -50%) scale(1.5);
}

/* Sliding underline effect */
.main-menu ul li a {
    position: relative;
    overflow: hidden;
}

.main-menu ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #0181f5, #5db2ff);
    transition: left 0.4s ease;
}

.main-menu ul li a:hover::after,
.main-menu ul li a.active::after {
    left: 0;
}

/* Staggered fade for department cards */
.single_department {
    transform-origin: center;
}

.single_department:nth-child(odd):hover {
    animation: pulse 1s ease-in-out;
}

.single_department:nth-child(even):hover {
    animation: float 2s ease-in-out infinite;
}

/* Icon bounce on hover */
.single_service .icon i,
.business_info .icon i {
    display: inline-block;
    transition: transform 0.3s ease;
}

.single_service:hover .icon i,
.business_info:hover .icon i {
    animation: bounceIn 0.8s ease;
}

/* Smooth image zoom */
.department_thumb,
.expert_thumb {
    overflow: hidden;
    position: relative;
}

.department_thumb img,
.expert_thumb img {
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Gradient overlay on hover */
.department_thumb::after,
.expert_thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(1, 129, 245, 0.7) 0%, rgba(93, 178, 255, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.single_department:hover .department_thumb::after,
.single_expert:hover .expert_thumb::after {
    opacity: 0.3;
}

/* Typewriter effect for slider text */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

.slider_text h3 {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #5db2ff;
    animation: typewriter 2s steps(40) 0.5s both, blinkCursor 0.75s step-end infinite;
}

/* 3D flip effect for service cards */
.single_service {
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.single_service:hover {
    transform: translateY(-15px) rotateY(5deg);
}

/* Neon glow effect */
@keyframes neonGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(93, 178, 255, 0.5),
                     0 0 20px rgba(93, 178, 255, 0.3),
                     0 0 30px rgba(93, 178, 255, 0.2);
    }
    50% {
        text-shadow: 0 0 20px rgba(93, 178, 255, 0.8),
                     0 0 30px rgba(93, 178, 255, 0.6),
                     0 0 40px rgba(93, 178, 255, 0.4);
    }
}

.doctors_title h3 {
    animation: neonGlow 2s ease-in-out infinite;
}

/* Smooth color transition */
.learn_more {
    background: linear-gradient(to right, #0181f5 50%, transparent 50%);
    background-size: 200% 100%;
    background-position: right;
    transition: background-position 0.5s ease, color 0.3s ease;
    padding: 5px 15px;
    border-radius: 4px;
}

.learn_more:hover {
    background-position: left;
    color: #fff !important;
}

/* Floating particles effect */
@keyframes float-particle {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        transform: translateY(-10px) translateX(-10px);
    }
    75% {
        transform: translateY(-30px) translateX(5px);
    }
}

.welcome_thumb .thumb_1::before,
.welcome_thumb .thumb_2::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #5db2ff;
    border-radius: 50%;
    top: 20%;
    left: 20%;
    animation: float-particle 4s ease-in-out infinite;
    opacity: 0.6;
}

.welcome_thumb .thumb_2::before {
    animation-delay: 2s;
    top: 60%;
    left: 70%;
}

/* Shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.boxed-btn3::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.boxed-btn3:hover::after {
    left: 100%;
}

/* Perspective card effect */
.business_info {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.business_info:hover {
    transform: perspective(1000px) rotateY(-5deg);
}

/* Smooth shadow transition */
.single_department,
.single_service,
.single_expert {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

/* Animated gradient background */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.Emergency_contact .single_emergency {
    background-size: 200% 200%;
    animation: gradientBG 5s ease infinite;
}

/* Bounce attention effect */
@keyframes bounceAttention {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.book_btn a:hover {
    animation: bounceAttention 1s ease;
}

/* Rotate on scroll */
.quote i {
    transition: transform 0.5s ease;
}

.testmonial_info:hover .quote i {
    transform: rotate(180deg);
}

/* Smooth scale transition */
.footer_widget {
    transition: transform 0.3s ease;
}

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

/* Responsive adjustments */
@media (max-width: 767px) {
    .slider_text h3 {
        animation: fadeInLeft 1s ease-out 0.3s both;
        border-right: none;
    }
    
    .single_service:hover,
    .single_department:hover {
        transform: translateY(-5px) scale(1.02);
    }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================
   NEXT-LEVEL MODERN EFFECTS
   ======================================== */

/* Glass morphism effect */
.single_service,
.single_department {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Fix text visibility in service cards */
.single_service h3,
.single_service p,
.single_service a {
    color: #1F1F1F !important;
}

.single_service .boxed-btn3-white {
    color: #009DFF !important;
    background: #fff !important;
}

/* Liquid blob animation */
@keyframes blob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.05);
    }
    50% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: rotate(180deg) scale(0.95);
    }
    75% {
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
        transform: rotate(270deg) scale(1.05);
    }
}

.slider_area::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(93, 178, 255, 0.3), rgba(1, 129, 245, 0.3));
    top: -200px;
    right: -200px;
    animation: blob 20s ease-in-out infinite;
    z-index: 0;
    filter: blur(60px);
}

/* Cursor trail effect - DISABLED */
.cursor-dot {
    display: none !important;
}

.cursor-outline {
    display: none !important;
}

/* Infinite scroll text */
@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.scroll-text-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.scroll-text {
    display: inline-block;
    animation: scroll-text 20s linear infinite;
}

/* Neumorphism effect */
.single_expert {
    background: #f0f0f3;
    box-shadow: 8px 8px 16px rgba(163, 177, 198, 0.6),
                -8px -8px 16px rgba(255, 255, 255, 0.5);
    border-radius: 20px;
}

.single_expert:hover {
    box-shadow: inset 8px 8px 16px rgba(163, 177, 198, 0.6),
                inset -8px -8px 16px rgba(255, 255, 255, 0.5);
}

/* Holographic effect */
@keyframes holographic {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.boxed-btn3 {
    background: linear-gradient(45deg, #0181f5, #5db2ff, #00d4ff, #0181f5);
    background-size: 300% 300%;
    animation: holographic 3s ease infinite;
    position: relative;
    overflow: hidden;
}

.boxed-btn3::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Particle system */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(10px, -20px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translate(-10px, -40px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translate(15px, -60px) scale(1.1);
        opacity: 0.5;
    }
}

.service_area::before,
.our_department_area::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(93, 178, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(1, 129, 245, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(93, 178, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: particle-float 15s ease-in-out infinite;
}

/* Text gradient animation */
.section_title h3 {
    background: linear-gradient(45deg, #1F1F1F, #5db2ff, #1F1F1F);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 3s linear infinite;
}

@keyframes textShine {
    to {
        background-position: 200% center;
    }
}

/* Micro-interactions */
.main-menu ul li a {
    transform-origin: center;
}

.main-menu ul li a:hover {
    animation: jello 0.8s;
}

@keyframes jello {
    0%, 100% {
        transform: scale3d(1, 1, 1);
    }
    30% {
        transform: scale3d(1.25, 0.75, 1);
    }
    40% {
        transform: scale3d(0.75, 1.25, 1);
    }
    50% {
        transform: scale3d(1.15, 0.85, 1);
    }
    65% {
        transform: scale3d(0.95, 1.05, 1);
    }
    75% {
        transform: scale3d(1.05, 0.95, 1);
    }
}

/* Stacked cards effect */
.single_department {
    position: relative;
}

.single_department::before,
.single_department::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
    transition: all 0.4s ease;
    opacity: 0;
}

.single_department::before {
    top: -5px;
    left: -5px;
}

.single_department::after {
    top: -10px;
    left: -10px;
}

.single_department:hover::before {
    opacity: 0.3;
    top: -8px;
    left: -8px;
}

.single_department:hover::after {
    opacity: 0.15;
    top: -16px;
    left: -16px;
}

/* Infinite rotation */
@keyframes rotate-infinite {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.single_service .icon::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border: 2px dashed rgba(93, 178, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-infinite 20s linear infinite;
}

/* ========================================
   RESPONSIVE ENHANCEMENTS
   ======================================== */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Reduce animation intensity */
    .single_service:hover,
    .single_department:hover,
    .single_expert:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    /* Simplify complex animations */
    .slider_text h3 {
        animation: fadeInUp 0.8s ease-out;
        border-right: none;
        white-space: normal;
    }
    
    /* Stack elements properly */
    .welcome_thumb .thumb_1,
    .welcome_thumb .thumb_2 {
        animation: fadeInUp 0.8s ease-out;
        max-width: 100%;
    }
    
    /* Adjust spacing */
    .section_title h3 {
        font-size: 24px !important;
        line-height: 32px !important;
    }
    
    /* Disable heavy effects */
    .slider_area::before,
    .service_area::before,
    .our_department_area::before {
        display: none;
    }
    
    /* Optimize button sizes */
    .boxed-btn3,
    .boxed-btn3-white,
    .boxed-btn3-white-2 {
        padding: 12px 24px;
        font-size: 13px;
    }
    
    /* Simplify hover effects */
    .single_department::before,
    .single_department::after {
        display: none;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .single_service,
    .single_department {
        margin-bottom: 20px;
    }
    
    .slider_text h3 {
        font-size: 28px;
        line-height: 36px;
    }
    
    .section_title h3 {
        font-size: 28px !important;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .single_service:hover {
        transform: translateY(-10px);
    }
    
    .single_department:hover {
        transform: translateY(-8px) scale(1.02);
    }
    
    .slider_text h3 {
        font-size: 32px;
    }
    
    /* Adjust grid spacing */
    .single_department,
    .single_service {
        margin-bottom: 30px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .slider_text h3 {
        font-size: 36px;
    }
    
    .main-menu ul li {
        margin: 0 8px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Full effects enabled */
    .single_service,
    .single_department,
    .single_expert {
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
}

/* Landscape orientation fixes */
@media (orientation: landscape) and (max-height: 500px) {
    .slider_area {
        min-height: 400px;
    }
    
    .slider_text h3 {
        font-size: 24px;
        line-height: 32px;
    }
    
    .slider_text p {
        font-size: 14px;
        line-height: 22px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover-only effects on touch devices */
    .single_service:hover,
    .single_department:hover,
    .single_expert:hover {
        transform: none;
    }
    
    /* Add tap effects instead */
    .single_service:active,
    .single_department:active,
    .single_expert:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Simplify complex animations */
    .welcome_thumb .thumb_2 {
        animation: none;
    }
    
    /* Remove magnetic effects */
    .boxed-btn3:hover::before,
    .boxed-btn3-white:hover::before {
        display: none;
    }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .single_service,
    .single_department,
    .single_expert {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles */
@media print {
    /* Disable all animations for printing */
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    
    .scroll-progress,
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* Container responsive fixes */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Flexible images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive typography */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    p {
        font-size: 14px;
        line-height: 24px;
    }
}

/* Flexible grid system */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

@media (max-width: 575px) {
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Flexible sections */
.section-padding {
    padding-top: 80px;
    padding-bottom: 80px;
}

@media (max-width: 767px) {
    .section-padding {
        padding-top: 50px;
        padding-bottom: 50px;
    }
}

/* Responsive navigation */
@media (max-width: 991px) {
    .main-menu {
        display: none;
    }
}

/* Flexible footer */
@media (max-width: 767px) {
    .footer_widget {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer_widget ul {
        text-align: center;
    }
}

/* Ensure buttons are always tappable */
a, button, .boxed-btn3, .boxed-btn3-white {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive tables */
@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}


/* ========================================
   TEXT VISIBILITY FIXES
   ======================================== */

/* Ensure all service card text is visible */
.service_area .single_service * {
    color: #1F1F1F !important;
}

.service_area .single_service h3 {
    color: #1F1F1F !important;
    font-weight: 600;
}

.service_area .single_service p {
    color: #4D4D4D !important;
}

.service_area .single_service .icon i {
    color: #5DB2FF !important;
}

/* Fix button colors in service cards */
.service_area .boxed-btn3-white {
    background: #fff !important;
    color: #009DFF !important;
    border: 1px solid #009DFF !important;
}

.service_area .boxed-btn3-white:hover {
    background: #009DFF !important;
    color: #fff !important;
}

/* Emergency care specific fix */
.single_service:nth-child(2) h3,
.single_service:nth-child(2) p {
    color: #1F1F1F !important;
}

/* Ensure visibility on all service cards */
.single_service {
    background: #fff !important;
}

.single_service h3 {
    color: #1F1F1F !important;
}

.single_service p {
    color: #4D4D4D !important;
}

.single_service a {
    color: #009DFF !important;
}


/* ========================================
   SPINNING IMAGE ON SCROLL
   ======================================== */

/* Spin animation for welcome section image */
@keyframes spinOnce {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Target the first image in welcome section */
.welcome_thumb .thumb_1 img {
    transition: transform 0.3s ease;
}

/* Add spin class when in view - spins once and stops */
.welcome_thumb .thumb_1.spin-in img {
    animation: spinOnce 1s ease-in-out forwards;
}


/* ========================================
   SERVICE CARDS HOVER COLOR FIX
   ======================================== */

/* Remove default blue background from middle service card */
.service_area .col-xl-4:nth-child(2) .single_service {
    background: #fff !important;
}

/* All service cards start white */
.service_area .single_service {
    background: #fff !important;
    transition: all 0.4s ease;
}

/* Icons start blue */
.service_area .single_service .icon i {
    color: #5DB2FF !important;
    transition: all 0.4s ease;
}

/* Text starts dark */
.service_area .single_service h3,
.service_area .single_service p {
    color: #1F1F1F !important;
    transition: all 0.4s ease;
}

/* On hover: card turns blue, text turns white */
.service_area .single_service:hover {
    background: #5DB2FF !important;
}

.service_area .single_service:hover .icon i {
    color: #fff !important;
}

.service_area .single_service:hover h3,
.service_area .single_service:hover p {
    color: #fff !important;
}

.service_area .single_service:hover .boxed-btn3-white {
    background: #fff !important;
    color: #5DB2FF !important;
    border-color: #fff !important;
}


/* ========================================
   NAVBAR FIXES - SINGLE LINE NAVBAR
   ======================================== */

/* Hide the top bar with social media and contact */
.header-top_area {
    display: none !important;
}

/* Make navbar single line and compact */
.main-header-area {
    padding: 15px 0 !important;
}

/* Shorten menu text */
.main-menu ul li a {
    white-space: nowrap;
    padding: 0 10px !important;
    font-size: 14px !important;
}

.main-menu ul li {
    margin: 0 5px !important;
}

/* Make button smaller and text on one line */
.book_btn a {
    white-space: nowrap !important;
    font-size: 13px !important;
    padding: 10px 18px !important;
    display: inline-block !important;
}

/* Responsive adjustments */
@media (min-width: 992px) and (max-width: 1199px) {
    .main-menu ul li a {
        font-size: 13px !important;
        padding: 0 8px !important;
    }
    
    .main-menu ul li {
        margin: 0 3px !important;
    }
    
    .book_btn a {
        font-size: 12px !important;
        padding: 8px 15px !important;
    }
}

@media (min-width: 1200px) and (max-width: 1400px) {
    .main-menu ul li a {
        font-size: 13px !important;
    }
    
    .book_btn a {
        font-size: 12px !important;
        padding: 9px 16px !important;
    }
}

/* Ensure everything stays on one line */
.main-header-area .row {
    flex-wrap: nowrap !important;
}

.main-header-area .container {
    max-width: 100% !important;
    padding: 0 30px !important;
}
