/* ===== PREMIUM ANIMATIONS & EFFECTS FOR INDEX PAGE ===== */

/* Smooth entrance animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Premium floating animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Gradient shift animation */
@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Pulse glow effect */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(74, 111, 165, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(74, 111, 165, 0.8);
    }
}

/* Apply animations to sections (Desktop Only) */
@media (min-width: 993px) {
    .hero-section {
        animation: fadeInScale 1.2s cubic-bezier(0.175, 0.885, 0.32, 1);
    }

    .hero-content h1 {
        animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) 0.3s both;
    }

    .hero-content p {
        animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) 0.5s both;
    }

    .hero-actions a:nth-child(1) {
        animation: slideInLeft 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) 0.7s both;
    }

    .hero-actions a:nth-child(2) {
        animation: slideInRight 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) 0.7s both;
    }
}

/* Enhanced hover effects for hero buttons */
.hero-actions a {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-actions a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hero-actions a:hover::before {
    width: 300px;
    height: 300px;
}

.hero-actions a:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Pillar cards with stagger animation */
.pillar-card {
    animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) both;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pillar-card:nth-child(1) {
    animation-delay: 0.2s;
}

.pillar-card:nth-child(2) {
    animation-delay: 0.4s;
}

.pillar-card:nth-child(3) {
    animation-delay: 0.6s;
}

.pillar-card:hover {
    transform: translateY(-15px) rotate(2deg);
    box-shadow: 0 25px 60px rgba(74, 111, 165, 0.3);
}

.pillar-icon {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pillar-card:hover .pillar-icon {
    transform: scale(1.2);
    color: #3a5f95;
}

/* Portfolio items with reveal animation */
.portfolio-item {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) both;
}

.portfolio-item:nth-child(1) {
    animation-delay: 0.1s;
}

.portfolio-item:nth-child(2) {
    animation-delay: 0.2s;
}

.portfolio-item:nth-child(3) {
    animation-delay: 0.3s;
}

.portfolio-item:nth-child(4) {
    animation-delay: 0.4s;
}

.portfolio-item:hover {
    transform: scale(1.05) translateY(-10px);
    z-index: 10;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* Science section grid items */
.science-grid-item {
    animation: fadeInScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1) both;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.science-grid-item:nth-child(1) {
    animation-delay: 0.1s;
}

.science-grid-item:nth-child(2) {
    animation-delay: 0.2s;
}

.science-grid-item:nth-child(3) {
    animation-delay: 0.3s;
}

.science-grid-item:nth-child(4) {
    animation-delay: 0.4s;
}

.science-grid-item:nth-child(5) {
    animation-delay: 0.5s;
}

.science-grid-item:nth-child(6) {
    animation-delay: 0.6s;
}

.science-grid-item:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

/* Parallax effect for sections (Desktop only) */
@media (min-width: 993px) {

    .cuidado-section,
    .pillars-section,
    .science-section {
        animation: fadeInUp 1s cubic-bezier(0.175, 0.885, 0.32, 1) both;
    }
}

/* Button shimmer effect */
.btn-gradient-blue {
    position: relative;
    overflow: hidden;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.btn-gradient-blue::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.8s;
}

.btn-gradient-blue:hover::after {
    left: 100%;
}

/* Text gradient animation for titles */
.text-gradient-blue {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

/* Enhanced shadows and depth */
.pillar-card,
.portfolio-item,
.science-grid-item {
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Base scroll animation class */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}

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

/* Fade in from left */
.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right */
.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Rotate in */
.rotate-in {
    opacity: 0;
    transform: rotate(-5deg) scale(0.95);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Reduce motion for accessibility */
@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-left,
    .fade-in-right,
    .scale-in,
    .rotate-in {
        opacity: 1 !important;
        transform: none !important;
    }
}