/* ============================================
   MozPharma - Premium Animations
   Scroll animations estilo Apple
   ============================================ */

/* ============================================
   Reveal Animations (Scroll-triggered)
   ============================================ */

/* Base state for all reveal elements */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for children */
.reveal:nth-child(1) { transition-delay: 0s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal:nth-child(6) { transition-delay: 0.5s; }

/* ============================================
   Hero Animations
   ============================================ */

/* Fade up animation for hero elements */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Scale Animations
   ============================================ */

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scale-in.active {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   Slide Animations
   ============================================ */

.slide-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-left.active {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Blur Animations
   ============================================ */

.blur-in {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.blur-in.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* ============================================
   Counter Animation
   ============================================ */

.stat-number {
    transition: all 0.3s ease;
}

.counting {
    opacity: 0.7;
}

/* ============================================
   Hover Animations
   ============================================ */

/* Magnetic hover effect for buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::before {
    transform: translateX(100%);
}

/* Card tilt effect */
.feature-card,
.value-card,
.quality-card,
.why-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Image zoom effect */
.facility-image img,
.hero-image {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.facility-image:hover img {
    transform: scale(1.08);
}

/* ============================================
   Floating Animations
   ============================================ */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.hero-float-card {
    animation: float 4s ease-in-out infinite;
}

.float-card-1 {
    animation-delay: 0s;
}

.float-card-2 {
    animation-delay: 2s;
}

/* ============================================
   Gradient Animations
   ============================================ */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ============================================
   Pulse Animations
   ============================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.badge-dot {
    position: relative;
}

.badge-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

/* ============================================
   Scroll Progress Indicator
   ============================================ */

@keyframes scrollDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   Loading Animations
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   Parallax Effect
   ============================================ */

.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* ============================================
   Line Draw Animation
   ============================================ */

@keyframes drawLine {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

.section-header::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    margin: var(--spacing-4) auto 0;
    border-radius: var(--radius-full);
}

.section-header.active::after {
    animation: drawLine 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
}

/* ============================================
   Icon Animations
   ============================================ */

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.feature-icon:hover,
.value-icon:hover,
.quality-icon:hover,
.why-icon:hover {
    animation: iconBounce 0.5s ease;
}

/* ============================================
   Stagger Animations for Grids
   ============================================ */

.features-grid .feature-card:nth-child(1) { transition-delay: 0s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.15s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.3s; }

.values-grid .value-card:nth-child(1) { transition-delay: 0s; }
.values-grid .value-card:nth-child(2) { transition-delay: 0.1s; }
.values-grid .value-card:nth-child(3) { transition-delay: 0.2s; }
.values-grid .value-card:nth-child(4) { transition-delay: 0.3s; }
.values-grid .value-card:nth-child(5) { transition-delay: 0.4s; }

.quality-grid .quality-card:nth-child(1) { transition-delay: 0s; }
.quality-grid .quality-card:nth-child(2) { transition-delay: 0.1s; }
.quality-grid .quality-card:nth-child(3) { transition-delay: 0.2s; }
.quality-grid .quality-card:nth-child(4) { transition-delay: 0.3s; }

.stats-grid .stat-card:nth-child(1) { transition-delay: 0s; }
.stats-grid .stat-card:nth-child(2) { transition-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { transition-delay: 0.2s; }
.stats-grid .stat-card:nth-child(4) { transition-delay: 0.3s; }

.team-grid .team-card:nth-child(1) { transition-delay: 0s; }
.team-grid .team-card:nth-child(2) { transition-delay: 0.05s; }
.team-grid .team-card:nth-child(3) { transition-delay: 0.1s; }
.team-grid .team-card:nth-child(4) { transition-delay: 0.15s; }
.team-grid .team-card:nth-child(5) { transition-delay: 0.2s; }
.team-grid .team-card:nth-child(6) { transition-delay: 0.25s; }

.why-grid .why-card:nth-child(1) { transition-delay: 0s; }
.why-grid .why-card:nth-child(2) { transition-delay: 0.1s; }
.why-grid .why-card:nth-child(3) { transition-delay: 0.2s; }
.why-grid .why-card:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   Smooth Scrollbar (for supported browsers)
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .fade-up,
    .scale-in,
    .slide-left,
    .slide-right,
    .blur-in {
        opacity: 1;
        transform: none;
        filter: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   Page Transitions
   ============================================ */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    z-index: 9998;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.page-transition.active {
    transform: scaleY(1);
    transform-origin: top;
}

/* ============================================
   Mouse Follower (optional enhancement)
   ============================================ */

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease;
    mix-blend-mode: difference;
}

.cursor-ring {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}

/* ============================================
   Text Reveal Animation
   ============================================ */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.active span {
    transform: translateY(0);
}

/* ============================================
   Image Reveal Animation
   ============================================ */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    z-index: 1;
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.active::before {
    transform: scaleX(0);
}

.image-reveal img {
    transform: scale(1.2);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.active img {
    transform: scale(1);
}

/* ============================================
   Number Counter Animation
   ============================================ */

.counter {
    display: inline-block;
    min-width: 1ch;
}

/* ============================================
   Magnetic Button Effect
   ============================================ */

.magnetic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   Ripple Effect
   ============================================ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}
