/* Style global pour la page des avis */
.page-reviews {
  margin: 0 auto;
  padding: 30px;
  background-color:#f9f9f9;
  border-radius: 8px;
}

/* Header de la page */
.header-reviews h1 {
  text-align: center;
  font-size: 2.8rem;       /* un peu plus grand */
  margin-bottom: 12px;
  color: #4db8ff;          /* une couleur plus vive, style « call to action » */
  font-weight: 700;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-transform: capitalize;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.header-reviews p {
  text-align: center;
  font-size: 1.2rem;       /* un peu plus grand */
  color:#444; /* une couleur plus vive, style « call to action » */
  font-style: italic;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Container */
.header-reviews {
  flex-direction: column;
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.form-reviews h2{
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 12px;
  color: #4db8ff; 
  font-weight: 700;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-transform: capitalize;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}
/*****************************************************************/
/* Setions des avis */
.reviews-container {
  font-family: Arial, sans-serif;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  column-gap: 5%;
  justify-content: space-between;
}
/****************Partie gauche****************/
.reviews-header {
  flex-direction: column;
  display: flex;
  width: 30%;
}
.reviews-header h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}
.ratings-breakdown {
  margin-top: 15px;
  width: 100%;
}
.rating-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
}
.bar-container {
  flex-grow: 1;
  height: 10px;
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background-color: #4db8ff;
  border-radius: 5px 0 0 5px;
}
.percent {
  width: 40px;
  text-align: right;
  font-weight: bold;
}

/* Toggle info */
.ratings-toggle {
  margin-top: 20px;
}
.toggle-btn {
  background: none;
  border: none;
  color: #004080;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  padding: 0;
}
.toggle-content {
  display: none;
  font-size: 14px;
  color: #444;
  margin-top: 10px;
  background: #f0f0f0;
  padding: 10px;
  border-radius: 6px;
}
/****/
/* Responsive */
@media (max-width: 768px) {
  .page-reviews{
    padding: 0;
  }
  .reviews-container {
    flex-direction: column;
  }

  .reviews-header {
    width: 100%;
  }
  .reviews-header h2 {
    text-align: center;
  }
  .overall-rating .rating-number, .stars,p {
    text-align: center;
  }
  .overall-rating p{
    font-size: 21px;
  }
  .header-reviews h1 {
    font-size: 2.2rem;
  }
  .header-reviews p {
    font-size: 1.3rem;
    padding: 0 20px;  
  }
  .header-reviews {
    margin-bottom: 0px;
  }
  .form-reviews h2{
    font-size: 2.2rem;
  }
}


/****************Partie droite****************/
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.custom-select-wrapper{
  text-align: center;
}

.overall-rating {
  text-align: left;
}
.rating-number {
  font-size: 40px;
  font-weight: bold;
}
.stars {
  color: #4db8ff;
  font-size: 18px;
}

.icon {
  font-size: 24px;
}
.sort-box {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 20px 0;
  font-size: 15px;
}
.custom-select-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-label {
  font-weight: 600;
  color: #333;
}

.sort-select-container select {
  appearance: none;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sort-select-container select:hover {
  border-color:  #3399cc;
  box-shadow: 0 0 0 3px rgba(0, 204, 119, 0.15);
}

/* Flèche personnalisée (optionnelle) */
.sort-select-container {
  position: relative;
}
.sort-select-container::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  color:  #666;
}

.review-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  border-left: 5px solid #4db8ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}
.rating-text {
  font-weight: bold;
}
.review-text {
  margin: 10px 0;
  font-size: 15px;
}
.reviewer {
  display: flex;
  align-items: center;
  margin-top: 10px;
}
.avatar {
  background: #004080;
  color: #ffffff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  margin-right: 10px;
}
.date {
  font-size: 12px;
  color: #777;
  margin-top: 8px;
}
.avis-image-wrapper {
  margin-bottom: 15px;
  text-align: center;
}
.avis-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-top: 10px;
}
.nav {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
/* même styles que la version précédente + pagination custom */
.pagination-custom {
  display: flex;
  align-items: center;
  font-size: 14px;
  justify-content: flex-end; /* aligner à droite */
  margin-top: 0px; /* rapprocher des avis */

}
.pagination-custom .nav {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.pagination-custom .nav:hover {
  background: #eee;
}
.pagination-custom .disabled {
  color: #bbb;
  cursor: not-allowed;
}
.overall-rating p {
  font-size: 24px;
  font-weight: 400;
  color: #616161;
  margin-top: 1%;
}
.overall-rating .stars {
  font-size: 20px;
}
.overall-rating .rating-number {
  font-size: 50px;
  font-weight: 700;
}



/*Section formulaire avis*/
.form-avis {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 800px;
  padding: 30px;
  border-radius: 14px;
  margin: 40px auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

}

.form-avis label {
  font-weight: 600;
  color: #333;
  font-size: 15px;
  margin-bottom: 6px;

}

/* Ajout pour le champ de titre */
.form-avis label[for="avis_titre"] {
  font-weight: bold;
  color: #333;
}

.form-avis input[type="text"]#avis_titre {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
}

/* Ajustement du textarea */
.form-avis textarea {
  min-height: 150px; /* Augmente la hauteur initiale */
  max-height: 300px; /* Définit une hauteur maximale */
  resize: vertical; /* Permet de redimensionner verticalement */
  overflow-y: auto; /* Ajoute une barre de défilement si nécessaire */
}

.form-avis input[type="text"],
.form-avis textarea,
.form-avis select {
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
}

  /* Ajout d’un effet de survol élégant sur les champs */
  .form-avis input[type="text"],
  .form-avis textarea,
  .form-avis select,
  .form-avis input[type="file"] {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
  
.form-avis input[type="text"]:hover,
.form-avis textarea:hover,
.form-avis select:hover,
.form-avis input[type="file"]:hover {
  border-color: #4db8ff;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
  outline: none;
}

.form-avis input[type="file"] {
  padding: 10px;
  font-size: 14px;
  color: #4db8ff;
}

.form-avis input[type="submit"] {
  background-color: #4db8ff;
  padding: 10px;
  border: none;
  border-radius: 10px;
  letter-spacing: 0.5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.15s ease;}

.form-avis input[type="submit"]:hover {
  background-color: #3399cc;
  transform: translateY(-2px);
}

.avis-confirmation {
  background-color: #e6f4ff;
  color: #1d5c99;
  border: 1px solid #a3d1ff;
  padding: 12px 18px;
  border-radius: 8px;
  margin: 0 auto 20px; /* Centre le message horizontalement */
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  text-align: center;
  max-width: 80%; /* Limite la largeur maximale pour éviter qu'il ne prenne toute la largeur */
}


.avis-erreur  {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 12px 18px;
  border-radius: 8px;
  margin: 0 auto 20px; /* Centre le message horizontalement */
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  text-align: center;
  max-width: 80%; /* Limite la largeur maximale pour éviter qu'il ne prenne toute la largeur */
}

.avis-stars {
  direction: rtl;
  text-align: center;
}
.avis-stars input[type="radio"] {
  display: none;
}
.avis-stars label {
  font-size: 2em;
  color: #ccc;
  cursor: pointer;
  transition: color 0.2s;
}
.avis-stars input[type="radio"]:checked ~ label,
.avis-stars label:hover,
.avis-stars label:hover ~ label {
  color: #4db8ff;
  transform: scale(1.1);
}
  /* Placeholder personnalisé */
  .form-avis input::placeholder,
  .form-avis textarea::placeholder {
    color: #999;
    font-style: italic;
  }
.file-error-message {
  color: #d9534f;
  font-size: 14px;
  margin-bottom: 10px;
  text-align: left;
  }


  /*** Section pour afficher les images des avis */
  .avis-images-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 15px 0;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.avis-images-container img {
    width: 300px; /* Augmente la largeur des images */
    height: auto; /* Garde la hauteur proportionnelle */
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avis-images-container::-webkit-scrollbar {
    height: 8px;
}

.avis-images-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.avis-images-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.avis-images-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/** Apercu des images dans le formulaire */

.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.image-preview {
  width: 100px;
  height: 100px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ccc;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}
.file-upload-container {
  margin: 20px 0;
}

.file-upload-label {
  display: inline-block;
  padding: 12px 0px;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  border: 2px dotted #4db8ff;
  transition: background-color 0.3s ease;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  text-align: center;
}

.file-upload-label:focus {
  background-color: #4db8ff;
}

.file-upload-label span {
  display: inline-block;
  margin-right: 10px;
}

.file-upload-label input[type="file"] {
  display: none;
}
