/* Performance optimized CSS */
* {
    box-sizing: border-box;
}

/* Dynamic Logo Animations */
#navbar-logo {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, filter;
}

/* Enhanced Navbar Blur Effects */
#main-header {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: backdrop-filter, background-color, height;
    height: 64px; /* Initial height with extra space */
}

#header-bg {
    will-change: background-color, backdrop-filter, border-color;
}

#header-gradient {
    will-change: background-image;
}

/* Ensure backdrop-filter support */
@supports (backdrop-filter: blur(20px)) {
    .backdrop-blur-2xl {
        backdrop-filter: blur(40px);
    }
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    #header-bg.scrolled {
        background-color: rgba(255, 255, 255, 0.95) !important;
    }
}


/* Elegant particle animations */
@keyframes floating-particle {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
        opacity: 0.3;
    }
    33% { 
        transform: translate(5px, -8px) scale(1.2); 
        opacity: 0.6;
    }
    66% { 
        transform: translate(-3px, -5px) scale(0.8); 
        opacity: 0.8;
    }
}

.animate-floating-particle {
    animation: floating-particle 3s ease-in-out infinite;
}

/* Logo glow effect */
@keyframes logo-glow {
    0%, 100% { 
        filter: drop-shadow(0 0 0px rgba(0, 122, 120, 0));
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(0, 122, 120, 0.3));
    }
}

.logo-glow-hover:hover {
    animation: logo-glow 2s ease-in-out infinite;
}

/* Global Team Floating Animations */
@keyframes floating-team-1 {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
    }
    25% { 
        transform: translate(8px, -12px) rotate(2deg); 
    }
    50% { 
        transform: translate(-4px, -8px) rotate(-1deg); 
    }
    75% { 
        transform: translate(6px, -15px) rotate(1deg); 
    }
}

@keyframes floating-team-2 {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
    }
    33% { 
        transform: translate(-10px, 8px) rotate(-2deg); 
    }
    66% { 
        transform: translate(5px, 12px) rotate(1deg); 
    }
}

@keyframes floating-team-3 {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
    }
    20% { 
        transform: translate(6px, -6px) rotate(1deg); 
    }
    40% { 
        transform: translate(-8px, 4px) rotate(-1deg); 
    }
    60% { 
        transform: translate(4px, -10px) rotate(2deg); 
    }
    80% { 
        transform: translate(-3px, 6px) rotate(-1deg); 
    }
}

.animate-floating-team-1 {
    animation: floating-team-1 8s ease-in-out infinite;
}

.animate-floating-team-2 {
    animation: floating-team-2 10s ease-in-out infinite 2s;
}

.animate-floating-team-3 {
    animation: floating-team-3 6s ease-in-out infinite 1s;
}

/* New Hero Animations */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.8s ease-out forwards;
    opacity: 0;
}

/* Grid background enhancement */
.bg-gradient-radial {
    background: radial-gradient(circle, var(--tw-gradient-from), var(--tw-gradient-to));
}

/* Enhanced floating animation */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) scale(1); 
    }
    50% { 
        transform: translateY(-20px) scale(1.05); 
    }
}

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

/* Code terminal typing effect */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* Custom animations with GPU acceleration */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

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

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-10px); 
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 1s ease-out forwards;
}

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

/* Optimized transitions */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #F8FAFB;
}

::-webkit-scrollbar-thumb {
    background: #007A78;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #005F5D;
}

/* Focus states for accessibility */
a:focus,
button:focus {
    outline: 2px solid #007A78;
    outline-offset: 2px;
}

/* Print styles for SEO */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-primary {
        background-color: #000 !important;
    }
    
    .text-primary {
        color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance optimizations */
.transform {
    will-change: transform;
}

.hover\:scale-105:hover {
    will-change: transform;
}

/* Loading state */
.loading {
    opacity: 0;
    transform: translateY(20px);
}

.loaded .loading {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease-out;
}

/* Background patterns for service cards */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Scrolling animations for partner logos */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

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

.animate-scroll-left {
    animation: scroll-left 30s linear infinite;
    width: max-content;
}

.animate-scroll-right {
    animation: scroll-right 35s linear infinite;
    width: max-content;
}

/* Enhanced floating animations with parallax effect */
@keyframes float-parallax {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) scale(1); 
    }
    25% { 
        transform: translateY(-15px) translateX(5px) scale(1.1); 
    }
    50% { 
        transform: translateY(-30px) translateX(0px) scale(0.9); 
    }
    75% { 
        transform: translateY(-15px) translateX(-5px) scale(1.05); 
    }
}

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

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

@keyframes bob {
    0%, 100% { 
        transform: translateY(0px) scale(1); 
    }
    50% { 
        transform: translateY(-10px) scale(1.02); 
    }
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(0, 122, 120, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(0, 122, 120, 0.6);
        transform: scale(1.05);
    }
}

@keyframes drift-horizontal {
    0%, 100% { 
        transform: translateX(0px); 
    }
    50% { 
        transform: translateX(20px); 
    }
}

@keyframes drift-vertical {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-25px); 
    }
}

/* Animation classes */
.animate-float-parallax {
    animation: float-parallax 8s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.animate-float-fast {
    animation: float-fast 4s ease-in-out infinite;
}

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

.animate-pulse-glow {
    animation: pulse-glow 4s ease-in-out infinite;
}

.animate-drift-horizontal {
    animation: drift-horizontal 7s ease-in-out infinite;
}

.animate-drift-vertical {
    animation: drift-vertical 5s ease-in-out infinite;
}

/* Parallax scroll effects */
.parallax-slow {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.parallax-medium {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.parallax-fast {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

/* Hover animations */
.hover-float:hover {
    animation: bob 0.6s ease-in-out;
}

.hover-glow:hover {
    animation: pulse-glow 0.8s ease-in-out;
}

/* Smooth transitions for animated elements */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Performance optimizations for animations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerate {
    transform: translateZ(0);
    backface-visibility: hidden;
}