/* Custom Styles & Animations */

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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Animated Background */
.animated-bg {
    background: linear-gradient(45deg, 
        rgba(99, 102, 241, 0.2) 0%, 
        rgba(139, 92, 246, 0.2) 25%, 
        rgba(99, 102, 241, 0.2) 50%, 
        rgba(139, 92, 246, 0.2) 75%, 
        rgba(99, 102, 241, 0.2) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    width: 100%;
    height: 100%;
}

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

/* Fade In Up Animation */
.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

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

/* Slide Up Animation with Delays */
.slide-up {
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.delay-3 {
    animation-delay: 0.9s;
}

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

/* CTA Button Animation */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateZ(0); /* Enable hardware acceleration */
    will-change: transform;
}

.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:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:active {
    transform: scale(0.95);
}

/* Button Pulse Effect */
.button-pulse {
    animation: buttonPulse 1s ease-in-out;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    }
}

/* Mobile Touch Feedback */
@media (max-width: 768px) {
    .cta-button:active,
    a[href="#offre"]:active,
    a[href="#details"]:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
}

/* Pulse Animation */
.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Permanent CTA Button Animations */
.cta-button-permanent {
    animation: ctaPulseGlow 2s ease-in-out infinite;
    position: relative;
}

@keyframes ctaPulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5), 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(245, 158, 11, 0.7), 0 0 20px 5px rgba(245, 158, 11, 0.5);
    }
}

/* Permanent CTA Button Animations - Green Version */
.cta-button-permanent-green {
    animation: ctaPulseGlowGreen 2s ease-in-out infinite;
    position: relative;
}

@keyframes ctaPulseGlowGreen {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5), 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(16, 185, 129, 0.7), 0 0 20px 5px rgba(16, 185, 129, 0.5);
    }
}

/* Permanent "En savoir plus" button animation */
.info-button-permanent {
    animation: infoBounce 2s ease-in-out infinite;
}

@keyframes infoBounce {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 4px 6px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: translateY(-5px);
        box-shadow: 0 10px 15px rgba(255, 255, 255, 0.5);
    }
}

/* Comparison Cards */
.comparison-card {
    transition: all 0.3s ease;
}

.comparison-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Module Cards */
.module-card {
    transition: all 0.3s ease;
    cursor: pointer;
    animation: moduleFloat 3s ease-in-out infinite;
    position: relative;
}

.module-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #ec4899, #f59e0b, #6366f1);
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: moduleBorderGlow 3s ease infinite;
}

.module-card:hover::before {
    opacity: 0.6;
}

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

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

.module-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.3), 
                0 10px 10px -5px rgba(99, 102, 241, 0.2);
    animation: moduleFloat 3s ease-in-out infinite;
}

.module-card:hover .bg-gradient-to-br {
    transform: scale(1.1) rotate(5deg);
    transition: all 0.3s ease;
}

/* Stagger animation delays for module cards */
.module-card:nth-child(1) { animation-delay: 0s; }
.module-card:nth-child(2) { animation-delay: 0.1s; }
.module-card:nth-child(3) { animation-delay: 0.2s; }
.module-card:nth-child(4) { animation-delay: 0.3s; }
.module-card:nth-child(5) { animation-delay: 0.4s; }
.module-card:nth-child(6) { animation-delay: 0.5s; }
.module-card:nth-child(7) { animation-delay: 0.6s; }
.module-card:nth-child(8) { animation-delay: 0.7s; }
.module-card:nth-child(9) { animation-delay: 0.8s; }
.module-card:nth-child(10) { animation-delay: 0.9s; }
.module-card:nth-child(11) { animation-delay: 1s; }
.module-card:nth-child(12) { animation-delay: 1.1s; }
.module-card:nth-child(13) { animation-delay: 1.2s; }
.module-card:nth-child(14) { animation-delay: 1.3s; }
.module-card:nth-child(15) { animation-delay: 1.4s; }
.module-card:nth-child(16) { animation-delay: 1.5s; }
.module-card:nth-child(17) { animation-delay: 1.6s; }
.module-card:nth-child(18) { animation-delay: 1.7s; }

/* Resource Cards - Similar to module cards but with different animation */
.resource-card {
    transition: all 0.3s ease;
    cursor: pointer;
    animation: resourcePulse 4s ease-in-out infinite;
    position: relative;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #ec4899, #8b5cf6, #fbbf24);
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: resourceBorderGlow 4s ease infinite;
}

.resource-card:hover::before {
    opacity: 0.6;
}

@keyframes resourcePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 30px rgba(251, 191, 36, 0.2);
    }
}

@keyframes resourceBorderGlow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.2;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.4;
    }
}

.resource-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 30px rgba(251, 191, 36, 0.3);
}

.resource-card .icon-wrapper {
    transition: all 0.3s ease;
}

.resource-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* Stagger animation delays for resource cards */
.resource-card:nth-child(1) { animation-delay: 0s; }
.resource-card:nth-child(2) { animation-delay: 0.15s; }
.resource-card:nth-child(3) { animation-delay: 0.3s; }
.resource-card:nth-child(4) { animation-delay: 0.45s; }
.resource-card:nth-child(5) { animation-delay: 0.6s; }
.resource-card:nth-child(6) { animation-delay: 0.75s; }
.resource-card:nth-child(7) { animation-delay: 0.9s; }
.resource-card:nth-child(8) { animation-delay: 1.05s; }
.resource-card:nth-child(9) { animation-delay: 1.2s; }
.resource-card:nth-child(10) { animation-delay: 1.35s; }

/* Advantage Cards */
.advantage-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.advantage-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

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

.advantage-card:hover {
    transform: translateY(-10px) scale(1.03);
}

/* Testimonial Cards */
.testimonial-card {
    transition: all 0.3s ease;
    position: relative;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.testimonial-card::after {
    content: '💬';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.testimonial-card:hover::after {
    opacity: 1;
    top: -15px;
    right: -15px;
}

/* Revenue Cards */
.revenue-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.revenue-card::before {
    content: '💰';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
    transition: all 0.3s ease;
}

.revenue-card:hover::before {
    opacity: 0.5;
    transform: translateY(-50%) scale(1.2);
}

/* Counter Animation Styles */
.counter {
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 900;
}

.counter.counting {
    color: #f59e0b;
    animation: counterGlow 0.5s ease-in-out infinite;
    transform: scale(1.1);
}

.counter.count-complete {
    animation: counterPop 0.6s ease-out;
}

@keyframes counterGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(245, 158, 11, 0.6), 0 0 20px rgba(245, 158, 11, 0.3);
        transform: scale(1.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(245, 158, 11, 1), 0 0 30px rgba(245, 158, 11, 0.6), 0 0 40px rgba(245, 158, 11, 0.4);
        transform: scale(1.15);
    }
}

@keyframes counterPop {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.3) rotate(-5deg);
    }
    50% {
        transform: scale(1.25) rotate(5deg);
    }
    70% {
        transform: scale(1.15) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Revenue card enhanced animation on counter completion */
.revenue-card.counter-active {
    animation: cardCelebrate 0.6s ease-out;
}

@keyframes cardCelebrate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
    }
    100% {
        transform: scale(1.05);
    }
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

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

/* Floating Elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* Glowing Effect */
.glow-effect {
    position: relative;
}

.glow-effect::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #ec4899, #f59e0b);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(20px);
    transition: opacity 0.3s ease;
}

.glow-effect:hover::after {
    opacity: 0.7;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover Lift Effect */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

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

.shimmer {
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-animation {
    animation: rotate 20s linear infinite;
}

/* Scale on Hover */
.scale-hover {
    transition: transform 0.3s ease;
}

.scale-hover:hover {
    transform: scale(1.05);
}

/* Gradient Border */
.gradient-border {
    position: relative;
    background: white;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #ec4899);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Typewriter Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end);
}

/* Smooth Appear */
.smooth-appear {
    animation: smoothAppear 1s ease-out;
}

@keyframes smoothAppear {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Parallax Effect */
.parallax {
    transition: transform 0.3s ease-out;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .module-card {
        margin-bottom: 1rem;
    }
    
    .comparison-card {
        margin-bottom: 1.5rem;
    }
    
    .testimonial-card {
        margin-bottom: 1rem;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Better text wrapping */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Ensure buttons don't overflow */
    .cta-button {
        max-width: 100%;
        white-space: normal;
    }
    
    /* Better spacing for small screens */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    /* Ensure "CLAIR - RAPIDE - EFFICACE" fits on small screens */
    .bg-gradient-to-r.from-yellow-400 h4 {
        font-size: 1rem !important;
        letter-spacing: -0.5px;
    }
    
    .fa-bolt {
        font-size: 1.5rem !important;
    }
}

/* Print Styles */
@media print {
    .cta-button,
    .animated-bg,
    footer {
        display: none;
    }
}

/* Accessibility */
.focus-visible:focus {
    outline: 3px solid #6366f1;
    outline-offset: 2px;
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

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