/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    background: linear-gradient(180deg, #f0f9ff 0%, #f0fdf4 50%, #fefce8 100%);
}

/* Desktop Side Margins */
@media (min-width: 421px) {
    body {
        background: linear-gradient(135deg, #f0f9ff 0%, #f5f9ff 20%, #f0fdf4 40%, #fefce8 60%, #fff7ed 80%, #fef2f2 100%);
        background-size: 400% 400%;
        animation: gradientFlow 20s ease infinite;
    }
    
    .main-container {
        max-width: 600px !important;
    }
}

/* Mobile gradient background */
@media (max-width: 420px) {
    body {
        background: linear-gradient(180deg, #f0f9ff 0%, #f0fdf4 50%, #fefce8 100%);
    }
}

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

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent fade-in from affecting fixed button */
.fixed-cta-container.fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Staggered Animation Delays */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }
.fade-in:nth-child(7) { animation-delay: 0.7s; }
.fade-in:nth-child(8) { animation-delay: 0.8s; }
.fade-in:nth-child(9) { animation-delay: 0.9s; }

/* CTA Button Base */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #059669 0%, #047857 50%, #065f46 100%) !important;
    background-size: 200% 200%;
    animation: gradientSlide 3s ease infinite;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.4);
}

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

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:active::before {
    width: 400px;
    height: 400px;
}

.cta-button:hover {
    box-shadow: 0 15px 40px rgba(5, 150, 105, 0.6);
    transform: translateY(-2px);
}

/* Urgent Pulse Animation - Continuous */
@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(251, 146, 60, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 60px rgba(251, 146, 60, 0.8);
    }
}

.urgent-pulse {
    animation: urgentPulse 1.5s ease-in-out infinite, gradientSlideOrange 3s ease infinite;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%) !important;
    background-size: 200% 200%;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.5);
}

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

.urgent-pulse:hover {
    animation: urgentPulse 0.8s ease-in-out infinite, gradientSlideOrange 1.5s ease infinite;
    box-shadow: 0 20px 50px rgba(249, 115, 22, 0.7);
}

/* Urgent Scale Animation - More Aggressive */
@keyframes urgentScale {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.08);
    }
    50% {
        transform: scale(0.98);
    }
    75% {
        transform: scale(1.05);
    }
}

.urgent-scale {
    animation: urgentScale 2s ease-in-out infinite, gradientSlideEmerald 3s ease infinite;
    background: linear-gradient(135deg, #059669 0%, #047857 50%, #10b981 100%) !important;
    background-size: 200% 200%;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.6);
}

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

.urgent-scale:hover {
    animation: urgentScale 1s ease-in-out infinite, gradientSlideEmerald 1.5s ease infinite;
    box-shadow: 0 20px 50px rgba(5, 150, 105, 0.8);
}

/* Button Glow Effect */
.fixed-cta-button:hover {
    transform: translateY(-3px);
    filter: brightness(1.15);
}

/* Stat Cards Hover */
.stat-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.3);
}

/* Value Cards Hover */
.value-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-card:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.25);
}

/* Feature Cards Hover */
.feature-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.25);
}

/* Testimonial Cards Hover */
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.3);
}

/* Image Cards Float Effect */
.image-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(16, 185, 129, 0.4);
}

.image-card img {
    display: block;
    width: 100%;
    height: auto;
}

/* Icon Animations */
.icon-box, .icon-circle {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-card:hover .icon-box,
.feature-card:hover .icon-circle {
    transform: scale(1.2) rotate(10deg);
}

/* Fixed CTA Container */
.fixed-cta-container {
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.90) 70%, transparent 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999 !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    display: block !important;
    pointer-events: none;
}

.fixed-cta-container button {
    pointer-events: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Desktop Fixed Button Centering */
@media (min-width: 421px) {
    .fixed-cta-container {
        left: 50%;
        transform: translateX(-50%) !important;
        max-width: 600px;
        width: 600px;
    }
}

/* Fixed Button Extra Effects */
.fixed-cta-button {
    position: relative;
    border: 3px solid rgba(5, 150, 105, 0.3);
}

.fixed-cta-button::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(45deg, #059669, #10b981, #34d399, #059669);
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0.5;
    animation: borderGradientFlow 4s ease infinite;
}

@keyframes borderGradientFlow {
    0%, 100% { 
        background-position: 0% 50%;
        opacity: 0.5;
    }
    50% { 
        background-position: 100% 50%;
        opacity: 0.8;
    }
}

.fixed-cta-button:hover::after {
    opacity: 1;
    animation: borderGradientFlow 2s ease infinite;
}

/* Star Rating Animation */
.testimonial-card:hover .flex span {
    display: inline-block;
    animation: starBounce 0.6s ease-in-out;
}

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

/* Responsive Adjustments */
@media (max-width: 380px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card div:first-child {
        font-size: 1.5rem;
    }
}

/* WhatsApp Icon Styling */
.cta-button img,
.fixed-cta-button img {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 3px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Shimmer Effect on Images */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.image-card {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Performance Optimization */
.value-card,
.feature-card,
.testimonial-card,
.stat-card {
    will-change: transform;
}

/* Touch Feedback for Mobile */
@media (hover: none) and (pointer: coarse) {
    .cta-button:active,
    .fixed-cta-button:active {
        transform: scale(0.92);
    }
    
    .stat-card:active,
    .value-card:active,
    .feature-card:active,
    .testimonial-card:active {
        opacity: 0.9;
    }
}

/* Number Styling */
.stat-card div:first-child,
.text-2xl,
.text-3xl {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

/* Focus Accessibility */
button:focus-visible {
    outline: 3px solid #10b981;
    outline-offset: 3px;
}

/* Text Rendering Optimization */
body {
    text-rendering: optimizeLegibility;
}

/* Prevent Flickering */
.fade-in {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Modal Animations */
#modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#modal > div > div:last-child {
    animation: modalSlideUp 0.3s ease-out;
}

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

/* Modal Scrollbar Styling */
#modal .overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

#modal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

#modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

#modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* Urgent Button Extra Attention Getter */
@keyframes urgentGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.5),
                    0 0 40px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(251, 191, 36, 0.8),
                    0 0 80px rgba(251, 191, 36, 0.5);
    }
}

.urgent-pulse {
    animation: urgentPulse 1.5s ease-in-out infinite,
               urgentGlow 2s ease-in-out infinite;
}

/* Breathing Animation for Stats */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.stat-card {
    animation: breathe 3s ease-in-out infinite;
}

.stat-card:nth-child(2) {
    animation-delay: 0.5s;
}

.stat-card:nth-child(3) {
    animation-delay: 1s;
}

/* Footer Links Hover */
footer button {
    position: relative;
}

footer button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #10b981, #3b82f6);
    transition: width 0.3s ease;
}

footer button:hover::after {
    width: 100%;
}

/* Gradient Text Animation */
@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

h1, h2 {
    background-size: 200% auto;
    animation: gradientText 5s ease infinite;
}

/* Extra Smooth Transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading State Shimmer */
@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f1f5f9 0%,
        #e2e8f0 20%,
        #f1f5f9 40%,
        #f1f5f9 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}
