/* ========================================
   GLOBALMERKC - Animations
   Efectos modernos y suaves
   ======================================== */

/* ----------------------------------------
   Base Animation Keyframes
   ---------------------------------------- */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

/* Slide In From Bottom */
@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Draw Line */
@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ----------------------------------------
   Hero Animation Classes
   ---------------------------------------- */

.animate-fade-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-down {
    opacity: 0;
    animation: fadeInDown 0.8s ease forwards;
}

.animate-fade-left {
    opacity: 0;
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-right {
    opacity: 0;
    animation: fadeInRight 0.8s ease forwards;
}

.animate-scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease forwards;
}

/* Animation Delays */
.delay-1 {
    animation-delay: 0.1s;
}

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

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

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

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

/* ----------------------------------------
   Scroll-Triggered Animations
   ---------------------------------------- */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for child elements */
.animate-on-scroll.animated:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll.animated:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll.animated:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll.animated:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll.animated:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll.animated:nth-child(6) { transition-delay: 0.5s; }
.animate-on-scroll.animated:nth-child(7) { transition-delay: 0.6s; }
.animate-on-scroll.animated:nth-child(8) { transition-delay: 0.7s; }

/* ----------------------------------------
   Interactive Hover Animations
   ---------------------------------------- */

/* Button Hover Effects */
.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 ease, height 0.6s ease;
}

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

/* Card Hover Effects */
.service-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.service-card__icon {
    transition: transform 0.4s ease;
}

.service-card:hover .service-card__icon {
    transform: scale(1.1) rotate(5deg);
}

/* Link Underline Animation */
.nav__link::after {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image Hover Zoom */
.about__image {
    overflow: hidden;
}

.about__image .image-placeholder {
    transition: transform 0.5s ease;
}

.about__image:hover .image-placeholder {
    transform: scale(1.1);
}

/* ----------------------------------------
   Hero Visual Animations
   ---------------------------------------- */

.hero__shape--1 {
    animation: float 6s ease-in-out infinite;
}

.hero__shape--2 {
    animation: float 8s ease-in-out infinite;
    animation-delay: 1s;
}

.hero__shape--3 {
    animation: float 7s ease-in-out infinite;
    animation-delay: 2s;
}

.hero__image-wrapper {
    animation: fadeInUp 1s ease 0.5s forwards;
    opacity: 0;
}

/* ----------------------------------------
   Number Counter Animation
   ---------------------------------------- */

.stat__number {
    transition: all 0.3s ease;
}

.stat:hover .stat__number {
    transform: scale(1.1);
    color: var(--color-primary);
}

/* ----------------------------------------
   Process Timeline Animation
   ---------------------------------------- */

.process__step {
    transition: transform 0.3s ease;
}

.process__step:hover {
    transform: translateY(-5px);
}

.process__number {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.process__step:hover .process__number {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
}

/* ----------------------------------------
   Testimonial Card Animation
   ---------------------------------------- */

.testimonial-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.testimonial-card__avatar {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.testimonial-card:hover .testimonial-card__avatar {
    transform: scale(1.1);
    background-color: var(--color-accent);
}

/* ----------------------------------------
   Form Input Animations
   ---------------------------------------- */

.form__input,
.form__select,
.form__textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    transform: translateY(-2px);
}

.form__label {
    transition: color 0.3s ease;
}

.form__group:focus-within .form__label {
    color: var(--color-accent);
}

/* ----------------------------------------
   Social Links Animation
   ---------------------------------------- */

.social-link {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px) rotate(5deg);
}

.social-link svg {
    transition: transform 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.2);
}

/* ----------------------------------------
   Contact Item Hover
   ---------------------------------------- */

.contact__item {
    transition: transform 0.3s ease;
}

.contact__item:hover {
    transform: translateX(10px);
}

.contact__icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact__item:hover .contact__icon {
    transform: scale(1.2);
}

/* ----------------------------------------
   Footer Link Animations
   ---------------------------------------- */

.footer__list a {
    position: relative;
    display: inline-block;
}

.footer__list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.footer__list a:hover::after {
    width: 100%;
}

/* ----------------------------------------
   Scroll Progress Indicator
   ---------------------------------------- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--color-accent);
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

/* ----------------------------------------
   Loading Animations
   ---------------------------------------- */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader__content {
    text-align: center;
}

.page-loader__logo {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    color: var(--color-white);
    margin-bottom: var(--spacing-6);
    animation: pulse 1.5s ease infinite;
}

/* ----------------------------------------
   Parallax Effect (CSS Only)
   ---------------------------------------- */

.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

/* ----------------------------------------
   Text Reveal Animation
   ---------------------------------------- */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: slideInBottom 0.8s ease forwards;
}

/* ----------------------------------------
   Magnetic Button Effect
   ---------------------------------------- */

.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------
   Cursor Effects (Optional)
   ---------------------------------------- */

.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.hover {
    width: 50px;
    height: 50px;
    background-color: rgba(233, 69, 96, 0.1);
}

/* ----------------------------------------
   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-fade-up,
    .animate-fade-down,
    .animate-fade-left,
    .animate-fade-right,
    .animate-scale-in {
        opacity: 1;
        transform: none;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .hero__shape--1,
    .hero__shape--2,
    .hero__shape--3 {
        animation: none;
    }
}

/* ----------------------------------------
   Mobile Optimizations
   ---------------------------------------- */

@media (max-width: 768px) {
    .animate-on-scroll {
        transform: translateY(20px);
    }

    .hero__shape--1,
    .hero__shape--2,
    .hero__shape--3 {
        animation: none;
    }

    .service-card:hover {
        transform: translateY(-5px);
    }
}
