/* YUKI HEALTH - Animations & Micro-interactions */

/* Scroll reveal animations */
@keyframes fadeInUp {
    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 fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animations for grids */
@keyframes staggerFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button ripple effect */
.btn {
    position: relative;
    overflow: hidden;
}

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

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Card hover animations */
.quick-action-card,
.service-card,
.learn-card,
.doctor-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-card:hover .card-icon,
.service-card:hover .service-icon,
.learn-card:hover .learn-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Navigation animations */
.nav-floating {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-floating.scrolled {
    background: rgba(255, 248, 242, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-menu a {
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #F47A20;
    transition: width 0.3s ease;
}

.nav-menu a:hover::before,
.nav-menu a[aria-current="page"]::before {
    width: 100%;
}

/* Hero animations */
.hero-content > * {
    animation: fadeInUp 0.8s ease-out;
}

.hero-content .hero-logo {
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.hero-content .hero-title {
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.hero-content .hero-headline {
    animation-delay: 0.6s;
    animation-fill-mode: both;
}

.hero-content .hero-actions {
    animation-delay: 0.8s;
    animation-fill-mode: both;
}

.hero-illustration {
    animation: fadeInRight 1s ease-out 0.4s both;
}

/* Scroll indicator animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.scroll-arrow {
    animation: bounce 2s infinite;
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

/* Count up animation for numbers */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.8s ease-out;
}

/* Parallax scroll effect */
.parallax {
    transform: translateY(var(--scroll-offset, 0));
    transition: transform 0.1s ease-out;
}

/* Section reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.active > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.6s; }

/* BMI gauge animation */
@keyframes gaugeFill {
    from {
        stroke-dasharray: 0 251.2;
    }
    to {
        stroke-dasharray: var(--gauge-value) 251.2;
    }
}

.gauge-fill {
    animation: gaugeFill 1.5s ease-in-out;
}

/* Blood pressure indicator animation */
@keyframes bpIndicatorSlide {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

.bp-indicator {
    animation: bpIndicatorSlide 0.8s ease-out;
}

/* Form input focus animations */
.input-group input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(244, 122, 32, 0.15);
}

/* FAQ animation */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item[open] {
    animation: expandFaq 0.3s ease-out;
}

@keyframes expandFaq {
    from {
        opacity: 0.8;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.faq-answer {
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Doctor card expand animation */
.doctor-details {
    animation: slideDown 0.3s ease-out;
    transform-origin: top;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Floating elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse animation for emergency elements */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(229, 57, 53, 0.6);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

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

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #F47A20;
    animation: typewriter 2s steps(30) 1s both, blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #F47A20;
    }
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Success check animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark {
    stroke-dasharray: 50;
    animation: checkmark 0.6s ease-in-out;
}

/* Error shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* Progress bar animation */
@keyframes progressFill {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

.progress-fill {
    animation: progressFill 1s ease-out;
}

/* Zoom in animation for modal-like elements */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

/* Slide up from bottom animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .float,
    .bounce,
    .pulse,
    .typewriter {
        animation: none !important;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .btn::before {
        background: rgba(0, 0, 0, 0.1);
    }
    
    .skeleton {
        background: linear-gradient(90deg, #d0d0d0 25%, #c0c0c0 50%, #d0d0d0 75%);
    }
}

/* Dark mode animation adjustments */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #3a3a3a 25%, #2a2a2a 50%, #3a3a3a 75%);
    }
    
    .btn::before {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Pulse animation for form highlighting */
@keyframes pulse {
    0% {
        box-shadow: 0 8px 30px rgba(244, 122, 32, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 12px 40px rgba(244, 122, 32, 0.2);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 8px 30px rgba(244, 122, 32, 0.1);
        transform: scale(1);
    }
}