/**
 * MedGulf — Enhanced Animations
 * Cinematic scroll reveals, parallax, hero animations
 */

/* ================================================================
   FADE IN VARIANTS
   ================================================================ */

/* Fade in from below */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in from left */
.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right */
.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up subtle */
.fade-in-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.fade-delay-1 { transition-delay: 0.1s; }
.fade-delay-2 { transition-delay: 0.2s; }
.fade-delay-3 { transition-delay: 0.3s; }
.fade-delay-4 { transition-delay: 0.4s; }
.fade-delay-5 { transition-delay: 0.5s; }

/* ================================================================
   HERO CINEMATIC ANIMATIONS
   ================================================================ */

.hero-cinematic .hero-split__label {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

.hero-cinematic .hero-split__title {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
}

.hero-cinematic .hero-split__subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.1s forwards;
}

.hero-cinematic .hero-split__actions {
    opacity: 0;
    transform: translateY(25px);
    animation: heroFadeUp 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.5s forwards;
}

.hero-cinematic .hero-split__visual img {
    transform: scale(1.15);
    animation: kenBurns 8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kenBurns {
    to {
        transform: scale(1) translateY(var(--parallax-y, 0));
    }
}

/* ================================================================
   PAGE HEADER REVEAL
   ================================================================ */

.page-header-corp__title {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: pageHeaderReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

.page-header-corp__subtitle {
    opacity: 0;
    transform: translateY(20px);
    animation: pageHeaderReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
}

@keyframes pageHeaderReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================================================
   PAGE HEADER PATTERN DRIFT
   ================================================================ */

@keyframes patternSlide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ================================================================
   STATS PULSE
   ================================================================ */

@keyframes statsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.stats-strip__number.counting {
    animation: statsPulse 0.6s ease-in-out;
}

/* ================================================================
   INDUSTRY PILL REVEAL
   ================================================================ */

@keyframes pillReveal {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ================================================================
   MARQUEE SCROLL
   ================================================================ */

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ================================================================
   SMOOTH SCROLL
   ================================================================ */

html {
    scroll-behavior: smooth;
}

/* ================================================================
   PREFERS REDUCED MOTION
   ================================================================ */

/* ================================================================
   NAV ENTRANCE — Slide from top
   ================================================================ */

@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-area {
    animation: navSlideDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ================================================================
   HERO BACKGROUND — Slow Ken Burns Zoom
   ================================================================ */

@keyframes heroSlowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.hero-slide {
    overflow: hidden;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.swiper-slide-active .hero-slide {
    animation: heroSlowZoom 8s ease-out forwards;
}

/* ================================================================
   IMAGE HOVER ZOOM + LIGHT OVERLAY (global)
   ================================================================ */

.img-hover-zoom {
    overflow: hidden;
    position: relative;
}

.img-hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.img-hover-zoom:hover img {
    transform: scale(1.08);
}

.img-hover-zoom::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 122, 138, 0.12), rgba(34, 184, 204, 0.08));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.img-hover-zoom:hover::after {
    opacity: 1;
}

/* Apply to common image containers */
.about-editorial__image,
.catalog-section__image,
.industry-card__image,
.product-card__image,
.service-details-area img,
.page-header-corp {
    overflow: hidden;
    position: relative;
}

.about-editorial__image img,
.industry-card__image img,
.product-card__image img {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.about-editorial__image:hover img,
.industry-card__image:hover img,
.product-card__image:hover img {
    transform: scale(1.08) !important;
}

.about-editorial__image::after,
.industry-card__image::after,
.product-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 122, 138, 0.12), rgba(34, 184, 204, 0.08));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.about-editorial__image:hover::after,
.industry-card__image:hover::after,
.product-card__image:hover::after {
    opacity: 1;
}

/* ================================================================
   ICON ANIMATIONS — Bounce & Color on Scroll
   ================================================================ */

@keyframes iconBounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    70% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

@keyframes iconColorPulse {
    0% { color: inherit; }
    50% { color: #22B8CC; }
    100% { color: inherit; }
}

.icon-animate {
    display: inline-block;
}

.icon-animate.visible i,
.icon-animate.visible .icon,
.fade-in.visible .category-card__icon i,
.fade-in.visible .why-card__icon i,
.fade-in.visible .advantage-item i {
    animation: iconBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

/* Icon hover micro-interaction */
.category-card__icon i,
.why-card__icon i,
.advantage-item i,
.footer-info-item i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.category-card:hover .category-card__icon i,
.why-card:hover .why-card__icon i,
.advantage-item:hover i {
    transform: scale(1.15);
    color: #22B8CC;
}

/* ================================================================
   BUTTON HOVER GLOW
   ================================================================ */

.btn-corp,
.catalog-section__cta,
.corp-cta .btn-corp {
    position: relative;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}

.btn-corp:hover {
    box-shadow: 0 4px 20px rgba(26, 122, 138, 0.35);
}

.btn-corp--primary:hover,
.btn-corp--white:hover {
    box-shadow: 0 4px 25px rgba(26, 122, 138, 0.4);
}

.btn-corp--whatsapp:hover {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
}

.btn-corp--white-outline:hover {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

/* Glow pulse on CTA buttons */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(26, 122, 138, 0.2); }
    50% { box-shadow: 0 0 20px rgba(26, 122, 138, 0.4); }
}

.corp-cta .btn-corp {
    animation: glowPulse 3s ease-in-out infinite;
}

.corp-cta .btn-corp:hover {
    animation: none;
    box-shadow: 0 4px 25px rgba(26, 122, 138, 0.5);
}

/* ================================================================
   SMOOTH GRID / CARD ENTRANCE — Staggered fade-up
   ================================================================ */

.grid-animate > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.grid-animate.visible > *:nth-child(1) { transition-delay: 0s; }
.grid-animate.visible > *:nth-child(2) { transition-delay: 0.08s; }
.grid-animate.visible > *:nth-child(3) { transition-delay: 0.16s; }
.grid-animate.visible > *:nth-child(4) { transition-delay: 0.24s; }
.grid-animate.visible > *:nth-child(5) { transition-delay: 0.32s; }
.grid-animate.visible > *:nth-child(6) { transition-delay: 0.4s; }
.grid-animate.visible > *:nth-child(7) { transition-delay: 0.48s; }
.grid-animate.visible > *:nth-child(8) { transition-delay: 0.56s; }
.grid-animate.visible > *:nth-child(9) { transition-delay: 0.64s; }
.grid-animate.visible > *:nth-child(10) { transition-delay: 0.72s; }
.grid-animate.visible > *:nth-child(11) { transition-delay: 0.8s; }
.grid-animate.visible > *:nth-child(12) { transition-delay: 0.88s; }

.grid-animate.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================================
   FOOTER ICON SUBTLE ANIMATIONS
   ================================================================ */

@keyframes footerIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.footer-social a {
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.footer-social a:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 4px 15px rgba(34, 184, 204, 0.3);
}

.footer-info-item i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-info-item:hover i {
    transform: scale(1.2);
    color: #22B8CC;
    animation: footerIconFloat 1.5s ease-in-out infinite;
}

/* Footer link underline animation */
.footer-widget a {
    position: relative;
    transition: color 0.3s ease;
}

.footer-widget a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #22B8CC;
    transition: width 0.3s ease;
}

.footer-widget a:hover::after {
    width: 100%;
}

/* ================================================================
   SCROLL-TO-TOP BUTTON ANIMATION
   ================================================================ */

@keyframes scrollTopBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.scroll-top:hover {
    animation: scrollTopBounce 0.6s ease infinite;
}

/* ================================================================
   PREFERS REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hero-cinematic .hero-split__label,
    .hero-cinematic .hero-split__title,
    .hero-cinematic .hero-split__subtitle,
    .hero-cinematic .hero-split__actions,
    .grid-animate > * {
        opacity: 1;
        transform: none;
    }
    .header-area {
        animation: none;
    }
}
