/* ===== ANIMATIONS CSS ===== */

/* Text Animation */
.animate-text {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: textGradient 5s ease infinite;
}

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

/* Hero Animation */
.hero-animation {
    position: relative;
    animation: floatAnimation 6s ease-in-out infinite;
}

@keyframes floatAnimation {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Tool Card Animation */
.tool-card {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-card:hover {
    transform: translateY(-10px);
}

.tool-icon {
    position: relative;
    overflow: hidden;
}

.tool-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    animation: iconShine 3s infinite;
    opacity: 0;
}

.tool-card:hover .tool-icon::after {
    opacity: 1;
}

@keyframes iconShine {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

/* Feature Card Animation */
.feature-card {
    transition: all 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    position: relative;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.3);
    animation: pulse 2s infinite;
    opacity: 0;
}

.feature-card:hover .feature-icon::before {
    opacity: 1;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Step Card Animation */
.step-card {
    transition: all 0.4s ease;
}

.step-card:hover {
    transform: translateY(-10px);
}

.step-icon i {
    transition: all 0.4s ease;
}

.step-card:hover .step-icon i {
    transform: scale(1.2);
}

/* Testimonial Card Animation */
.testimonial-card {
    transition: all 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-10px);
}

/* Button Animation */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    z-index: -1;
}

.btn:hover::after {
    left: 0;
}

/* Navbar Animation */
.navbar {
    transition: all 0.4s ease;
}

.navbar.scrolled {
    animation: slideDown 0.5s forwards;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Page Transition Animation */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.active {
    transform: translateY(0);
}

.page-transition.exit {
    transform: translateY(-100%);
}

/* Scroll Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.active {
    animation: staggerFadeIn 0.5s forwards;
}

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated Background */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.animated-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(247, 37, 133, 0.2));
    animation: floatShape 15s infinite linear;
}

.animated-bg-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-duration: 25s;
}

.animated-bg-shape:nth-child(2) {
    width: 500px;
    height: 500px;
    top: 50%;
    right: -250px;
    animation-duration: 30s;
    animation-delay: 2s;
}

.animated-bg-shape:nth-child(3) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: 30%;
    animation-duration: 20s;
    animation-delay: 1s;
}

@keyframes floatShape {
    0% { transform: rotate(0deg) translate(0, 0); }
    25% { transform: rotate(90deg) translate(50px, 50px); }
    50% { transform: rotate(180deg) translate(0, 100px); }
    75% { transform: rotate(270deg) translate(-50px, 50px); }
    100% { transform: rotate(360deg) translate(0, 0); }
}

/* Loading Animation */
.loading-animation {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-animation div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-animation div:nth-child(1) {
    left: 8px;
    animation: loading1 0.6s infinite;
}

.loading-animation div:nth-child(2) {
    left: 8px;
    animation: loading2 0.6s infinite;
}

.loading-animation div:nth-child(3) {
    left: 32px;
    animation: loading2 0.6s infinite;
}

.loading-animation div:nth-child(4) {
    left: 56px;
    animation: loading3 0.6s infinite;
}

@keyframes loading1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

@keyframes loading3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

/* Typing Animation */
.typing-animation {
    display: inline-block;
    position: relative;
}

.typing-animation::after {
    content: '|';
    position: absolute;
    right: -8px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Shake Animation */
.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s infinite;
}

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

/* Rotate Animation */
.rotate {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Flip Animation */
.flip {
    backface-visibility: visible !important;
    animation: flip 1s ease;
}

@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); animation-timing-function: ease-out; }
    40% { transform: perspective(400px) translateZ(150px) rotateY(170deg); animation-timing-function: ease-out; }
    50% { transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1); animation-timing-function: ease-in; }
    80% { transform: perspective(400px) rotateY(360deg) scale(.95); animation-timing-function: ease-in; }
    100% { transform: perspective(400px) scale(1); animation-timing-function: ease-in; }
}

/* Wobble Animation */
.wobble {
    animation: wobble 1s ease;
}

@keyframes wobble {
    0% { transform: translateX(0%); }
    15% { transform: translateX(-25%) rotate(-5deg); }
    30% { transform: translateX(20%) rotate(3deg); }
    45% { transform: translateX(-15%) rotate(-3deg); }
    60% { transform: translateX(10%) rotate(2deg); }
    75% { transform: translateX(-5%) rotate(-1deg); }
    100% { transform: translateX(0%); }
}

/* Glow Animation */
.glow {
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px var(--primary-color), 0 0 20px var(--primary-color); }
    to { box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--primary-color), 0 0 40px var(--primary-color); }
}