/* ========================================
   BC Gate - Advanced Animation System
   Railway-inspired SaaS Landing Page
   ======================================== */

/* Root Variables for Animations */
:root {
    --primary-green: #00a86b;
    --primary-green-dark: #008554;
    --primary-green-light: #4ade80;
    --secondary-green: rgba(0, 168, 107, 0.1);
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Animation Variables */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.15, 0.86);
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    
    /* Duration Variables */
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.6s;
    --duration-slower: 1s;
    --duration-slowest: 1.5s;
}

/* ========================================
   FOUNDATIONAL ANIMATIONS
   ======================================== */

/* Preloader and Initial Load Animations */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-logo {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% { text-shadow: 0 0 20px rgba(255,255,255,0.5); }
    100% { text-shadow: 0 0 40px rgba(255,255,255,0.8), 0 0 60px rgba(255,255,255,0.3); }
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Enhanced Navigation Animations */
.navbar {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    transition: all var(--duration-normal) var(--ease-out-expo);
    border-bottom: 1px solid rgba(0, 168, 107, 0.1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

.nav-logo {
    animation: slideInLeft var(--duration-slow) var(--ease-spring);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--duration-normal) var(--ease-spring);
    cursor: pointer;
}

.logo-text:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    animation: slideInRight var(--duration-slow) var(--ease-spring) 0.2s both;
}

.nav-link {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 168, 107, 0.1), transparent);
    transition: left var(--duration-normal) var(--ease-out-expo);
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-light));
    transition: width var(--duration-normal) var(--ease-spring);
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Language Toggle Enhanced Animation */
.language-toggle {
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    background: var(--gray-100);
    padding: 4px;
}

.language-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--primary-green);
    border-radius: 20px;
    transition: transform var(--duration-normal) var(--ease-spring);
    z-index: 1;
}

.language-toggle.ar::before {
    transform: translateX(100%);
}

.lang-btn {
    position: relative;
    z-index: 2;
    transition: color var(--duration-normal) ease;
}

.lang-btn.active {
    color: white;
}

/* Login Button Animation */
.login-btn {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-spring);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-green-dark);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out-expo);
    transform: translate(-50%, -50%);
    z-index: -1;
}

.login-btn:hover::before {
    width: 300%;
    height: 300%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 168, 107, 0.3);
}

/* ========================================
   HERO SECTION ANIMATIONS
   ======================================== */

.hero {
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300a86b' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: patternFloat 20s linear infinite;
}

@keyframes patternFloat {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-60px) translateY(-60px); }
}

.hero-container {
    animation: heroFadeIn var(--duration-slowest) var(--ease-out-expo);
}

@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(60px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    background: linear-gradient(135deg, var(--gray-900), var(--primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleReveal var(--duration-slowest) var(--ease-spring) 0.3s both;
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(90deg);
    }
    50% {
        opacity: 0.7;
        transform: translateY(25px) rotateX(45deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* Typewriter Effect for Hero Title */
.hero-title.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-green);
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s both, blink 1s step-end infinite;
}

/* Initial state for typewriter elements to prevent flash */
.hero-title[data-animation="typewriter"] {
    min-height: 1.2em; /* Prevent layout shift */
}

@keyframes typewriter {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: var(--primary-green); }
    51%, 100% { border-color: transparent; }
}

.hero-subtitle {
    animation: subtitleSlide var(--duration-slow) var(--ease-spring) 0.6s both;
}

@keyframes subtitleSlide {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Enhanced Button Animations */
.hero-buttons {
    animation: buttonsReveal var(--duration-slow) var(--ease-elastic) 0.9s both;
}

@keyframes buttonsReveal {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-spring);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--duration-slow) ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    box-shadow: 0 4px 15px rgba(0, 168, 107, 0.2);
    transition: all var(--duration-normal) var(--ease-spring);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 168, 107, 0.4);
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green));
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
    transition: all var(--duration-fast) ease;
}

.btn-secondary {
    background: white;
    border: 2px solid var(--gray-200);
    transition: all var(--duration-normal) var(--ease-spring);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--primary-green);
    color: var(--primary-green);
    box-shadow: 0 10px 25px rgba(0, 168, 107, 0.1);
}

/* Icon Animations within Buttons */
.btn i {
    transition: transform var(--duration-normal) var(--ease-spring);
}

.btn:hover i {
    transform: translateX(3px) scale(1.1);
}

.btn-secondary:hover i {
    animation: pulse 0.6s ease-in-out;
}

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

/* ========================================
   FLOATING CARDS ANIMATIONS
   ======================================== */

.hero-graphic {
    animation: graphicFloat var(--duration-slowest) var(--ease-out-expo) 1.2s both;
}

@keyframes graphicFloat {
    0% {
        opacity: 0;
        transform: translateX(100px) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

.floating-card {
    background: white;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 168, 107, 0.1);
    box-shadow: 0 10px 40px rgba(0, 168, 107, 0.1);
    transition: all var(--duration-normal) var(--ease-spring);
}

.floating-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 60px rgba(0, 168, 107, 0.2);
    border-color: var(--primary-green);
}

.card-1 {
    animation: float 4s ease-in-out infinite, cardSlideIn var(--duration-slow) var(--ease-spring) 1.5s both;
}

.card-2 {
    animation: float 4s ease-in-out infinite 1s, cardSlideIn var(--duration-slow) var(--ease-spring) 1.8s both;
}

.card-3 {
    animation: float 4s ease-in-out infinite 2s, cardSlideIn var(--duration-slow) var(--ease-spring) 2.1s both;
}

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(60px) rotate(10deg) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.floating-card i {
    transition: all var(--duration-normal) var(--ease-spring);
}

.floating-card:hover i {
    transform: scale(1.2) rotate(10deg);
    color: var(--primary-green);
}

/* ========================================
   SERVICES SECTION ANIMATIONS
   ======================================== */

.services {
    position: relative;
    overflow: hidden;
}

.section-header {
    animation: sectionHeaderReveal var(--duration-slow) var(--ease-out-expo);
}

@keyframes sectionHeaderReveal {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.services-grid {
    perspective: 1000px;
}

.service-card {
    background: white;
    transition: all var(--duration-normal) var(--ease-spring);
    opacity: 0;
    transform: translateY(60px) rotateY(15deg);
    animation: serviceCardReveal var(--duration-slow) var(--ease-spring) forwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.3s; }
.service-card:nth-child(3) { animation-delay: 0.5s; }

@keyframes serviceCardReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) rotateY(15deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateY(0deg) scale(1);
    }
}

.service-card:hover {
    transform: translateY(-15px) rotateY(-5deg) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 168, 107, 0.15);
}

.service-icon {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-spring);
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-green);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out-expo);
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

.service-card:hover .service-icon::before {
    width: 120%;
    height: 120%;
}

.service-icon i {
    position: relative;
    z-index: 2;
    transition: all var(--duration-normal) var(--ease-spring);
}

.service-card:hover .service-icon i {
    transform: scale(1.3) rotate(10deg);
    color: white;
}

/* Service Features List Animation */
.service-features {
    list-style: none;
    padding: 0;
}

.service-features li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(-20px);
    animation: featureListReveal var(--duration-normal) var(--ease-spring) forwards;
}

.service-features li:nth-child(1) { animation-delay: 0.1s; }
.service-features li:nth-child(2) { animation-delay: 0.2s; }
.service-features li:nth-child(3) { animation-delay: 0.3s; }

@keyframes featureListReveal {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-green);
    font-weight: bold;
    transition: all var(--duration-normal) var(--ease-spring);
}

.service-card:hover .service-features li::before {
    transform: scale(1.3) rotate(360deg);
}

/* ========================================
   TECH MOMENTUM SECTION ANIMATIONS
   ======================================== */

.tech-momentum {
    background: linear-gradient(135deg, var(--gray-50), white);
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
}

.tech-momentum::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300a86b' fill-opacity='0.02'%3E%3Cpath d='M40 40L20 20v40h40V20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: techPattern 25s linear infinite;
}

@keyframes techPattern {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    100% { transform: translateX(-80px) translateY(-80px) rotate(360deg); }
}

.momentum-content {
    position: relative;
    z-index: 2;
}

.momentum-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: momentumHeaderReveal var(--duration-slow) var(--ease-spring);
}

@keyframes momentumHeaderReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.momentum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.momentum-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 168, 107, 0.08);
    border: 1px solid rgba(0, 168, 107, 0.05);
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.momentum-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 168, 107, 0.03), transparent);
    transition: left var(--duration-slow) var(--ease-out-expo);
}

.momentum-card:hover::before {
    left: 100%;
}

.momentum-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 168, 107, 0.15);
    border-color: var(--primary-green);
}

.momentum-icon {
    margin-bottom: 1.5rem;
    position: relative;
}

.icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    transition: all var(--duration-normal) var(--ease-spring);
    overflow: hidden;
}

.icon-wrapper i {
    font-size: 2rem;
    color: white;
    position: relative;
    z-index: 2;
    transition: all var(--duration-normal) var(--ease-spring);
}

.icon-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: var(--primary-green);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.3;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

.momentum-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(0, 168, 107, 0.3);
}

.momentum-card:hover .icon-wrapper i {
    transform: scale(1.2) rotate(-5deg);
}

.momentum-content-text h3 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: color var(--duration-normal) ease;
}

.momentum-card:hover .momentum-content-text h3 {
    color: var(--primary-green);
}

.momentum-content-text p {
    color: var(--gray-600);
    line-height: 1.6;
    font-size: 0.95rem;
}

.momentum-cta {
    text-align: center;
    background: white;
    border-radius: 25px;
    padding: 3rem 2rem;
    box-shadow: 0 15px 50px rgba(0, 168, 107, 0.1);
    border: 2px solid rgba(0, 168, 107, 0.1);
    position: relative;
    overflow: hidden;
}

.momentum-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(0, 168, 107, 0.02), transparent);
    animation: ctaGlow 3s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.momentum-cta .cta-content {
    position: relative;
    z-index: 2;
}

.momentum-cta h3 {
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.momentum-cta p {
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.momentum-btn {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-spring);
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
}

.momentum-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-green-light);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out-expo);
    transform: translate(-50%, -50%);
    z-index: -1;
}

.momentum-btn:hover::before {
    width: 300%;
    height: 300%;
}

.momentum-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 168, 107, 0.4);
}

.momentum-btn i {
    transition: transform var(--duration-normal) var(--ease-spring);
    margin-left: 0.5rem;
}

.momentum-btn:hover i {
    transform: translateX(5px) scale(1.1);
}

/* Sequential Animation for Cards */
.momentum-card:nth-child(1) {
    animation-delay: 0.1s;
}

.momentum-card:nth-child(2) {
    animation-delay: 0.3s;
}

.momentum-card:nth-child(3) {
    animation-delay: 0.5s;
}

.momentum-card:nth-child(4) {
    animation-delay: 0.7s;
}

/* RTL Support for Tech Momentum */
[dir="rtl"] .momentum-btn i {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .momentum-btn:hover i {
    transform: translateX(-5px) scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tech-momentum {
        padding: 4rem 0;
    }
    
    .momentum-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .momentum-card {
        padding: 1.5rem;
    }
    
    .momentum-cta {
        padding: 2rem 1.5rem;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .icon-wrapper i {
        font-size: 1.5rem;
    }
}

/* ========================================
   PROCESS SECTION ANIMATIONS
   ======================================== */

.process {
    position: relative;
    overflow: hidden;
}

.process::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 168, 107, 0.02) 50%, transparent 70%);
    animation: processBackground 10s linear infinite;
}

@keyframes processBackground {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.process-steps {
    position: relative;
    z-index: 2;
}

.process-step {
    opacity: 0;
    transform: translateX(-100px);
    animation: processStepReveal var(--duration-slow) var(--ease-spring) forwards;
    transition: all var(--duration-normal) var(--ease-spring);
}

.process-step:nth-child(1) { animation-delay: 0.2s; }
.process-step:nth-child(2) { animation-delay: 0.4s; }
.process-step:nth-child(3) { animation-delay: 0.6s; }
.process-step:nth-child(4) { animation-delay: 0.8s; }

@keyframes processStepReveal {
    0% {
        opacity: 0;
        transform: translateX(-100px) rotateY(-45deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

.process-step:hover {
    transform: translateX(20px) scale(1.02);
    background: linear-gradient(135deg, white, var(--gray-50));
}

.step-number {
    position: relative;
    transition: all var(--duration-normal) var(--ease-spring);
    overflow: hidden;
}

.step-number::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-green-dark);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out-expo);
    transform: translate(-50%, -50%);
}

.process-step:hover .step-number::before {
    width: 150%;
    height: 150%;
}

.process-step:hover .step-number {
    transform: scale(1.1) rotate(5deg);
    color: white;
    z-index: 2;
}

@keyframes connectionLine {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

/* ========================================
   CTA SECTION ANIMATIONS
   ======================================== */

.cta {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0L50 100M0 50L100 50' stroke='%23ffffff' stroke-width='0.5' opacity='0.1'/%3E%3C/svg%3E");
    animation: ctaPattern 15s linear infinite;
}

@keyframes ctaPattern {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-100px) translateY(-100px); }
}

.cta-content {
    position: relative;
    z-index: 2;
    animation: ctaContentReveal var(--duration-slow) var(--ease-spring);
}

@keyframes ctaContentReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cta-title {
    animation: ctaTitleGlow 2s ease-in-out infinite alternate;
}

@keyframes ctaTitleGlow {
    0% { text-shadow: 0 0 20px rgba(255,255,255,0.3); }
    100% { text-shadow: 0 0 30px rgba(255,255,255,0.6), 0 0 40px rgba(255,255,255,0.2); }
}

.cta-btn {
    background: white;
    color: var(--primary-green);
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-spring);
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-green);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out-expo);
    transform: translate(-50%, -50%);
    z-index: -1;
}

.cta-btn:hover::before {
    width: 300%;
    height: 300%;
}

.cta-btn:hover {
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255,255,255,0.3);
}

/* ========================================
   FOOTER ANIMATIONS
   ======================================== */

.footer {
    animation: footerSlideUp var(--duration-slow) var(--ease-out-expo);
}

@keyframes footerSlideUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-section {
    opacity: 0;
    transform: translateY(30px);
    animation: footerSectionReveal var(--duration-normal) var(--ease-spring) forwards;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }
.footer-section:nth-child(3) { animation-delay: 0.3s; }
.footer-section:nth-child(4) { animation-delay: 0.4s; }

@keyframes footerSectionReveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MODAL ANIMATIONS
   ======================================== */

.modal {
    backdrop-filter: blur(20px);
    animation: modalBackdropFadeIn var(--duration-normal) ease-out;
}

@keyframes modalBackdropFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

.modal-content {
    animation: modalSlideIn var(--duration-slow) var(--ease-spring);
    transform-origin: center top;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8) rotateX(30deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.modal.closing .modal-content {
    animation: modalSlideOut var(--duration-normal) var(--ease-out-expo);
}

@keyframes modalSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9) rotateX(-15deg);
    }
}

/* ========================================
   FORM ANIMATIONS
   ======================================== */

.form-group {
    position: relative;
}

.form-group input,
.form-group select,
.form-group textarea {
    transition: all var(--duration-normal) var(--ease-out-expo);
    border: 2px solid var(--gray-200);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.1);
    transform: translateY(-2px);
}

.form-group label {
    transition: all var(--duration-normal) var(--ease-spring);
    transform-origin: left center;
}

.form-group input:focus + label,
.form-group select:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:not(:placeholder-shown) + label {
    transform: translateY(-25px) scale(0.8);
    color: var(--primary-green);
}

/* ========================================
   SCROLL TRIGGERED ANIMATIONS
   ======================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all var(--duration-slow) var(--ease-out-expo);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all var(--duration-slow) var(--ease-spring);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all var(--duration-slow) var(--ease-spring);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--duration-slow) var(--ease-spring);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   CHAT/DASHBOARD PREVIEW ANIMATIONS
   ======================================== */

.dashboard-preview {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 168, 107, 0.1);
    overflow: hidden;
    position: relative;
    animation: dashboardReveal var(--duration-slow) var(--ease-spring);
}

@keyframes dashboardReveal {
    0% {
        opacity: 0;
        transform: translateY(40px) rotateY(15deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateY(0deg);
    }
}

.chat-message-preview {
    opacity: 0;
    transform: translateX(30px);
    animation: chatMessagePop var(--duration-normal) var(--ease-spring) forwards;
}

.chat-message-preview:nth-child(1) { animation-delay: 0.5s; }
.chat-message-preview:nth-child(2) { animation-delay: 0.8s; }
.chat-message-preview:nth-child(3) { animation-delay: 1.1s; }

@keyframes chatMessagePop {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.progress-bar-preview {
    width: 0;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-light));
    height: 8px;
    border-radius: 4px;
    animation: progressFill 2s var(--ease-out-expo) 1.5s forwards;
}

@keyframes progressFill {
    0% { width: 0; }
    100% { width: 75%; }
}

.document-upload-preview {
    opacity: 0;
    transform: translateY(20px);
    animation: documentSlideIn var(--duration-normal) var(--ease-spring) forwards;
}

.document-upload-preview:nth-child(1) { animation-delay: 2s; }
.document-upload-preview:nth-child(2) { animation-delay: 2.2s; }

@keyframes documentSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Checkmark Animation */
.checkmark {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmarkDraw var(--duration-normal) var(--ease-spring) forwards;
}

@keyframes checkmarkDraw {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

/* ========================================
   RTL SPECIFIC ANIMATIONS
   ======================================== */

[dir="rtl"] .nav-link::after {
    right: 0;
    left: auto;
}

[dir="rtl"] .process-step {
    transform: translateX(100px);
}

[dir="rtl"] .process-step:hover {
    transform: translateX(-20px) scale(1.02);
}

[dir="rtl"] .scroll-reveal-left {
    transform: translateX(60px);
}

[dir="rtl"] .scroll-reveal-right {
    transform: translateX(-60px);
}

[dir="rtl"] .chat-message-preview {
    transform: translateX(-30px);
}

/* ========================================
   PRICING SECTION ANIMATIONS
   ======================================== */

.pricing-card {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    animation: pricingCardReveal var(--duration-slow) var(--ease-spring) forwards;
    transition: all var(--duration-normal) var(--ease-spring);
}

.pricing-card:nth-child(1) { animation-delay: 0.2s; }
.pricing-card:nth-child(2) { animation-delay: 0.4s; }
.pricing-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes pricingCardReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pricing-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 50px rgba(0, 168, 107, 0.2);
}

.price-amount {
    animation: priceJump var(--duration-slow) var(--ease-elastic) 1s both;
}

@keyframes priceJump {
    0% {
        transform: scale(0) rotate(180deg);
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* ========================================
   FAQ ANIMATIONS
   ======================================== */

.faq-item {
    transition: all var(--duration-normal) var(--ease-spring);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 168, 107, 0.1);
}

.faq-question {
    transition: all var(--duration-normal) var(--ease-spring);
}

.faq-toggle {
    transition: transform var(--duration-normal) var(--ease-spring);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
    color: var(--primary-green);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-normal) var(--ease-spring),
                padding var(--duration-normal) var(--ease-spring);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    animation: faqSlideDown var(--duration-normal) var(--ease-spring);
}

@keyframes faqSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU Acceleration for smooth animations */
.navbar,
.hero-title,
.btn,
.service-card,
.process-step,
.floating-card,
.modal-content {
    will-change: transform;
    transform: translateZ(0);
}

/* 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;
    }
}

/* ========================================
   RESPONSIVE ANIMATIONS
   ======================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        animation-duration: 1s;
    }
    
    .floating-card {
        animation-duration: 2s;
    }
    
    .process-step:hover {
        transform: translateY(-5px);
    }
    
    .service-card:hover {
        transform: translateY(-8px) scale(1.02);
    }
}

@media (max-width: 480px) {
    .btn {
        animation: none;
    }
    
    .floating-card {
        position: relative;
        animation: none;
    }
    
    .process-step {
        animation-delay: 0s !important;
    }
}
