/*
 * VisionCare Eye Clinic - Animation Styles
 * Smooth, professional animations with accessibility support
 */

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */

/* Fade Animations */
@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(-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);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(0, 217, 255, 0);
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes floatRotate {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Blink Animation */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Wave Animation */
@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(20deg);
    }

    75% {
        transform: rotate(-15deg);
    }
}

/* =============================================
   ANIMATION UTILITY CLASSES
   ============================================= */

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 2s ease infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Animation Delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

/* =============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================= */

[data-animate] {
    opacity: 0;
    transition: all 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-up"].animated {
    transform: translateY(0);
}

[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-down"].animated {
    transform: translateY(0);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate="fade-left"].animated {
    transform: translateX(0);
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="fade-right"].animated {
    transform: translateX(0);
}

[data-animate="zoom-in"] {
    transform: scale(0.9);
}

[data-animate="zoom-in"].animated {
    transform: scale(1);
}

[data-animate="flip"] {
    transform: perspective(1000px) rotateY(90deg);
}

[data-animate="flip"].animated {
    transform: perspective(1000px) rotateY(0);
}

/* =============================================
   MICRO-INTERACTIONS
   ============================================= */

/* Button Hover Effects */
.btn-hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-hover-scale {
    transition: transform 0.2s ease;
}

.btn-hover-scale:hover {
    transform: scale(1.05);
}

/* Icon Animations */
.icon-hover-rotate {
    transition: transform 0.3s ease;
}

.icon-hover-rotate:hover {
    transform: rotate(15deg);
}

.icon-hover-bounce:hover i {
    animation: bounce 0.5s ease;
}

/* Card Hover Effects */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-hover-glow {
    transition: box-shadow 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.2);
}

/* Link Underline Animation */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* =============================================
   LOADING STATES
   ============================================= */

.skeleton {
    background: linear-gradient(90deg,
            var(--gray-200) 25%,
            var(--gray-100) 50%,
            var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

/* =============================================
   PAGE TRANSITIONS
   ============================================= */

.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* =============================================
   HERO SPECIFIC ANIMATIONS
   ============================================= */

.hero-animate-title {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-animate-subtitle {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-animate-buttons {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-animate-stats {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

/* =============================================
   SUCCESS/ERROR ANIMATIONS
   ============================================= */

@keyframes successCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.animate-success {
    animation: successCheck 0.5s ease forwards;
}

.animate-error {
    animation: errorShake 0.5s ease;
}

/* =============================================
   FORM SUCCESS MODAL
   ============================================= */

.success-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 38, 71, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.success-modal.active {
    opacity: 1;
    visibility: visible;
}

.success-modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    text-align: center;
    max-width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.success-modal.active .success-modal-content {
    transform: scale(1);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    animation: successCheck 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.success-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

/* =============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================= */

@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;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }

    .skeleton {
        animation: none;
    }

    .loading-spinner {
        animation: none;
        border-color: var(--secondary);
    }
}