/**
 * Animations - EduProd
 */

/* Fade In Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in:nth-child(1) {
    animation-delay: 0.1s;
}

.fade-in:nth-child(2) {
    animation-delay: 0.2s;
}

.fade-in:nth-child(3) {
    animation-delay: 0.3s;
}

.fade-in:nth-child(4) {
    animation-delay: 0.4s;
}

.fade-in:nth-child(5) {
    animation-delay: 0.5s;
}

.fade-in:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Slide Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

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

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

/* Magnetic Button Effect Placeholder */
.magnetic-btn {
    transition: transform var(--transition-spring);
}

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

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

    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Float Animation */
@keyframes float {

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

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

.float {
    animation: float 3s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes bounce {

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

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

.bounce {
    animation: bounce 2s infinite;
}

/* Scale Pulse */
@keyframes scalePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Glow Effect */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(92, 225, 230, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(92, 225, 230, 0.8);
    }
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(92, 225, 230, 0.2);
    border-top-color: var(--physics-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

/* Skeleton Loading */
@keyframes skeleton {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

/* Visible Class for Scroll Animations */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Badge Animation */
.hero-badge {
    animation: fadeInDown 0.8s ease;
}

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

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

/* Portal Card Hover Glow */
.portal-card {
    position: relative;
}

.portal-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, var(--physics-primary), transparent);
    border-radius: var(--radius-2xl);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-spring);
    filter: blur(10px);
}

.portal-card:hover::after {
    opacity: 0.3;
}

/* ===== DIVI-STYLE SCROLL TRANSFORM EFFECTS ===== */

/* Subtle Scale on Scroll */
.transform-scale {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.95);
    opacity: 0.7;
}

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

/* Subtle Rotate on Scroll */
.transform-rotate {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-2deg) scale(0.97);
    opacity: 0.7;
}

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

/* Slide + Fade from Left */
.transform-left {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50px);
    opacity: 0;
}

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

/* Slide + Fade from Right */
.transform-right {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(50px);
    opacity: 0;
}

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

/* Subtle Parallax Effect */
.parallax-slow {
    transition: transform 0.3s ease-out;
}

/* Portal Cards Enhanced Transform */
.portal-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0) scale(1);
}

.portal-card:hover {
    transform: translateY(-12px) scale(1.02) rotate(0.5deg);
}

/* Feature Cards Stagger Transform */
.feature-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
    opacity: 0;
}

.feature-card.visible {
    transform: translateY(0);
    opacity: 1;
}

.feature-card:nth-child(1) {
    transition-delay: 0.1s;
}

.feature-card:nth-child(2) {
    transition-delay: 0.2s;
}

.feature-card:nth-child(3) {
    transition-delay: 0.3s;
}

.feature-card:nth-child(4) {
    transition-delay: 0.4s;
}

.feature-card:nth-child(5) {
    transition-delay: 0.5s;
}

.feature-card:nth-child(6) {
    transition-delay: 0.6s;
}

/* Hero Elements Stagger */
.hero-badge {
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-title {
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.hero-description {
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-cta-group {
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

/* Section Headers Transform */
.section-header {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(30px);
    opacity: 0;
}

.section-header.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Methodology Loop Transform */
.loop-container {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.9) rotate(-5deg);
    opacity: 0;
}

.loop-container.visible {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

/* CTA Section Transform */
.cta-content {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.95);
    opacity: 0;
}

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

/* Button Hover Transform Enhancement */
.btn-primary,
.btn-secondary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0) scale(1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Smooth Hover for All Interactive Elements */
a,
button {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Portal Icon Enhanced */
.portal-icon {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.portal-card:hover .portal-icon {
    transform: rotate(8deg) scale(1.15);
}

/* Feature Icon Flip Effect */
.feature-icon {
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feature-card:hover .feature-icon {
    transform: rotateY(180deg) scale(1.1);
}

/* ===== DIRECTIONAL TILT EFFECT - "Making Way" ===== */

/* Portal cards tilt directionally on scroll */
.portal-card {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0) rotateZ(0deg);
}

/* First two cards tilt left when scrolling past */
.portal-card:nth-child(1).scroll-tilt {
    transform: translateY(-20px) rotateZ(-3deg) scale(0.98);
}

.portal-card:nth-child(2).scroll-tilt {
    transform: translateY(-20px) rotateZ(-2deg) scale(0.98);
}

/* Last two cards tilt right when scrolling past */
.portal-card:nth-child(3).scroll-tilt {
    transform: translateY(-20px) rotateZ(2deg) scale(0.98);
}

.portal-card:nth-child(4).scroll-tilt {
    transform: translateY(-20px) rotateZ(3deg) scale(0.98);
}

/* Reset on hover to prevent conflict */
.portal-card:hover {
    transform: translateY(-12px) scale(1.03) rotateZ(1deg) !important;
}

/* Smooth transition back when scrolling up */
.portal-card:not(.scroll-tilt) {
    transform: translateY(0) rotateZ(0deg) scale(1);
}

/* ===== DIRECTIONAL TILT EFFECT - "Making Way" ===== */

/* Base state for portal cards */
.portals-grid .portal-card {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* First two cards tilt LEFT when scrolling past */
.portals-grid .portal-card:nth-child(1).scroll-tilt {
    transform: translateY(-30px) rotateZ(-5deg) scale(0.96) !important;
    opacity: 0.85;
}

.portals-grid .portal-card:nth-child(2).scroll-tilt {
    transform: translateY(-25px) rotateZ(-3deg) scale(0.97) !important;
    opacity: 0.9;
}

/* Last two cards tilt RIGHT when scrolling past */
.portals-grid .portal-card:nth-child(3).scroll-tilt {
    transform: translateY(-25px) rotateZ(3deg) scale(0.97) !important;
    opacity: 0.9;
}

.portals-grid .portal-card:nth-child(4).scroll-tilt {
    transform: translateY(-30px) rotateZ(5deg) scale(0.96) !important;
    opacity: 0.85;
}

/* Hover state - should override tilt when hovering */
.portals-grid .portal-card:hover {
    transform: translateY(-12px) scale(1.03) rotateZ(1deg) !important;
    opacity: 1 !important;
    z-index: 10;
}

/* Active tilt but NOT hovering */
.portals-grid .portal-card.scroll-tilt:not(:hover) {
    pointer-events: auto;
}