/* =============================================== */
/*     FORUM CSS - DESIGN MODERNE AMÉLIORÉ       */
/* =============================================== */

/* Import de la police Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Améliorations générales de la section forum */
.forum-section {
  margin-top: 2rem;
  padding: 2rem 0;
  background: #f5f5f5;
  border-radius: 12px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.forum-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.forum-left {
  width: 100%;
}

/* Titres de section modernisés */
.forum-header .forum-title-section h2,
#recent-comments-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem;
  color: #2E2E2E;
  margin-bottom: 0.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.forum-title-section .section-subtitle {
  font-size: 1rem;
  color: #6B7280;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Bouton publier modernisé */
.btn-publish {
  background: #C1121F;
  color: #FFFFFF;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
  font-family: 'Inter', sans-serif;
}

.btn-publish:hover:not(:disabled) {
  background: #C1121F;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-publish:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =============================================== */
/*     NOUVELLE STRUCTURE DES ANNONCES           */
/* =============================================== */

#comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* CARTE PRINCIPALE D'ANNONCE - Design moderne */
.announcement-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  font-family: 'Inter', sans-serif;
}

.announcement-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #C1121F;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.announcement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #C1121F;
}

.announcement-card:hover::before {
  opacity: 1;
}

/* STRUCTURE PRINCIPALE (logo + contenu + auteur) */
.announcement-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  padding: 1.5rem;
  align-items: start;
}

/* =============================================== */
/*           1. LOGO DE L'OFFRE (GAUCHE)         */
/* =============================================== */

.offer-logo-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.offer-logo-main {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 2px solid #E5E7EB;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  object-fit: contain;
  background: white;
  transition: all 0.3s ease;
  max-height: 40px;
  width: auto;
  padding: 8px;
}

.offer-logo-main:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  border-color: #C1121F;
}

/* Badge prix modernisé */
.bonus-badge {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
  text-align: center;
  min-width: 50px;
  font-family: 'Inter', sans-serif;
}

/* =============================================== */
/*          2. ZONE CENTRALE (CONTENU)           */
/* =============================================== */

.content-zone {
  min-width: 0;
  flex: 1;
}

.offer-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2E2E2E;
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.message-container {
  position: relative;
}

/* MODIFICATION : Messages limités à 2 lignes par défaut */
.message-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2E2E2E;
  margin-bottom: 0.75rem;
  text-align: justify;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* Limite les messages courts (classe ajoutée par JS) */
.message-short {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 3em;
}

/* Messages complets (classe ajoutée par JS) */
.message-full {
  display: block;
  overflow: visible;
  max-height: none;
}

/* Boutons "Voir plus/Voir moins" modernisés */
.toggle-message-btn {
  background: none;
  border: none;
  color: #EF4444;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  transition: all 0.3s ease;
  position: relative;
  margin-top: 0.5rem;
  font-family: 'Inter', sans-serif;
}

.toggle-message-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #EF4444;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.toggle-message-btn:hover {
  background: #FEF2F2;
  color: #DC2626;
}

.toggle-message-btn:hover::before {
  width: 80%;
}

/* =============================================== */
/*        3. INFOS AUTEUR (DROITE)               */
/* =============================================== */

.author-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 80px;
  text-align: center;
}

.user-avatar-link {
  display: block;
  transition: transform 0.3s ease;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  display: inline-block !important;
  line-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.user-avatar-link:hover {
  transform: scale(1.1);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #E5E7EB;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  object-fit: cover;
  transition: all 0.3s ease;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

.user-avatar::before,
.user-avatar::after {
  display: none !important;
  content: none !important;
}

.user-avatar:hover {
  border-color: #C1121F;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.username {
  font-size: 0.85rem;
  font-weight: 500;
  color: #2E2E2E;
  line-height: 1.2;
  max-width: 80px;
  word-break: break-word;
  font-family: 'Inter', sans-serif;
}

.publish-date {
  font-size: 0.85rem;
  color: #6B7280;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
}

/* =============================================== */
/*          4. ZONE D'ACTION (BAS)               */
/* =============================================== */

.action-zone {
  padding: 1rem 1.5rem;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  text-align: center;
}

.offer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #C1121F;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.2rem;
  border-radius: 0.6rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.offer-action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.offer-action-btn:hover::before {
  left: 100%;
}

.offer-action-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  background: #C1121F;
}

.offer-action-btn svg {
  transition: transform 0.3s ease;
}

.offer-action-btn:hover svg {
  transform: translateX(2px) scale(1.1);
}

/* =============================================== */
/*           MESSAGE VIDE STYLISÉ                */
/* =============================================== */

.empty-message {
  text-align: center;
  padding: 3rem 2rem;
  background: #FFFFFF;
  border-radius: 16px;
  border: 2px dashed #E5E7EB;
  color: #6B7280;
  animation: fadeInUp 0.6s ease;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.empty-message h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2E2E2E;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.empty-message p {
  font-size: 0.95rem;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}

/* =============================================== */
/*       CORRECTION ANIMATION TRUSTPILOT         */
/*           SANS BARRE DE DÉFILEMENT            */
/* =============================================== */

.trustpilot-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e1e5e9;
  position: sticky;
  top: 100px;
  height: auto;
  overflow: visible;
  font-family: 'Inter', sans-serif;
}

/* Container des reviews SANS barre de défilement */
.reviews-container {
  position: relative;
  overflow: hidden; /* Masque le défilement */
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  padding: 0;
  height: 320px;
  margin-bottom: 1.5rem;
}

/* Slider des reviews avec animation fluide */
.reviews-slider {
  display: flex;
  flex-direction: column;
  animation: slideReviewsVertical 30s infinite linear;
  gap: 0;
  min-height: calc(100% + 200px);
}

/* Animation verticale corrigée */
@keyframes slideReviewsVertical {
  0% { 
    transform: translateY(0); 
  }
  45% { 
    transform: translateY(-50%); 
  }
  50% { 
    transform: translateY(-50%); 
  }
  95% { 
    transform: translateY(0); 
  }
  100% { 
    transform: translateY(0); 
  }
}

/* Pause animation au survol */
.reviews-container:hover .reviews-slider {
  animation-play-state: paused;
}

/* Style des cartes reviews */
.review-card {
  min-height: 160px;
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
  padding: 1rem;
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.review-card:last-child {
  border-bottom: none;
}

.review-card:hover {
  background: #fafafa;
}

.trustpilot-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #00b67a;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* =============================================== */
/*    LAYOUT FORUM + WIDGET CORRIGÉ           */
/* =============================================== */

.forum-with-widget-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
  align-items: start;
}

#recent-comments-section {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 2rem;
}

#recent-comments-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem;
  color: #2E2E2E;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.share-btn-container {
  margin-bottom: 2rem;
  text-align: center;
}

/* =============================================== */
/*    WIDGET "VOUS AIMEREZ AUSSI" - DESIGN     */
/* =============================================== */

.related-offers-widget {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  border: 1px solid #E5E7EB;
  position: sticky;
  top: 100px;
  height: auto;
  overflow: visible;
  font-family: 'Inter', sans-serif;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.widget-header span {
  font-size: 1.5rem;
}

.widget-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #2E2E2E;
  margin: 0;
  line-height: 1.4;
}

.offers-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.offer-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #F9FAFB;
}

.offer-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #C1121F;
  background: white;
}

.offer-item .offer-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
  border: 2px solid #E5E7EB;
  transition: all 0.3s ease;
  max-height: 40px;
}

.offer-item:hover .offer-logo {
  border-color: #C1121F;
  transform: scale(1.05);
}

.offer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.offer-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2E2E2E;
  margin: 0;
  line-height: 1.3;
}

.offer-bonus {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
  background: #EF4444;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  display: inline-block;
  width: fit-content;
  font-family: 'Inter', sans-serif;
}

.widget-footer {
  border-top: 1px solid #E5E7EB;
  padding-top: 1rem;
  text-align: center;
}

.see-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #C1121F;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.see-all-link:hover {
  background: #EBF4FF;
  transform: translateX(2px);
}

/* =============================================== */
/*              ANIMATIONS                       */
/* =============================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.announcement-card {
  animation: fadeInUp 0.5s ease forwards;
}

.offer-logo-main {
  animation: slideInFromLeft 0.6s ease forwards;
}

/* =============================================== */
/*              RESPONSIVE DESIGN               */
/* =============================================== */

@media (max-width: 1024px) {
  .forum-layout,
  .forum-with-widget-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .trustpilot-section,
  .related-offers-widget {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .forum-section {
    padding: 1.5rem 1rem;
  }
  
  /* Structure mobile : logo au-dessus */
  .announcement-main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .offer-logo-container {
    justify-self: center;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  
  .offer-logo-main {
    width: 48px;
    height: 48px;
  }
  
  .bonus-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  
  .author-info {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
  }
  
  .action-zone {
    padding: 1rem;
  }
  
  .offer-action-btn {
    width: 100%;
    justify-content: center;
  }

  .reviews-container {
    height: 200px;
  }
  
  .trustpilot-section,
  .related-offers-widget {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .announcement-card {
    margin: 0 -0.5rem;
    border-radius: 12px;
  }
  
  .announcement-main {
    padding: 1rem;
  }
  
  .offer-title {
    font-size: 1.1rem;
    text-align: center;
  }
  
  .message-text {
    font-size: 0.9rem;
  }
  
  .offer-logo-main {
    width: 40px;
    height: 40px;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
  }
  
  .username {
    font-size: 0.8rem;
    max-width: none;
  }
  
  .publish-date {
    font-size: 0.8rem;
  }

  .reviews-container {
    height: 180px;
  }
}

/* =============================================== */
/*            FORCE STYLES POUR ÉVITER          */
/*              LES CONFLITS CSS                 */
/* =============================================== */

/* Force les couleurs pour éviter les conflits */
.announcement-card {
  background: #FFFFFF !important;
  border-color: #E5E7EB !important;
  color: #2E2E2E !important;
}

.announcement-card .offer-title {
  color: #2E2E2E !important;
}

.announcement-card .message-text {
  color: #2E2E2E !important;
}

.announcement-card .message-short,
.announcement-card .message-full {
  color: #2E2E2E !important;
}

.announcement-card .username {
  color: #2E2E2E !important;
}

.announcement-card .publish-date {
  color: #6B7280 !important;
}

.announcement-card .action-zone {
  background: #F9FAFB !important;
  border-color: #E5E7EB !important;
}

.related-offers-widget {
  background: white !important;
  color: #2E2E2E !important;
}

.related-offers-widget .offer-name,
.related-offers-widget .widget-title {
  color: #2E2E2E !important;
}

/* Force l'affichage des reviews Trustpilot */
.trustpilot-section .reviews-container {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: hidden !important; /* IMPORTANT: supprime la barre de défilement */
}

.trustpilot-section .reviews-slider {
  display: flex !important;
  animation: slideReviewsVertical 30s infinite linear !important;
}

/* =============================================== */
/*            ACCESSIBILITÉ                      */
/* =============================================== */

/* Focus visible pour la navigation au clavier */
.toggle-message-btn:focus,
.offer-action-btn:focus,
.user-avatar-link:focus,
.see-all-link:focus {
  outline: 2px solid #C1121F;
  outline-offset: 2px;
}

/* Réduction des mouvements pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .announcement-card:hover,
  .offer-logo-main:hover,
  .user-avatar-link:hover,
  .offer-action-btn:hover {
    transform: none;
  }
}