/* ================================
   Styles généraux pour les cartes d'offres
================================ */
.offer-card {
  width: 100%;
  margin: 20px 0;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: center;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  font-weight: bold;
  overflow-x: hidden;
}

input,
textarea {
    font-size: 16px !important; /* Taille minimale pour éviter le zoom automatique */
}

/* Conteneur principal */
.advantage-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 20px;
  flex-wrap: wrap;
}

/* Conteneur pour le Parrain (affiché à gauche) */
.advantage-parrain {
  background-color: #d9f7d6;
  border-left: 5px solid #4CAF50;
  padding: 15px;
  border-radius: 8px;
  flex: 1;
  box-sizing: border-box;
}

/* Conteneur pour le Filleul (affiché à droite) */
.advantage-filleul {
  background-color: #fff3e0;
  border-left: 5px solid #ff9800;
  padding: 15px;
  border-radius: 8px;
  flex: 1;
  box-sizing: border-box;
}

/* Optionnel : quelques styles pour les titres et le texte */
h3 {
  margin-top: 0;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

p, li {
  font-family: Arial, sans-serif;
  font-size: 1rem;
  color: #333;
}

.button-container {
  text-align: center;
  margin: 20px 0;
}

/* Modification pour que chaque image ait exactement la même taille */
.offer-card img {
  height: 150px;
  width: auto;
  object-fit: contain;
  max-width: 100%;
}

.offer-card h2 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 10px;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.offer-card p {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
  margin: 10px 0;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.offer-card strong {
  color: #222;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ff3c00;
  color: white;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.btn:hover {
  background-color: #ff3c00;
}

/* ================================
   Styles pour les annonces de parrainage
================================ */
.sponsorship-card {
  width: 90%;
  margin: 20px auto;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  position: relative;
}

.sponsorship-date {
  font-size: 0.9rem;
  color: #666;
  font-family: Arial, sans-serif;
  font-weight: normal;
  position: absolute;
  top: 20px;
  left: 20px;
}

.sponsorship-info {
  display: flex;
  align-items: flex-start; /* Aligne les éléments en haut */
  margin-top: 30px;
  width: 100%;
  gap: 20px; /* Ajoute un espacement entre la photo et le contenu */
}

.sponsorship-photo {
    width: 60px !important; /* Taille fixe pour toutes les photos */
    height: 60px !important;
    border-radius: 50%;
    object-fit: cover; /* Remplit l'espace en rognant si nécessaire */
    object-position: center; /* Centre l'image */
    flex-shrink: 0; /* Empêche la réduction de l'image */
}

.sponsorship-details {
  flex: 1;
  display: flex;
  flex-direction: column; /* Organise pseudo et description verticalement */
  text-align: left;
  overflow: hidden;
}

.sponsorship-pseudo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  margin: 0; /* Supprime les marges par défaut */
}

.sponsorship-description {
  margin: 5px 0 0 0; /* Marge uniquement en haut pour espacer du pseudo */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sponsorship-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.sponsorship-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.detail-btn {
  padding: 10px 20px;
  background-color: #ff3c00;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  flex-shrink: 0;
}

.detail-btn:hover {
  background-color: #ff3c00;
}

.sponsorship-actions .boosted-label {
  position: static;
  margin-bottom: 5px;
}
/* ================================
   Styles pour le formulaire de parrainage
================================ */
.parrain-form {
  margin: 20px auto;
  padding: 20px;
  background-color: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  text-align: center;
  box-sizing: border-box;
}

.parrain-form h3 {
  margin-bottom: 10px;
}

.parrain-form textarea {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

.parrain-form button {
  padding: 10px 20px;
  background-color: #ff3c00;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
}

.parrain-form button:hover {
  background-color: #ff3c00;
}

/* ================================
   Styles pour les modaux (boost & connexion)
================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
  text-align: center;
  box-sizing: border-box;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.modal-buttons button,
.modal-buttons a {
  margin: 0 10px;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  text-decoration: none;
}

#boostYesButton {
  background-color: #4CAF50;
  color: white;
  order: 2;
}

#boostNoButton {
  background-color: #ff3c00;
  color: white;
  order: 1;
}

.modal-buttons button:hover,
.modal-buttons a:hover {
  opacity: 0.9;
}

.sponsorship-description {
  max-width: 30ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
  margin: 0;
}

.sponsorship-details {
  width: calc(100% - 80px);
  overflow: hidden;
}

/* ================================
   Notification Toast
================================ */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #4CAF50;
  color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1100;
}
.notification.show {
  opacity: 1;
}

.boosted-label {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff3c00;
  color: white;
  padding: 5px 10px;
  border-radius: 0 8px 0 8px;
  font-weight: bold;
  font-size: 0.9rem;
}

.offer-update-notice {
  text-align: center;
  margin: 20px 0;
  font-family: Arial, sans-serif;
  color: #555;
}

.offer-update-notice a {
  color: #ff3c00;
  text-decoration: none;
  font-weight: bold;
}

.pagination-container {
  display: flex !important;
  flex-direction: column !important; /* Change en colonne pour empiler les éléments verticalement */
  justify-content: center !important;
  align-items: center !important; /* Centre horizontalement */
  margin-top: 20px;
  gap: 10px; /* Espace entre le bouton et le texte en dessous */
}

.pagination-btn {
  padding: 8px 15px;
  background-color: #ff3c00;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.pagination-btn:hover {
  background-color: #e63900;
}

.pagination-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Style pour le texte de la page (centré en dessous) */
.pagination-container span {
  font-size: 1em;
  color: #333;
  text-align: center !important; /* Assure le centrage du texte */
}

/* ================================
   Responsive
================================ */
@media screen and (max-width: 768px) {
  body {
    padding-top: 20px;
  }

  .offer-card,
  .sponsorship-card,
  .parrain-form {
    padding: 15px;
  }

  .offer-card h2 {
    font-size: 1.5rem;
  }

  .sponsorship-photo {
    width: 50px !important;
    height: 50px !important;
  }

  .detail-btn,
  .btn {
    padding: 8px 16px;
  }

  .nav-links.desktop-only {
    display: none;
  }

  .advantage-container {
    flex-direction: column;
  }

  .advantage-parrain,
  .advantage-filleul {
    width: 100%;
  }

  .sponsorship-card {
    flex-direction: column; /* Passe en colonne sur mobile */
    align-items: stretch; /* Étire les éléments pour occuper toute la largeur */
  }

  .sponsorship-info {
    margin-top: 20px; /* Réduit légèrement la marge pour ajuster l'espace */
    width: 100%;
  }

  .sponsorship-actions {
    align-items: stretch; /* Étire le conteneur des actions */
    margin-top: 15px; /* Ajoute un espacement entre le contenu et le bouton */
  }

  .detail-btn {
    width: 100%; /* Prend toute la largeur disponible */
    max-width: calc(100% - 30px); /* Laisse des marges de 15px de chaque côté */
    margin: 0 15px; /* Centre le bouton avec des marges latérales */
    padding: 10px; /* Ajuste le padding pour une hauteur confortable */
  }

  .sponsorship-actions .boosted-label {
    align-self: flex-end; /* Positionne l'étiquette "boosté" à droite */
    margin-bottom: 10px;
  }
}