/* --- Variabili e Reset per il plugin --- */
.dan-star-rating {
  color: var(--wp--preset--color--custom-color-2);
  font-size: 1.2em;
  display: inline-flex;
}
#commentform {
  margin-bottom: 25px;
  padding: 20px;
  border: 5px solid #ccc;
  border-radius: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 10;
}
.dan-review-form-rating label {
  font-weight: bold;
  display: block;
  margin-bottom: 10px;
  color: #333;
}

/* --- Switcher Buttons Styling --- */
.dan-switch-btn {
  transition: all 0.2s ease;
  border: 1px solid var(--wp--preset--color--custom-color-1) !important;
  color: var(--wp--preset--color--custom-color-1) !important;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dan-switch-btn iconify-icon {
  font-size: 1.4em;
  color: var(--wp--preset--color--custom-color-1);
  transition: color 0.2s ease;
}

.dan-switch-btn:hover {
  background-color: rgba(var(--wp--preset--color--custom-color-1-rgb, 0, 0, 0), 0.05);
}

.dan-switch-btn.active {
  background-color: var(--wp--preset--color--custom-color-1) !important;
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dan-switch-btn.active iconify-icon {
  color: #fff !important;
}

.dan-stars-selector {
  display: flex;
  gap: 8px;
  cursor: pointer;
  align-items: center;
  flex-wrap: wrap;
}
.dan-stars-selector iconify-icon {
  font-size: 2.5em;
  color: #ccc;
  transition:
    transform 0.2s,
    color 0.2s;
}
.dan-stars-selector iconify-icon:hover {
  transform: scale(1.2);
}
.dan-stars-selector iconify-icon.selected,
.dan-stars-selector iconify-icon.hovered {
  color: var(--wp--preset--color--custom-color-3);
}
.dan-rating-label {
  margin-left: 10px;
  font-weight: normal;
  color: #666;
  font-style: italic;
  font-size: 0.9em;
}

.dan-user-uploads {
  border-top: 1px dashed #ddd;
}
.dan-user-uploads input[type="file"] {
  border: 1px solid #eee;
  background: #fff;
  padding: 5px;
  font-size: 0.8em;
}
.dan-user-uploads label iconify-icon,
.dan-corrections-area label iconify-icon {
  vertical-align: middle;
  margin-right: 5px;
  color: var(--wp--preset--color--custom-color-2);
}

.dan-correction-field {
  animation: danFadeIn 0.3s ease-out;
  border-left: 3px solid var(--wp--preset--color--custom-color-3);
  padding-left: 15px;
}

.dan-avg-rating {
  background: #fdfdfd;
  border-left: 4px solid var(--wp--preset--color--custom-color-1);
  border-radius: 4px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 10px;
}
.dan-avg-rating strong {
  font-size: 1.1em;
  color: #222;
}
.dan-avg-label {
  font-size: 0.5em;
  text-transform: uppercase;
  font-weight: bold;
  color: var(--wp--preset--color--custom-color-2);
}
.dan-avg-value {
  font-size: 1.2em;
}
.dan-star-avg {
  font-size: 0.7em;
  color: #ffcc00;
}

/* Allineamento campi standard commenti */
.comment-form {
  display: flex;
  flex-direction: column;
  clear: both;
}
.comment-form p {
  margin-bottom: 15px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form input[type="select"],
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 5px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
}
.comment-form .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.comment-form .comment-form-cookies-consent input {
  margin-top: 4px;
}

/* Uniformazione del bottone Submit con preloader */

.comment-form .form-submit {
  text-align: right;
}
.comment-form button[type="submit"],
.comment-form #submit {
  display: inline-flex;
  align-items: center;
  padding: 12px 30px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: bold;
  border: none;
  background: var(--wp--preset--color--custom-color-2);
  color: #fff;
  transition: background 0.2s;
}
.comment-form button[type="submit"]:hover,
.comment-form .submit:hover {
  background: var(--wp--preset--color--custom-color-3);
}

/* Animazione 'tendina' per i campi del form */
.comment-form .comment-form-comment,
.comment-form .form-submit,
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-cookies-consent,
.dan-user-uploads,
.comment-notes,
.dan-corrections-area,
.dan-review-form-rating .dan-criterion-row:not(:first-child) {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    margin 0.4s ease;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.comment-form.dan-form-active .comment-form-comment,
.comment-form.dan-form-active .form-submit,
.comment-form.dan-form-active .comment-form-author,
.comment-form.dan-form-active .comment-form-email,
.comment-form.dan-form-active .comment-form-cookies-consent,
.comment-form.dan-form-active .dan-user-uploads,
.comment-form.dan-form-active .comment-notes,
.comment-form.dan-form-active .dan-corrections-area,
.dan-review-form-rating.dan-form-active .dan-criterion-row:not(:first-child) {
  max-height: 1200px;
  opacity: 1;
  padding-top: 1rem !important; /* Ripristina il pt-3 di Bootstrap */
  margin-top: 10px !important;
  margin-bottom: 15px !important;
}

/* Rimozione titoli duplicati FSE */
.wp-block-comments-title,
.comments-area > h2:first-child:not(.comments-title) {
  display: none !important;
}

/* Popup Validazione */
.dan-rating-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(8px);
  animation: danFadeIn 0.3s ease forwards;
}
.dan-rating-popup-content {
  background: #fff;
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border-top: 6px solid #ffcc00;
}
.dan-rating-popup-content iconify-icon {
  font-size: 5rem;
  color: #ffcc00;
  margin-bottom: 15px;
}
.dan-rating-popup-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #222;
}
.dan-rating-popup-content p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 25px;
}
.dan-rating-popup-content button {
  background: var(--wp--preset--color--custom-color-2);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}
.dan-rating-popup-content button:hover {
  transform: scale(1.05);
  background: var(--wp--preset--color--custom-color-3);
}

@keyframes danFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.dan-rating-popup-overlay.closing {
  animation: danFadeOut 0.3s ease forwards;
}
@keyframes danFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@media (max-width: 600px) {
  .dan-review-form-rating {
    text-align: center;
  }

  .dan-criterion-row {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }

  .dan-stars-selector {
    justify-content: center;
    flex-direction: column;
    width: 100%;
    margin-top: 5px;
  }

  .dan-rating-label {
    margin-left: 0 !important;
    margin-bottom: 8px;
  }

  .comment-form .form-submit {
    text-align: center !important;
  }

  .comment-form button[type="submit"],
  .comment-form #submit {
    margin: 10px auto 0 !important;
  }

  .comment-notes {
    text-align: center !important;
  }

  .dan-correction-field {
    padding-left: 0;
    border-left: none;
    border-top: 3px solid var(--wp--preset--color--custom-color-3);
    padding-top: 15px;
  }
}
/* Badge Titoli Onorifici */
.dan-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--wp--preset--color--custom-color-1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #fff !important;
  vertical-align: middle;
  margin-left: 5px;
  border: 1px solid #e0e0e0;
  text-decoration: none !important;
  transition:
    background 0.2s,
    color 0.2s;
  cursor: pointer;
}
a.dan-user-badge:hover {
  background: var(--wp--preset--color--custom-color-2);
  color: #222 !important;
  border-color: #ccc;
}
.dan-user-badge iconify-icon {
  font-size: 14px;
  color: #fff;
}
.dan-badge-icon {
  width: 32px; /* Dimensione predefinita per il profilo */
  height: 32px;
  vertical-align: middle;
  margin-right: 3px;
  border-radius: 2px;
}
#dan-section-reviews .dan-badge-icon {
  width: 64px;
  height: 64px;
  }

/* Liste recensioni e media */
.dan-comment-ratings {
  font-size: 0.85em;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}
.dan-comment-rating-row {
  max-width: 220px;
}
.dan-star-small {
  font-size: 1em;
}

/* Sicurezza */
.dan-hp-field {
  display: none;
}
.dan-criterion-row {
  border-bottom: solid 1px var(--wp--preset--color--custom-color-2);
}
.dan-criterion-row label iconify-icon,
.dan-comment-rating-row iconify-icon,
.dan-avg-label iconify-icon,
.review-meta iconify-icon {
  font-size: 14px;
  vertical-align: middle;
  margin-right: 3px;
}
