/**
 * Trip Rating Form Styles
 * Used on lookup page and route view page
 */

.ota-rating-form-section {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgb(var(--border));
  border-radius: 12px;
  background: rgb(var(--background));
}

.ota-rating-form-title {
  font-size: 18px;
  font-weight: 600;
  color: rgb(var(--foreground));
  margin: 0 0 8px;
}

.ota-rating-form-description {
  font-size: 14px;
  color: rgb(var(--muted));
  margin: 0 0 20px;
  line-height: 1.5;
}

.ota-rating-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ota-rating-form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: rgb(var(--foreground));
  margin-bottom: 6px;
}

.ota-rating-required {
  color: rgb(var(--danger));
}

.ota-rating-input {
  width: 100%;
  max-width: 280px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  font-size: 15px;
  color: rgb(var(--foreground));
  background: rgb(var(--background));
  box-sizing: border-box;
}

.ota-rating-input:focus {
  outline: none;
  border-color: rgb(var(--primary));
  box-shadow: 0 0 0 3px rgba(var(--primary) / 0.1);
}

.ota-rating-input[readonly] {
  background: rgba(var(--muted) / 0.15);
  cursor: default;
}

.ota-rating-stars {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.ota-rating-star-label {
  cursor: pointer;
  padding: 4px;
  margin: 0;
}

.ota-rating-star-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Sao đánh giá: mặc định outline, khi chọn fill màu --primary */
.ota-rating-star-label .ota-rating-star,
.ota-rating-star-label svg.ota-rating-star {
  display: inline-block;
  width: 28px;
  height: 28px;
  color: rgba(var(--muted) / 0.5);
  fill: transparent;
  stroke: currentColor;
  transition: color 0.2s ease, fill 0.2s ease;
}

.ota-rating-star-label:hover .ota-rating-star,
.ota-rating-star-label:hover svg.ota-rating-star,
.ota-rating-star-label:focus-within .ota-rating-star,
.ota-rating-star-label:focus-within svg.ota-rating-star {
  color: rgb(var(--primary));
  fill: rgb(var(--primary));
}

/* Khi đã chọn: fill từ sao 1 đến sao được chọn bằng --primary */
.ota-rating-stars[data-rating="1"] .ota-rating-star-label:nth-child(1) .ota-rating-star,
.ota-rating-stars[data-rating="1"] .ota-rating-star-label:nth-child(1) svg.ota-rating-star,
.ota-rating-stars[data-rating="2"] .ota-rating-star-label:nth-child(-n+2) .ota-rating-star,
.ota-rating-stars[data-rating="2"] .ota-rating-star-label:nth-child(-n+2) svg.ota-rating-star,
.ota-rating-stars[data-rating="3"] .ota-rating-star-label:nth-child(-n+3) .ota-rating-star,
.ota-rating-stars[data-rating="3"] .ota-rating-star-label:nth-child(-n+3) svg.ota-rating-star,
.ota-rating-stars[data-rating="4"] .ota-rating-star-label:nth-child(-n+4) .ota-rating-star,
.ota-rating-stars[data-rating="4"] .ota-rating-star-label:nth-child(-n+4) svg.ota-rating-star,
.ota-rating-stars[data-rating="5"] .ota-rating-star-label:nth-child(-n+5) .ota-rating-star,
.ota-rating-stars[data-rating="5"] .ota-rating-star-label:nth-child(-n+5) svg.ota-rating-star {
  color: rgb(var(--primary));
  fill: rgb(var(--primary));
}

.ota-rating-comment {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: rgb(var(--foreground));
  background: rgb(var(--background));
  resize: vertical;
  box-sizing: border-box;
}

.ota-rating-comment:focus {
  outline: none;
  border-color: rgb(var(--primary));
  box-shadow: 0 0 0 3px rgba(var(--primary) / 0.1);
}

.ota-rating-form-actions {
  margin-top: 4px;
}

.ota-rating-submit {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: rgb(var(--primary-foreground));
  background: rgb(var(--primary));
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.ota-rating-submit:hover {
  opacity: 0.9;
}

.ota-rating-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ota-rating-message {
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 4px;
}

.ota-rating-message--success {
  background: rgba(var(--success) / 0.15);
  color: rgb(var(--success));
  border: 1px solid rgba(var(--success) / 0.3);
}

.ota-rating-message--error {
  background: rgba(var(--danger) / 0.15);
  color: rgb(var(--danger));
  border: 1px solid rgba(var(--danger) / 0.3);
}

/* Context-specific: inside lookup detail card */
.ota-lookup-rating-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgb(var(--border));
}

.ota-lookup-rating-form .ota-rating-form-section {
  margin-top: 0;
}

/* Context-specific: inside route view */
.ota-route-rating-form {
  margin-top: 32px;
}

.ota-route-rating-form .ota-rating-form-section {
  background: rgba(var(--primary) / 0.04);
  border-color: rgba(var(--primary) / 0.2);
}
