/**
 * @file
 * Styles for MOJ Feedback Rating Widget.
 */

/* Star Rating Display */

.feedback-cancel-btn {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  cursor: pointer;
}

.feedback-rating-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feedback-stars-display {
  display: inline-flex;
  gap: 2px;
  color: #009261;
  font-size: 24px;
}

.feedback-stars-display i {
  transition: all 0.2s ease;
}

.feedback-rating-number {
  font-size: 16px;
  font-weight: 400;
  color: #333;
}

.feedback-count {
  color: #666;
  font-size: 14px;
}

/* Interactive Star Rating */
.rating-selector-wrapper {
  margin: 20px 0;
}

.rating-selector-heading {
}

.rating-selector-title {
  color: #161616 !important;
  font-family: "IBM Plex Sans Arabic";
  font-size: 16px;
  font-weight: 600;
}

.feedback-star-rating {
  display: inline-flex;
  gap: 5px;
  font-size: 32px;
  margin: 15px 0;
  direction: ltr;
}

.feedback-star-rating .star {
  cursor: pointer;
  color: #ddd;
  transition: all 0.2s ease;
}

.feedback-star-rating .star:hover {
  color: #009261 !important;
  transform: scale(1.1);
}

.feedback-star-rating .star:hover i {
  color: #009261 !important;
}

.feedback-star-rating .star.active {
  color: #009261 !important;
  transform: scale(1.05);
}

.feedback-star-rating .star.active i {
  color: #009261 !important;
}

.feedback-star-rating .star i.fas {
  color: #009261 !important;
}

.feedback-star-rating .star i.fal {
  color: #ddd;
}

/* Force gold color on filled stars */
.feedback-star-rating .star i.fa-star.fas {
  color: #009261 !important;
}

/* Feedback Form */
.feedback-form-container {
  display: none;
  margin-top: 15px;
}

.moj-feedback-form .form-item {
  margin-bottom: 15px;
}

.moj-feedback-form label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  color: #333;
}

.moj-feedback-form select,
.moj-feedback-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.moj-feedback-form textarea {
  min-height: 100px;
  resize: vertical;
}

.moj-feedback-form .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.moj-feedback-form .btn {
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.moj-feedback-form .btn-primary {
  background: #198754;
  color: #fff;
  float: left;
}

.moj-feedback-form .btn-primary:hover {
  background: #157347;
}

.moj-feedback-form .btn-secondary {
  background: #6c757d;
  color: #fff;
}

.moj-feedback-form .btn-secondary:hover {
  background: #5c636a;
}

/* Rate Button */
.feedback-rate-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #198754;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.feedback-rate-btn:hover {
  background: #157347;
  color: #fff;
  text-decoration: none;
}

/* Rating Breakdown */
.feedback-breakdown {
  margin-top: 20px;
  padding: 15px;
  background: #fff;
  border-radius: 4px;
}

.feedback-breakdown h4 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.breakdown-label {
  min-width: 60px;
  font-size: 14px;
  color: #666;
}

.breakdown-bar {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-bar .bar-fill {
  height: 100%;
  background: #009261;
  transition: width 0.3s ease;
}

.breakdown-count {
  min-width: 30px;
  text-align: right;
  font-size: 14px;
  color: #666;
}

/* Success Message */
.feedback-success {
  display: flex;
  justify-content: space-between;
}

.feedback-success i {
  font-size: 20px;
  margin-right: 10px;
}

/* Error States */
.feedback-star-rating.error {
  border: 2px solid #dc3545;
  border-radius: 4px;
  padding: 5px;
}

.feedback-error-message {
  margin-bottom: 15px;
}

.feedback-error-message .alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  margin-bottom: 0;
}

.feedback-error-message .alert i {
  font-size: 18px;
}

/* Loading State */
.feedback-loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.feedback-loading i {
  font-size: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .feedback-rating-display {
    flex-wrap: wrap;
  }

  .feedback-star-rating {
    font-size: 24px;
  }

  .breakdown-label {
    min-width: 50px;
    font-size: 12px;
  }

  .moj-feedback-form .form-actions {
    flex-direction: column;
  }

  .moj-feedback-form .btn {
    width: 100%;
  }
}

.footer-section {
  margin-top: 0px !important;
}

/* Sticky Rating Section - Fixed at Bottom */
.feedback-sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-top: 2px solid #1b8354;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.feedback-sticky-bottom.hidden {
  transform: translateY(100%);
  opacity: 0;
}

.feedback-sticky-bottom .feedback-rating-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.feedback-rate-btn-sticky {
  margin-left: 15px;
}

/* Mobile responsive for sticky */
@media (max-width: 768px) {
  .feedback-sticky-bottom {
    padding: 10px 0;
  }

  .feedback-sticky-bottom .feedback-rating-display {
    font-size: 14px;
    gap: 10px;
  }

  .feedback-sticky-bottom .feedback-stars-display {
    font-size: 18px;
  }

  .feedback-rate-btn-sticky {
    padding: 8px 16px;
    font-size: 14px;
    margin-left: 0;
    width: 100%;
    margin-top: 10px;
  }
}
