/**
 * Fix Rate widget display issues
 * Hides the SAVE button and cleans up star rating display
 */

/* Hide the submit button in rate widgets */
.rate-widget .fivestar-rating-submit,
.rate-widget button[type="submit"],
.rate-widget input[type="submit"],
.rating-table button[type="submit"],
.rating-table input[type="submit"] {
  display: none !important;
}

/* Hide the form actions wrapper */
.rate-widget .form-actions,
.rating-table .form-actions {
  display: none !important;
}

/* Clean up fivestar radio button labels */
.fivestar-rating-wrapper .form-item-value,
.fivestar-rating-wrapper .form-radios,
.fivestar-rating-wrapper .js-form-type-radio {
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Remove label text after stars */
.fivestar-rating-wrapper .js-form-type-radio label {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-size: 0; /* Hide text but keep the star visible */
  line-height: 0;
}

/* Ensure star icons are visible */
.fivestar-rating-wrapper .js-form-type-radio label:before,
.fivestar-rating-wrapper .js-form-type-radio label:after {
  font-size: 20px; /* Restore size for icon fonts if used */
  line-height: 1;
}

/* Remove the lines/borders that appear after stars */
.fivestar-rating-wrapper .js-form-type-radio:after,
.fivestar-rating-wrapper .form-item:after {
  content: none !important;
  display: none !important;
}

/* Clean up the radio input layout */
.fivestar-rating-wrapper input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Ensure stars are displayed inline */
.fivestar-rating-wrapper .form-radios {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
}

/* Remove any default Drupal form item spacing */
.fivestar-rating-wrapper .form-item {
  margin: 0;
  padding: 0;
}

/* Hide empty labels completely */
.fivestar-rating-wrapper label:empty,
.fivestar-rating-wrapper .option:empty {
  display: none !important;
}

/* Fix table layout for rate widgets */
.rating-table {
  border: none;
  background: transparent;
}

.rating-table td {
  border: none;
  padding: 0;
  background: transparent;
}

/* Ensure the widget is interactive */
.fivestar-rating-wrapper {
  pointer-events: auto;
}

.fivestar-rating-wrapper label {
  cursor: pointer;
  pointer-events: auto;
}