/* Common Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

/* Common Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-fade-up.animate {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.animate-fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.animate-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Image hover effects */
.animate-image-hover img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.animate-image-hover:hover img {
    /* transform: scale(1.05); Removed to prevent blur */
    filter: brightness(1.1);
}

/* Card hover effects */
.animate-card-hover {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.animate-card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Title underline animation */
.animate-title-underline {
    position: relative;
    display: inline-block;
}

.animate-title-underline::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #5a67d8;
    transition: width 0.8s ease-out 0.5s;
}

.animate-title-underline.animate::after {
    width: 80px;
}

/* Staggered animation delays */
.animate-delay-1 {
    transition-delay: 0.1s;
}

.animate-delay-2 {
    transition-delay: 0.2s;
}

.animate-delay-3 {
    transition-delay: 0.3s;
}

.animate-delay-4 {
    transition-delay: 0.4s;
}

.animate-delay-5 {
    transition-delay: 0.5s;
}


/* ===========================
   SCIENTIFIC PRELOADER STYLES
   =========================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 99999;
    /* Highest priority */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-molecule {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    perspective: 600px;
    transform-style: preserve-3d;
}

/* Central Nucleus */
.atom-nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #2eb8b8, #1a8a8a);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(46, 184, 184, 0.6);
    animation: nucleusPulse 2s infinite ease-in-out;
}

@keyframes nucleusPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 10px rgba(46, 184, 184, 0.4);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 25px rgba(46, 184, 184, 0.8);
    }
}

/* Electron Orbits */
.atom-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(44, 62, 80, 0.1);
    /* Subtle orbital path */
    transform-style: preserve-3d;
}

/* Electrons */
.atom-orbit::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #2c3e50;
    /* Electron color */
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(44, 62, 80, 0.6);
}

/* Rotate the 3 orbits to form an atom shape */
.orbit-1 {
    animation: rotateOrbit1 1.5s linear infinite;
}

.orbit-2 {
    animation: rotateOrbit2 1.5s linear infinite;
}

.orbit-3 {
    animation: rotateOrbit3 1.5s linear infinite;
}

@keyframes rotateOrbit1 {
    0% {
        transform: translate(-50%, -50%) rotateZ(0deg) rotateX(65deg) rotateZ(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(0deg) rotateX(65deg) rotateZ(360deg);
    }
}

@keyframes rotateOrbit2 {
    0% {
        transform: translate(-50%, -50%) rotateZ(60deg) rotateX(65deg) rotateZ(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(60deg) rotateX(65deg) rotateZ(360deg);
    }
}

@keyframes rotateOrbit3 {
    0% {
        transform: translate(-50%, -50%) rotateZ(120deg) rotateX(65deg) rotateZ(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(120deg) rotateX(65deg) rotateZ(360deg);
    }
}

/* Loading Text */
.loader-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(90deg, #2c3e50, #2eb8b8, #2c3e50);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s linear infinite;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

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

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