/* ===== HEADER STYLES ===== */

/* Empêcher tout défilement horizontal sur l'ensemble du site, notamment sur mobile */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

/* Header backdrop - arrière-plan du header */
.jace-header-backdrop {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.3s ease;
}

/* Navigation links desktop */
.jace-nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.jace-nav-link:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* ===== MOBILE MENU STYLES ===== */

/* Container du menu mobile - positionnement absolu pour éviter la superposition */
#mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Menu mobile visible */
#mobile-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Backdrop du menu mobile */
.jace-mobile-backdrop {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-top: none;
    border-radius: 0 0 1.5rem 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: 0 1rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Liens du menu mobile */
.jace-mobile-link {
    transition: all 0.2s ease;
    border-radius: 0.75rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.jace-mobile-link:hover,
.jace-mobile-link:focus {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(4px);
}

.jace-mobile-link:active {
    transform: translateX(4px) scale(0.98);
    background: rgba(139, 92, 246, 0.15);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes */
@media (max-width: 1024px) {
    .jace-mobile-backdrop {
        margin: 0 0.75rem;
        border-radius: 0 0 1.25rem 1.25rem;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .jace-header-backdrop {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .jace-mobile-backdrop {
        margin: 0 0.5rem;
        border-radius: 0 0 1rem 1rem;
        max-height: calc(100vh - 4rem);
    }
    
    .jace-mobile-link {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* Petits mobiles */
@media (max-width: 480px) {
    .jace-mobile-backdrop {
        margin: 0 0.25rem;
        border-radius: 0 0 0.75rem 0.75rem;
    }
    
    .jace-mobile-link {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }
}

/* ===== ANIMATIONS ET TRANSITIONS ===== */

/* Animation d'ouverture du menu */
@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation de fermeture du menu */
@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-10px);
        opacity: 0;
    }
}

/* ===== ACCESSIBILITÉ ===== */

/* Focus visible pour l'accessibilité */
.jace-nav-link:focus,
.jace-mobile-link:focus,
#mobile-menu-button:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Réduction des mouvements pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    #mobile-menu,
    .jace-mobile-link,
    .jace-nav-link,
    .jace-header-backdrop,
    .jace-mobile-backdrop {
        transition: none;
    }
}

/* ===== OPTIMISATIONS PERFORMANCE ===== */

/* Optimisation GPU pour les animations */
#mobile-menu,
.jace-mobile-backdrop {
    will-change: transform, opacity;
}

/* Optimisation pour les écrans haute densité */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .jace-header-backdrop,
    .jace-mobile-backdrop {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Optimisations mobiles pour bulles réseaux et badge 10x dans le hero */
@media (max-width: 768px) {
  .social-bubble {
    width: 40px; height: 40px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    opacity: 0.95; backdrop-filter: saturate(120%);
  }
  .social-bubble i, .social-bubble svg { width: 22px; height: 22px; }
  /* Repositionnement pour éviter le hors-écran */
  .instagram-bubble { top: 12%; right: 8%; left: auto; transform: none; }
  .x-bubble { top: 46%; left: 6%; right: auto; transform: none; }
  .linkedin-bubble { bottom: 12%; right: 10%; left: auto; transform: none; }

  /* Badge 10x : rendre plus compact et lisible */
  .tenx-badge {
    right: 12px; bottom: 12px; padding: 6px 8px; border-radius: 12px;
  }
  .tenx-badge .text-xl { font-size: 16px; }
  .tenx-badge .text-xs { font-size: 11px; }
}

@media (max-width: 480px) {
  .social-bubble { width: 36px; height: 36px; }
  .social-bubble i, .social-bubble svg { width: 20px; height: 20px; }
  .instagram-bubble { top: 14%; right: 6%; }
  .x-bubble { top: 48%; left: 6%; }
  .linkedin-bubble { bottom: 10%; right: 8%; }
  .tenx-badge { right: 10px; bottom: 10px; padding: 5px 7px; }
  .tenx-badge .text-xl { font-size: 15px; }
  .tenx-badge .text-xs { font-size: 10px; }
}

/* Organisation des 4 bulles réseaux sur mobile pour éviter le découpage */
@media (max-width: 768px) {
  .hero-sociai .relative { position: relative; }
  .hero-sociai .social-bubble { position: static !important; margin: 6px; }
  .hero-sociai .social-bubble-container { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; justify-items: center; align-items: center; }
}

@media (max-width: 480px) {
  .hero-sociai .social-bubble { margin: 4px; }
  .hero-sociai .social-bubble-container { gap: 6px; }
}

/* Floating bubbles: smooth GPU-accelerated drift */
@keyframes bubbleFloat {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(2px, -3px, 0); }
  100% { transform: translate3d(-2px, 2px, 0); }
}

.social-bubble {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  animation: bubbleFloat 6s ease-in-out infinite alternate;
}

/* Mobile: keep bubbles floating OVER the scrolling posts, not stacked above */
@media (max-width: 768px) {
  .social-bubble {
    position: absolute !important; /* ensure float, not grid */
    width: 36px !important;
    height: 36px !important;
  }
  .social-bubble i, .social-bubble svg { width: 20px !important; height: 20px !important; }

  /* Safe in-bounds positions relative to the scrolling area */
  .facebook-bubble { top: 4% !important; left: 4% !important; right: auto !important; bottom: auto !important; }
  .instagram-bubble { top: 18% !important; right: 6% !important; left: auto !important; bottom: auto !important; }
  .x-bubble { bottom: 22% !important; left: 4% !important; right: auto !important; top: auto !important; }
  .linkedin-bubble { bottom: 6% !important; right: 6% !important; left: auto !important; top: auto !important; }

  /* Slightly different float timing for variety */
  .facebook-bubble { animation-duration: 5.5s; animation-delay: 0s; }
  .instagram-bubble { animation-duration: 6.2s; animation-delay: 0.2s; }
  .x-bubble { animation-duration: 5.8s; animation-delay: 0.1s; }
  .linkedin-bubble { animation-duration: 6.4s; animation-delay: 0.3s; }
}

@media (max-width: 480px) {
  .social-bubble { width: 32px !important; height: 32px !important; }
  .social-bubble i, .social-bubble svg { width: 18px !important; height: 18px !important; }

  /* Tighter positions to avoid edge clipping on very small screens */
  .facebook-bubble { top: 6% !important; left: 6% !important; }
  .instagram-bubble { top: 22% !important; right: 7% !important; }
  .x-bubble { bottom: 24% !important; left: 6% !important; }
  .linkedin-bubble { bottom: 8% !important; right: 7% !important; }

  /* Slightly faster float to keep energy in tight spaces */
  .social-bubble { animation-duration: 5.2s; }
}
@media (max-width: 768px) {
  .hero-sociai .relative { position: relative; }
  /* Garder les bulles flotantes par-dessus le scroller */
  .hero-sociai .social-bubble { position: absolute !important; margin: 0; }
  /* Le conteneur ne doit pas forcer une grille sur mobile */
  .hero-sociai .social-bubble-container { display: contents; }
}

@media (max-width: 480px) {
  .hero-sociai .social-bubble { margin: 0; }
  .hero-sociai .social-bubble-container { display: contents; }
}

/* ===== MOBILE FEATURES DROPDOWN STYLES ===== */

/* Wrapper du sous-menu Features mobile */
.mobile-features-wrapper {
    position: relative;
}

/* Bouton toggle Features mobile */
#mobile-features-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}

/* Chevron rotation animation */
#mobile-features-chevron {
    transition: transform 0.2s ease;
}

/* Sous-menu Features mobile */
#mobile-features-menu {
    background: rgba(249, 250, 251, 0.95);
    border-radius: 0.75rem;
    border: 1px solid rgba(229, 231, 235, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    transform: translateY(-5px);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

/* Sous-menu visible */
#mobile-features-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    max-height: 500px;
}

/* Liens du sous-menu Features mobile */
#mobile-features-menu a {
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#mobile-features-menu a:hover,
#mobile-features-menu a:focus {
    background: rgba(139, 92, 246, 0.08);
    transform: translateX(2px);
}

#mobile-features-menu a:active {
    transform: translateX(2px) scale(0.98);
    background: rgba(139, 92, 246, 0.12);
}

/* Séparateur dans le sous-menu */
#mobile-features-menu .border-t {
    border-color: rgba(229, 231, 235, 0.8);
}

/* Lien "Voir toutes les fonctionnalités" */
#mobile-features-menu .text-violet-600 {
    font-weight: 600;
}

#mobile-features-menu .text-violet-600:hover {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.05);
}

/* Responsive pour le sous-menu Features mobile */
@media (max-width: 768px) {
    #mobile-features-menu {
        margin-left: 1.5rem;
        border-radius: 0.5rem;
    }
    
    #mobile-features-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    #mobile-features-menu {
        margin-left: 1rem;
        border-radius: 0.375rem;
    }
    
    #mobile-features-menu a {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
    
    #mobile-features-menu .gap-3 {
        gap: 0.5rem;
    }
    
    #mobile-features-menu i,
    #mobile-features-menu svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Animation d'ouverture du sous-menu */
@keyframes slideDownSubmenu {
    from {
        transform: translateY(-5px);
        opacity: 0;
        max-height: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
        max-height: 500px;
    }
}

/* Animation de fermeture du sous-menu */
@keyframes slideUpSubmenu {
    from {
        transform: translateY(0);
        opacity: 1;
        max-height: 500px;
    }
    to {
        transform: translateY(-5px);
        opacity: 0;
        max-height: 0;
    }
}

/* Accessibilité pour le sous-menu Features mobile */
#mobile-features-toggle:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

#mobile-features-menu a:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 1px;
}

/* Réduction des mouvements pour le sous-menu */
@media (prefers-reduced-motion: reduce) {
    #mobile-features-menu,
    #mobile-features-chevron,
    #mobile-features-menu a {
        transition: none;
    }
}

/* ===== MOBILE USE CASES DROPDOWN STYLES ===== */

/* Wrapper du sous-menu Use Cases mobile */
.mobile-usecases-wrapper {
    position: relative;
}

/* Bouton toggle Use Cases mobile */
#mobile-usecases-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}

/* Chevron rotation animation */
#mobile-usecases-chevron {
    transition: transform 0.2s ease;
}

/* Sous-menu Use Cases mobile */
#mobile-usecases-menu {
    background: rgba(249, 250, 251, 0.95);
    border-radius: 0.75rem;
    border: 1px solid rgba(229, 231, 235, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    transform: translateY(-5px);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

/* Sous-menu visible */
#mobile-usecases-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    max-height: 500px;
}

/* Liens du sous-menu Use Cases mobile */
#mobile-usecases-menu a {
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#mobile-usecases-menu a:hover,
#mobile-usecases-menu a:focus {
    background: rgba(139, 92, 246, 0.08);
    transform: translateX(2px);
}

#mobile-usecases-menu a:active {
    transform: translateX(2px) scale(0.98);
    background: rgba(139, 92, 246, 0.12);
}

/* Séparateur dans le sous-menu */
#mobile-usecases-menu .border-t {
    border-color: rgba(229, 231, 235, 0.8);
}

/* Responsive pour le sous-menu Use Cases mobile */
@media (max-width: 768px) {
    #mobile-usecases-menu {
        margin-left: 1.5rem;
        border-radius: 0.5rem;
    }
    
    #mobile-usecases-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    #mobile-usecases-menu {
        margin-left: 1rem;
        border-radius: 0.375rem;
    }
    
    #mobile-usecases-menu a {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
    
    #mobile-usecases-menu .gap-3 {
        gap: 0.5rem;
    }
    
    #mobile-usecases-menu i,
    #mobile-usecases-menu svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Accessibilité pour le sous-menu Use Cases mobile */
#mobile-usecases-toggle:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

#mobile-usecases-menu a:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 1px;
}

/* Réduction des mouvements pour le sous-menu */
@media (prefers-reduced-motion: reduce) {
    #mobile-usecases-menu,
    #mobile-usecases-chevron,
    #mobile-usecases-menu a {
        transition: none;
    }
}