/* Enhanced 3D Transform Styles */
* {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced 3D Animations with Particles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) rotateY(30deg) scale(0.8);
        perspective: 1000px;
    }

    to {
        opacity: 1;
        transform: translateX(0) rotateY(0) scale(1);
        perspective: 1000px;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px) rotateY(-30deg) scale(0.8);
        perspective: 1000px;
    }

    to {
        opacity: 1;
        transform: translateX(0) rotateY(0) scale(1);
        perspective: 1000px;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateZ(-50px) rotateX(10deg);
    }

    to {
        opacity: 1;
        transform: scale(1) translateZ(0) rotateX(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) translateZ(0) rotateX(0);
    }

    50% {
        transform: translateY(-15px) translateZ(20px) rotateX(5deg);
    }

    100% {
        transform: translateY(0px) translateZ(0) rotateX(0);
    }
}

@keyframes rotateBackground {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg) brightness(1);
    }

    50% {
        background-position: 100% 50%;
        filter: hue-rotate(180deg) brightness(1.2);
    }

    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg) brightness(1);
    }
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.8;
    }

    25% {
        transform: translateY(-15px) translateX(15px) scale(1.2);
        opacity: 1;
    }

    50% {
        transform: translateY(-25px) translateX(-15px) scale(0.8);
        opacity: 0.6;
    }

    75% {
        transform: translateY(-15px) translateX(15px) scale(1.1);
        opacity: 0.9;
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Journey Section Animation with Enhanced Parallax and Particles */
.journey-section {
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 1.2s ease-out 0.3s forwards;
    transform-style: preserve-3d;
    perspective: 1200px;
}

.journey-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 123, 255, 0.15) 0%, rgba(0, 123, 255, 0) 50%, rgba(98, 0, 255, 0.15) 100%);
    transform: translateY(0) translateZ(-20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    filter: blur(8px);
}

.journey-section::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    animation: particleFloat 8s infinite;
    z-index: -1;
    filter: blur(1px);
}

.journey-section:hover::before {
    transform: translateY(-15px) translateZ(30px);
    background: linear-gradient(45deg, rgba(0, 123, 255, 0.25) 0%, rgba(0, 123, 255, 0.1) 50%, rgba(98, 0, 255, 0.25) 100%);
    filter: blur(4px);
}

.journey-section img {
    opacity: 0;
    animation: scaleIn 1.2s ease-out 0.6s forwards;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    filter: brightness(1) contrast(1.05);
}

.journey-section img:hover {
    transform: scale(1.05) translateZ(40px) rotateX(2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1) contrast(1.1);
}

/* Vision & Mission Cards Animation with Enhanced Floating Effect and Ripples */
.vision-card,
.mission-card {
    position: relative;
    opacity: 0;
    background: linear-gradient(120deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1200px;
    overflow: hidden;
}

.vision-card {
    animation: slideInLeft 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards, float 6s ease-in-out infinite;
}

.mission-card {
    animation: slideInRight 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards, float 6s ease-in-out infinite 0.3s;
}

.vision-card::before,
.mission-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #007bff, #6610f2, #6f42c1);
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(-15px);
    filter: blur(8px);
}

.vision-card::after,
.mission-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

.vision-card:hover::before,
.mission-card:hover::before {
    opacity: 1;
    transform: translateZ(0);
    filter: blur(4px);
}

.vision-card:hover::after,
.mission-card:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: ripple 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.vision-card:hover,
.mission-card:hover {
    color: white;
    transform: translateY(-20px) translateZ(30px) rotateX(5deg);
    background: linear-gradient(45deg, #007bff, #6610f2, #6f42c1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.vision-card:hover i,
.mission-card:hover i {
    color: white !important;
    transform: translateZ(40px) scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

/* Core Values Animation with Enhanced Dynamic Gradients and Glow */
.value-card {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(120deg, #ffffff, #f8f9fa, #e9ecef);
    background-size: 300% 300%;
    animation: rotateBackground 20s ease infinite;
    transform-style: preserve-3d;
    overflow: hidden;
}

.value-card.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.value-card:nth-child(1) {
    transition-delay: 0.1s;
}

.value-card:nth-child(2) {
    transition-delay: 0.2s;
}

.value-card:nth-child(3) {
    transition-delay: 0.3s;
}

.value-card:nth-child(4) {
    transition-delay: 0.4s;
}

.value-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 60%);
    transform: translate(-100%, -100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-card:hover {
    transform: translateY(-15px) translateZ(40px) rotateX(8deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    background: linear-gradient(120deg, #007bff, #6610f2, #6f42c1);
    background-size: 300% 300%;
    color: white;
}

.value-card:hover::before {
    transform: translate(0, 0);
}

.value-card:hover i {
    color: white !important;
    transform: translateZ(50px) scale(1.15);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* General Scroll Animation with Enhanced Staggered Reveal */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px) rotateX(10deg) scale(0.95);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1200px;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Override animations for calculator modal */
#savingsCalculatorModal {
    animation: none !important;
    transform: none !important;
}

#savingsCalculatorModal .modal-dialog {
    animation: none !important;
    transform: none !important;
}

#savingsCalculatorModal .modal-content {
    animation: none !important;
    transform: none !important;
}

#savingsCalculatorModal .form-control,
#savingsCalculatorModal .form-select,
#savingsCalculatorModal .btn {
    animation: none !important;
    transform: none !important;
    transition: none !important;
}