/* ========================================
   PRECISION MED LNC - Animation Styles
   Smooth, Professional Animations
   ======================================== */

/* ========================================
   FADE-IN ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    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 {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   SLIDE ANIMATIONS
   ======================================== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(27, 154, 170, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(27, 154, 170, 0.8);
    }
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ========================================
   INTERSECTION OBSERVER CLASSES
   Applied via JavaScript when elements enter viewport
   ======================================== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
}

/* Fade In Variants */
.fade-in-up {
    transform: translateY(40px);
}

.fade-in-up.visible {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    transform: translateY(-40px);
}

.fade-in-down.visible {
    animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
    transform: translateX(-40px);
}

.fade-in-left.visible {
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    transform: translateX(40px);
}

.fade-in-right.visible {
    animation: fadeInRight 0.8s ease forwards;
}

/* Scale In */
.scale-in {
    transform: scale(0.9);
}

.scale-in.visible {
    animation: scaleIn 0.6s ease forwards;
}

/* ========================================
   STAGGERED ANIMATIONS
   Add delay classes for staggered effects
   ======================================== */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* ========================================
   HOVER ANIMATIONS
   ======================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(27, 154, 170, 0.6);
}

/* ========================================
   BUTTON ANIMATIONS
   ======================================== */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::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, height 0.6s;
}

.btn-animate:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   UNDERLINE ANIMATIONS
   ======================================== */
.underline-animate {
    position: relative;
    display: inline-block;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-light-teal));
    transition: width 0.3s ease;
}

.underline-animate:hover::after {
    width: 100%;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(27, 154, 170, 0.3);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ========================================
   PROGRESS BAR ANIMATION
   ======================================== */
@keyframes progress {
    from {
        width: 0%;
    }
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-light-teal));
    animation: progress 2s ease forwards;
}

/* ========================================
   TYPING ANIMATION
   ======================================== */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--accent-teal);
    white-space: nowrap;
    animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

/* ========================================
   CARD FLIP ANIMATION
   ======================================== */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ========================================
   PARALLAX EFFECT
   ======================================== */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ========================================
   GRADIENT ANIMATION
   ======================================== */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(
        270deg,
        var(--primary-navy),
        var(--primary-blue),
        var(--accent-teal)
    );
    background-size: 600% 600%;
    animation: gradient-shift 15s ease infinite;
}

/* ========================================
   NOTIFICATION SLIDE IN
   ======================================== */
@keyframes slideInNotification {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-enter {
    animation: slideInNotification 0.5s ease forwards;
}

/* ========================================
   SHAKE ANIMATION (for form errors)
   ======================================== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.6s ease;
}

/* ========================================
   SUCCESS CHECKMARK ANIMATION
   ======================================== */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmark 0.6s ease forwards;
}

/* ========================================
   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;
    }

    .animate-on-scroll,
    .fade-in-up,
    .fade-in-down,
    .fade-in-left,
    .fade-in-right,
    .scale-in {
        opacity: 1;
        transform: none;
    }
}
