/*
 * Enorehab - Custom CSS
 * 
 * Styles personnalisés complémentaires à Tailwind CSS
 * Contient les animations spéciales, ajustements typographiques et effets
 */

/* --------------------------------------------------------------
  STYLES DE BASE ET TYPOGRAPHIE
-------------------------------------------------------------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow-x: hidden;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
  }
  
  /* --------------------------------------------------------------
    ANIMATIONS PERSONNALISÉES
  -------------------------------------------------------------- */
  
  /* Pulse animation pour les boutons CTA (optimisé) */
  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(14, 208, 255, 0.7);
    }
    70% {
      box-shadow: 0 0 0 15px rgba(14, 208, 255, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(14, 208, 255, 0);
    }
  }
  
  .pulse-animation {
    animation: pulse 1s ease-in-out;
    will-change: box-shadow; /* Optimisation GPU */
  }
  
  /* Fade-in animation pour le H1 */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .animate-fade-in {
    animation: fadeIn 1.2s ease-out forwards;
  }
  
  /* Glowing effect pour les blocs de prix */
  @keyframes glow {
    0% { box-shadow: 0 0 5px 0 rgba(14, 208, 255, 0.3); }
    50% { box-shadow: 0 0 15px 3px rgba(14, 208, 255, 0.5); } /* Moins intense */
    100% { box-shadow: 0 0 5px 0 rgba(14, 208, 255, 0.3); }
  }

  .reduce-animation,
  .reduce-animation * {
    animation-duration: 0.5s !important;
    transition-duration: 0.3s !important;
  }
  #pricing .border-[#0ed0ff]:hover {
    animation: glow 2s infinite;
  }
  
  /* --------------------------------------------------------------
    AJUSTEMENTS SPÉCIFIQUES POUR LES SECTIONS
  -------------------------------------------------------------- */
  
  /* Hero Section */
  #hero {
    background-image: radial-gradient(circle at 70% 50%, rgba(14, 208, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  }
  
  /* Target Blocks avec effet hover (optimisé) */
  .target-block {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, box-shadow; /* Optimisation GPU */
  }
  
  .target-block:hover {
    transform: translateY(-10px) scale(1.02); /* Plus fluide */
    box-shadow: 0 10px 30px -5px rgba(14, 208, 255, 0.3);
  }
  
  /* Story Section - image */
  #story img {
    box-shadow: 15px 15px 0 -5px #0ed0ff;
  }
  
  /* Prix barré avec ligne dynamique */
  .line-through {
    position: relative;
    display: inline-block;
  }
  
  .line-through::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ff0000;
    transform: rotate(-5deg);
  }
  
  /* Formulaire avec focus glow */
  input:focus {
    box-shadow: 0 0 0 3px rgba(14, 208, 255, 0.3);
  }
  
  /* --------------------------------------------------------------
    STYLE SPÉCIAL POUR LE HEADER FLOTTANT
  -------------------------------------------------------------- */
  header {
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }
  
  header.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }
  
  /* --------------------------------------------------------------
    AMÉLIORATIONS RESPONSIVES
  -------------------------------------------------------------- */

  /* Ajustements pour mobile avec optimisations */
  @media (max-width: 768px) {
    #hero h1 {
      font-size: 2.5rem;
      line-height: 1.2;
    }

    #hero p {
      font-size: 1.1rem;
      line-height: 1.5;
    }

    #story img {
      box-shadow: 10px 10px 0 -5px #0ed0ff;
      margin: 0 auto 2rem auto; /* Centre et ajoute de l'espace en bas */
    }

    .target-block {
      margin-bottom: 1.5rem;
      padding: 1.5rem;
    }

    /* CORRECTION: Animation de glow plus légère sur mobile */
    #pricing .border-[#0ed0ff]:hover {
      animation: glow 3s infinite;
    }

    /* CORRECTION: Animation fade-in moins intense sur mobile */
    .animate-fade-in {
      animation: fadeIn 0.8s ease-out forwards;
    }
  }

  /* Optimisations pour les animations et réduction du motion sickness */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    
    .target-block:hover {
      transform: none !important;
    }
  }
  
  /* Ajustements pour tablettes */
  @media (min-width: 769px) and (max-width: 1024px) {
    #hero {
      min-height: 90vh;
    }
  }
  
  /* --------------------------------------------------------------
    ACCESSIBILITÉ
  -------------------------------------------------------------- */
  
  /* Focus styles pour accessibilité keyboard */
  a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid #0ed0ff;
    outline-offset: 2px;
  }
  
  /* Skip to content link (hidden until focused) */
  .skip-to-content {
    position: absolute;
    top: -30px;
    left: 0;
    background: #0ed0ff;
    color: #000000;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s ease;
  }
  
  .skip-to-content:focus {
    top: 0;
  }
  
  /* --------------------------------------------------------------
    ANIMATIONS DE DÉFILEMENT
  -------------------------------------------------------------- */
  
  /* Classes d'animation utilisées par data-aos */
  .fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  
  .fade-up.active {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* --------------------------------------------------------------
    PERSONNALISATION DE FORMULAIRE
  -------------------------------------------------------------- */
  
  /* Message de succès */
  .success-message {
    background-color: rgba(14, 208, 255, 0.1);
    border-left: 4px solid #0ed0ff;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 4px 4px 0;
  }
  
  /* Message d'erreur */
  .error-message {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #ff0000;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 4px 4px 0;
  }
  
  /* --------------------------------------------------------------
    EFFETS SPÉCIAUX
  -------------------------------------------------------------- */
  
  /* Gradient texte pour titres spéciaux */
  .gradient-text {
    background: linear-gradient(90deg, #0ed0ff, #00b5e2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  
  /* Indice de réduction de prix */
  .price-tag {
    position: relative;
    display: inline-block;
  }
  
  .price-tag::before {
    content: '-40%';
    position: absolute;
    top: -24px;
    right: -40px;
    background: #ff3b3b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    transform: rotate(10deg);
  }
  
  /* Ajout d'un marqueur soulignant pour les FAQ */
  .faq-title {
    position: relative;
    display: inline-block;
  }
  
  .faq-title::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 3px;
    background: #0ed0ff;
    left: 0;
    bottom: -8px;
  }

  /* --------------------------------------------------------------
    LAZY LOADING DES IMAGES
  -------------------------------------------------------------- */
  
  /* Style pour les images avant chargement */
  img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: #111111;
    min-height: 100px;
  }
  
  /* Style pour les images après chargement */
  img.loaded {
    opacity: 1;
  }
  
  /* Effet de shimmer pour les images en cours de chargement */
  @keyframes shimmer {
    0% {
      background-position: -200px 0;
    }
    100% {
      background-position: calc(200px + 100%) 0;
    }
  }
  
  img[data-src]:not(.loaded) {
    background: linear-gradient(90deg, #111111 0%, #222222 50%, #111111 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
  }

  /* --------------------------------------------------------------
    CARROUSEL DE TÉMOIGNAGES
  -------------------------------------------------------------- */
  
  /* Container principal du carrousel */
  .testimonials-carousel-container {
    position: relative;
  }
  
  /* Carrousel avec overflow caché */
  .testimonials-carousel {
    overflow: hidden;
    border-radius: 12px;
  }
  
  /* Track qui contient tous les témoignages */
  .testimonials-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
  }
  
  /* Carte de témoignage individuelle */
  .testimonial-card {
    flex: 0 0 auto;
    box-sizing: border-box;
  }
  
  /* Responsive : 1 témoignage sur mobile, 3 sur desktop */
  @media (max-width: 768px) {
    .testimonial-card {
      width: 100%;
    }
  }
  
  @media (min-width: 769px) {
    .testimonial-card {
      width: 33.333%;
    }
  }
  
  /* Contenu de la carte */
  .testimonial-card .bg-\[#111111\] {
    background-color: #111111;
    border: 1px solid #222222;
    transition: all 0.3s ease;
    min-height: 280px;
  }
  
  .testimonial-card .bg-\[#111111\]:hover {
    border-color: #0ed0ff;
    box-shadow: 0 4px 20px rgba(14, 208, 255, 0.1);
    transform: translateY(-2px);
  }
  
  /* Étoiles du rating */
  .star-filled {
    color: #0ed0ff;
    font-size: 1.1rem;
    margin-right: 1px;
  }
  
  .star-empty {
    color: #444444;
    font-size: 1.1rem;
    margin-right: 1px;
  }
  
  /* Boutons de navigation */
  .nav-button {
    background-color: #111111;
    border: 1px solid #333333;
    transition: all 0.3s ease;
    will-change: background-color, border-color;
  }
  
  .nav-button:hover {
    background-color: #0ed0ff;
    border-color: #0ed0ff;
    transform: scale(1.05);
  }
  
  .nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .nav-button:disabled:hover {
    background-color: #111111;
    border-color: #333333;
    transform: none;
  }
  
  /* Indicateurs */
  .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #444444;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #555555;
  }
  
  .indicator:hover {
    background-color: #0ed0ff;
    border-color: #0ed0ff;
    transform: scale(1.2);
  }
  
  .indicator.active {
    background-color: #0ed0ff;
    border-color: #0ed0ff;
    box-shadow: 0 0 10px rgba(14, 208, 255, 0.5);
  }
  
  /* Animation de fondu pour les transitions */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .testimonial-card {
    animation: fadeInUp 0.6s ease-out;
  }
  
  /* Effet de pause sur hover */
  .testimonials-carousel-container:hover .testimonials-track {
    animation-play-state: paused;
  }
  
  /* Style pour les icônes des sports */
  .testimonial-card img[src*="icon-"] {
    filter: brightness(0) invert(1);
    opacity: 0.8;
  }
  
  /* Animation de pulse pour les témoignages actifs */
  @keyframes testimonialPulse {
    0% {
      box-shadow: 0 0 0 0 rgba(14, 208, 255, 0.3);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(14, 208, 255, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(14, 208, 255, 0);
    }
  }
  
  .testimonial-card.active .bg-\[#111111\] {
    animation: testimonialPulse 2s infinite;
  }
  
  /* Optimisations pour les animations */
  @media (prefers-reduced-motion: reduce) {
    .testimonials-track {
      transition: none !important;
    }
    
    .testimonial-card {
      animation: none !important;
    }
    
    .testimonial-card.active .bg-\[#111111\] {
      animation: none !important;
    }
  }
  
  /* Responsive pour les contrôles */
  @media (max-width: 640px) {
    .nav-button {
      width: 40px;
      height: 40px;
      padding: 8px;
    }
    
    .indicator {
      width: 8px;
      height: 8px;
    }
  }
  
  /* Loading state pour le carrousel */
  .testimonials-carousel.loading {
    opacity: 0.7;
    pointer-events: none;
  }
  
  .testimonials-carousel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #333333;
    border-top-color: #0ed0ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    to {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }