/* ============================================================
   ClinicPro — Enterprise UI Animations System
   GPU-optimized, cross-browser, mobile-friendly
   ============================================================ */

/* ---------- KEYFRAMES ---------- */
@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(-20px); } 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 slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(2deg); }
}
@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes pulseSoft {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(14,165,233,0.4); }
    70% { box-shadow: 0 0 0 18px rgba(14,165,233,0); }
    100% { box-shadow: 0 0 0 0 rgba(14,165,233,0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
}
@keyframes borderGlow {
    0%, 100% { border-color: transparent; }
    50% { border-color: rgba(14,165,233,0.3); }
}
@keyframes skeletonPulse {
    0% { background-color: rgba(0,0,0,0.06); }
    50% { background-color: rgba(0,0,0,0.12); }
    100% { background-color: rgba(0,0,0,0.06); }
}

/* ---------- UTILITY ANIMATION CLASSES ---------- */
.anim-fade-in     { animation: fadeIn 0.6s ease forwards; }
.anim-fade-up     { animation: fadeInUp 0.6s ease forwards; }
.anim-fade-down   { animation: fadeInDown 0.5s ease forwards; }
.anim-fade-left   { animation: fadeInLeft 0.6s ease forwards; }
.anim-fade-right  { animation: fadeInRight 0.6s ease forwards; }
.anim-scale-in    { animation: scaleIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275) forwards; }
.anim-float       { animation: float 6s ease-in-out infinite; }
.anim-float-slow  { animation: floatSlow 8s ease-in-out infinite; }
.anim-pulse-soft  { animation: pulseSoft 2.5s ease-in-out infinite; }
.anim-pulse-ring  { animation: pulseRing 2.5s ease-in-out infinite; }
.anim-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
}
.anim-gradient {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}
.anim-icon-hover { transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275); }
.anim-icon-hover:hover { transform: scale(1.2) rotate(5deg); }

/* ---------- DELAY VARIANTS ---------- */
.delay-100  { animation-delay: 0.1s; }
.delay-200  { animation-delay: 0.2s; }
.delay-300  { animation-delay: 0.3s; }
.delay-400  { animation-delay: 0.4s; }
.delay-500  { animation-delay: 0.5s; }
.delay-600  { animation-delay: 0.6s; }
.delay-700  { animation-delay: 0.7s; }
.delay-800  { animation-delay: 0.8s; }

/* ---------- DURATION VARIANTS ---------- */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-800 { animation-duration: 0.8s; }
.duration-1000{ animation-duration: 1s; }
.duration-1500{ animation-duration: 1.5s; }

/* ---------- SCROLL REVEAL (initial hidden state) ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25,0.46,0.45,0.94),
                transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
    will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(-30px); }
.reveal.reveal-right { transform: translateX(30px); }
.reveal.reveal-scale { transform: scale(0.92); }
.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---------- SMOOTH HOVER TRANSITIONS ---------- */
.hover-lift {
    transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275),
                box-shadow 0.35s ease;
    will-change: transform;
}
.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.12);
}

.hover-glow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.hover-glow:hover {
    box-shadow: 0 0 24px rgba(14,165,233,0.15), 0 8px 20px rgba(14,165,233,0.1);
    transform: translateY(-2px);
}

.hover-scale {
    transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
.hover-scale:hover { transform: scale(1.04); }

/* ---------- CARD SPECIFIC ---------- */
.card-hover-premium {
    transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275),
                box-shadow 0.4s ease,
                border-color 0.3s ease;
    will-change: transform;
    border: 1px solid transparent;
}
.card-hover-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    border-color: rgba(14,165,233,0.2);
}

/* ---------- BUTTON ANIMATIONS ---------- */
.btn-anim {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.btn-anim::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
.btn-anim:active::after {
    width: 300px; height: 300px;
}

.btn-glow {
    position: relative;
}
.btn-glow::before {
    content: '';
    position: absolute; inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.btn-glow:hover::before { opacity: 1; }

/* ---------- NAVBAR TRANSITION ---------- */
.navbar-anim {
    transition: padding 0.3s ease,
                background 0.3s ease,
                box-shadow 0.3s ease,
                backdrop-filter 0.3s ease;
}

/* ---------- COUNTER ANIMATION ---------- */
.counter-value {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.counter-value.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- SKELETON LOADING ---------- */
.skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
}

/* ---------- MODAL / DROPDOWN SMOOTH ---------- */
.modal-enter {
    animation: scaleIn 0.3s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
.dropdown-enter {
    animation: fadeInDown 0.2s ease forwards;
    transform-origin: top center;
}

/* ---------- STAGGERED CHILDREN ---------- */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }

/* ---------- PARALLAX TILT ---------- */
.tilt-parallax {
    transition: transform 0.2s ease;
    will-change: transform;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- MOBILE OPTIMIZATION ---------- */
@media (max-width: 768px) {
    .reveal { transform: translateY(20px); }
    .hover-lift:hover { transform: none; }
    .card-hover-premium:hover { transform: translateY(-4px); }
}
