/* Custom Animations */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 6s ease-in-out infinite 3s;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scroll-continuous {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll {
    animation: scroll 20s linear infinite;
}

.animate-scroll-continuous {
    animation: scroll-continuous 20s linear infinite;
}

/* Hero Animations */
@keyframes gradient-x {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
}

@keyframes pulse-slower {
    0%, 100% { opacity: 0.2; transform: scale(0.95); }
    50% { opacity: 0.4; transform: scale(1.1); }
}

.animate-gradient-x {
    background-size: 400% 400%;
    animation: gradient-x 3s ease infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
}

.animate-pulse-slower {
    animation: pulse-slower 6s ease-in-out infinite;
}

.bg-grid-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(59, 130, 246, 0.3) 1px, transparent 0);
    background-size: 20px 20px;
}
@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.animate-fade-in-up {
    animation: fade-in-up 1s ease-out;
}

.animate-shimmer {
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Contact Section Animations */
@keyframes slide-up {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes gradient-text {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-slide-up {
    animation: slide-up 0.8s ease-out forwards;
    opacity: 0;
}

.animate-gradient-text {
    background: linear-gradient(-45deg, #ffffff, #e5e7eb, #ffffff, #f3f4f6);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-text 3s ease infinite;
}

/* CTA Animations */
@keyframes text-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(59, 130, 246, 0.1); }
    50% { text-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.2); }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-text-glow {
    animation: text-glow 3s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin-slow 8s linear infinite;
}

.bg-grid-subtle {
    background-image: radial-gradient(circle at 1px 1px, rgba(59, 130, 246, 0.1) 1px, transparent 0);
    background-size: 30px 30px;
}

.bg-grid-black {
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.1) 1px, transparent 0);
    background-size: 30px 30px;
}

@keyframes text-shadow {
    0%, 100% { text-shadow: 0 0 10px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 0, 0, 0.05); }
    50% { text-shadow: 0 0 20px rgba(0, 0, 0, 0.2), 0 0 40px rgba(0, 0, 0, 0.1); }
}

.animate-text-shadow {
    animation: text-shadow 3s ease-in-out infinite;
}

@keyframes number-glow {
    0%, 100% { text-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1); }
    50% { text-shadow: 0 0 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.15); }
}

@keyframes bounce-x {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.animate-number-glow {
    animation: number-glow 2s ease-in-out infinite;
}

.animate-bounce-x {
    animation: bounce-x 1s ease-in-out infinite;
}

.bg-grid-white {
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.1) 1px, transparent 0);
    background-size: 30px 30px;
}

@keyframes social-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.animate-social-float {
    animation: social-float 3s ease-in-out infinite;
}
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #2563eb, #7c3aed);
}

/* Typewriter Animation */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #60A5FA;
    animation: typing 1.5s steps(22, end) forwards, blink 0.8s infinite;
}

@keyframes typing {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes erasing {
    0% { width: 100%; }
    100% { width: 0; }
}

@keyframes blink {
    0%, 50% { border-color: #60A5FA; }
    51%, 100% { border-color: transparent; }
}

/* Logo Animation */
.logo-animate {
    animation: logoFloat 4s ease-in-out infinite, logoGlow 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.3));
    transition: all 0.3s ease;
}

.logo-animate:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 15px 30px rgba(59, 130, 246, 0.5));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(0deg); }
    75% { transform: translateY(-15px) rotate(-2deg); }
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.3)) brightness(1); }
    100% { filter: drop-shadow(0 15px 30px rgba(139, 92, 246, 0.4)) brightness(1.1); }
}
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Mobile First Approach */
@media (max-width: 320px) {
    html { font-size: 14px; }
    .container { padding: 0.5rem; }
    .service-card { padding: 0.75rem; margin-bottom: 1rem; }
    .service-card h3 { font-size: 0.9rem; line-height: 1.3; }
    .service-card p { font-size: 0.75rem; line-height: 1.4; }
    .mobile-menu-item { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
    .hero-title { font-size: 1.25rem !important; }
    .hero-subtitle { font-size: 0.8rem !important; }
    .hero-button { padding: 0.5rem 1rem; font-size: 0.8rem; }
    .faq-item { padding: 0.75rem; }
    .faq-title { font-size: 0.85rem; }
}

/* Small Mobile Devices */
@media (min-width: 321px) and (max-width: 375px) {
    html { font-size: 15px; }
    .container { padding: 0.75rem; }
    .service-card { padding: 1rem; margin-bottom: 1.25rem; }
    .service-card h3 { font-size: 1rem; line-height: 1.3; }
    .service-card p { font-size: 0.85rem; line-height: 1.4; }
    .mobile-menu-item { padding: 0.75rem 1rem; font-size: 0.9rem; }
    .hero-title { font-size: 1.5rem !important; }
    .hero-subtitle { font-size: 0.9rem !important; }
    .hero-button { padding: 0.75rem 1.25rem; font-size: 0.9rem; }
    .faq-item { padding: 1rem; }
    .faq-title { font-size: 0.9rem; }
}

/* Medium Mobile Devices */
@media (min-width: 376px) and (max-width: 480px) {
    .container { padding: 1rem; }
    .service-card { padding: 1.25rem; margin-bottom: 1.5rem; }
    .service-card h3 { font-size: 1.1rem; line-height: 1.3; }
    .service-card p { font-size: 0.9rem; line-height: 1.4; }
    .mobile-menu-item { padding: 0.875rem 1.25rem; font-size: 1rem; }
    .hero-title { font-size: 1.75rem !important; }
    .hero-subtitle { font-size: 1rem !important; }
    .hero-button { padding: 0.875rem 1.5rem; font-size: 1rem; }
    .faq-item { padding: 1.25rem; }
    .faq-title { font-size: 1rem; }
}

/* Large Mobile Devices */
@media (min-width: 481px) and (max-width: 640px) {
    .container { padding: 1.25rem; }
    .service-card { padding: 1.5rem; margin-bottom: 1.75rem; }
    .service-card h3 { font-size: 1.25rem; line-height: 1.3; }
    .service-card p { font-size: 1rem; line-height: 1.4; }
    .mobile-menu-item { padding: 1rem 1.5rem; font-size: 1.1rem; }
    .mobile-dropdown { max-height: 250px; overflow-y: auto; }
    .hero-title { font-size: 2rem !important; }
    .hero-subtitle { font-size: 1.125rem !important; }
    .hero-button { padding: 1rem 2rem; font-size: 1.125rem; }
    .faq-item { padding: 1.25rem; }
    .faq-title { font-size: 1.1rem; }
    .hero-section { min-height: 85vh; padding-top: 6rem; }
}
@media (max-width: 640px) {
    /* Layout Adjustments */
    .hero-section { 
        min-height: 100vh; 
        padding-top: 6rem; 
        padding-bottom: 2rem;
        display: flex;
        align-items: center;
    }
    
    /* Grid Layouts */
    .grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    
    /* Navigation */
    .mobile-menu-item { 
        padding: 1.25rem 1.5rem; 
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        min-height: 64px;
        display: flex;
        align-items: center;
    }
    .mobile-dropdown { 
        max-height: 300px; 
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Typography Scaling */
    h1 { font-size: clamp(1.75rem, 7vw, 2.5rem) !important; }
    h2 { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
    h3 { font-size: clamp(1.25rem, 5vw, 1.5rem) !important; }
    p { font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important; }
    
    /* Buttons */
    .hero-button, a[href="#contact"], a[href="#services"] { 
        padding: 1rem 1.5rem !important; 
        font-size: 1rem !important;
        width: 100% !important;
        max-width: 280px !important;
        margin: 0 auto 1rem !important;
        display: block !important;
        text-align: center !important;
    }
    
    /* Service Cards */
    .service-card, [data-aos] {
        margin-bottom: 2rem !important;
        padding: 1.5rem !important;
        border-radius: 1rem !important;
    }
    
    /* Spacing */
    .mb-6 { margin-bottom: 1.5rem !important; }
    .mb-8 { margin-bottom: 2rem !important; }
    .mb-12 { margin-bottom: 3rem !important; }
    .py-16, .py-20, .py-24 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .px-4, .px-6, .px-8 { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* Small Tablets */
@media (min-width: 641px) and (max-width: 768px) {
    .container { padding: 1.5rem; }
    .service-card { margin-bottom: 2rem; padding: 1.5rem; }
    .hero-title { font-size: clamp(2.5rem, 6vw, 3rem) !important; }
    .hero-subtitle { font-size: clamp(1.25rem, 3vw, 1.5rem) !important; }
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
    .faq-item { padding: 1.5rem; }
    .faq-title { font-size: 1.125rem; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
    .hero-section { min-height: 90vh; }
}

/* Large Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .container { padding: 2rem; }
    .service-card { margin-bottom: 2rem; padding: 2rem; }
    .hero-title { font-size: clamp(3rem, 5vw, 4rem) !important; }
    .hero-subtitle { font-size: clamp(1.5rem, 2.5vw, 1.75rem) !important; }
    .services-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
    .faq-item { padding: 1.75rem; }
    .faq-title { font-size: 1.25rem; }
    .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
    .hero-section { min-height: 95vh; }
}

/* Desktop and Large Screens */
@media (min-width: 1025px) {
    .container { padding: 2.5rem; }
    .hero-title { font-size: clamp(4rem, 6vw, 5rem) !important; }
    .hero-subtitle { font-size: clamp(1.75rem, 2vw, 2rem) !important; }
    .services-grid { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }
    .faq-item { padding: 2rem; }
    .faq-title { font-size: 1.5rem; }
    .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 3rem; }
    .hero-section { min-height: 100vh; }
}
@media (max-width: 640px) {
    button, .btn, a[role="button"], input[type="submit"], input[type="button"] {
        min-height: 52px !important;
        min-width: 52px !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        border-radius: 0.75rem !important;
        touch-action: manipulation;
    }

    /* All interactive elements */
    a, button, [role="button"] {
        min-height: 48px !important;
        padding: 0.75rem !important;
        touch-action: manipulation;
    }

    /* FAQ mobile optimization */
    .faq-item button {
        padding: 1.5rem !important;
        font-size: 1.1rem !important;
        min-height: 64px !important;
        text-align: left !important;
    }

    /* Icons and images */
    i { font-size: 1.25rem !important; }
    img { border-radius: 0.5rem !important; }
    
    /* back to top button */
    #backToTop {
        width: 64px !important;
        height: 64px !important;
        bottom: 2rem !important;
        right: 2rem !important;
        font-size: 1.5rem !important;
    }
    input, textarea, select {
        font-size: 16px !important;
        padding: 1rem !important;
        border-radius: 0.5rem !important;
        min-height: 52px !important;
    }
    ul li { padding: 0.5rem 0 !important; }
    .service-card:hover { transform: none !important; }
    .service-card:active { transform: scale(0.98) !important; }
}

/* Landscape Mobile Orientation */
@media (max-width: 640px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding-top: 4rem;
        padding-bottom: 2rem;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.25rem) !important;
    }
    
    .mobile-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}
@media (max-width: 640px) {
    /* Touch-optimized hover states */
    @media (hover: none) and (pointer: coarse) {
        .service-card:hover,
        .faq-item:hover,
        .hero-button:hover,
        a:hover {
            transform: none;
            box-shadow: none;
        }
    }

    /* active states for touch */
    .service-card:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .faq-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .hero-button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    button:active,
    .btn:active {
        transform: scale(0.96);
        transition: transform 0.1s ease;
    }

    /* Improved scrolling */
    html {
        -webkit-overflow-scrolling: touch;
    }
    .hero-section {
        padding-top: max(6rem, env(safe-area-inset-top) + 4rem);
        padding-bottom: max(3rem, env(safe-area-inset-bottom) + 1rem);
    }
    
    .mobile-menu {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    #backToTop {
        bottom: max(2rem, env(safe-area-inset-bottom) + 1rem);
        right: max(2rem, env(safe-area-inset-right) + 1rem);
    }
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title, .hero-subtitle {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .service-card {
        background-color: #1f2937;
        border-color: #374151;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    [data-aos] {
        animation: none !important;
        transition: none !important;
    }
}

/* Performance Optimizations */
.service-card,
.faq-item,
.hero-button,
.mobile-menu {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU  */
.animate-pulse,
.animate-bounce,
.animate-spin {
    transform: translateZ(0);
}
@media (max-width: 640px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .transition-all {
        transition-property: transform, opacity, background-color;
    }
}

/* Print Styles */
@media print {
    .mobile-menu,
    .hero-button,
    #backToTop {
        display: none !important;
    }
    
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .service-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}