/* WPS Review Engine — Frontend CSS
 * Neutral, theme-friendly styles. Can be overridden per site.
 */

.wpsr {
  max-width: 100%;
  box-sizing: border-box;
}

.wpsr * {
  box-sizing: border-box;
}

.wpsr-block,
.wpsr-hub {
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #ffffff 0%, #fff9e8 100%);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

.wpsr-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.wpsr-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.wpsr-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.wpsr-summary-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
}

.wpsr-avg {
  font-size: 22px;
  line-height: 1;
}

.wpsr-outof {
  opacity: 0.7;
  font-size: 14px;
}

.wpsr-summary-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.wpsr-stars {
  letter-spacing: 1px;
  font-size: 16px;
  line-height: 1;
  opacity: 0.95;
  user-select: none;
  color: #f5a623; /* gold */
  text-shadow: 0 0 1px rgba(0,0,0,0.25);
}

.wpsr-item-stars {
  font-size: 14px;
  opacity: 0.95;
  color: #f5a623; /* gold */
  text-shadow: 0 0 1px rgba(0,0,0,0.25);
}

/* Controls */
.wpsr-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.wpsr-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.wpsr-sort-label {
  opacity: 0.7;
}

.wpsr-sort-link {
  text-decoration: none;
  border: 1px solid rgba(0,0,0,0.10);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.wpsr-sort-link.is-active {
  font-weight: 700;
}

/* Buttons */
.wpsr-btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wpsr-btn:focus {
  outline: 2px solid rgba(0,0,0,0.25);
  outline-offset: 2px;
}

.wpsr-btn-primary {
  background: rgba(0,0,0,0.90);
  color: #fff;
  border-color: rgba(0,0,0,0.90);
}

.wpsr-btn-ghost {
  background: transparent;
}

/* Inline notices (AJAX / POST feedback) */
.wpsr-notice {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.wpsr-notice-success {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.wpsr-notice-error {
  background: rgba(255, 0, 0, 0.06);
  border: 1px solid rgba(255, 0, 0, 0.20);
}

/* Form */
.wpsr-form {
  margin: 12px 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
}

.wpsr-field {
  margin-bottom: 10px;
}

.wpsr-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  opacity: 0.85;
}

.wpsr-field input,
.wpsr-field select,
.wpsr-field textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.2;
  background: #fff;
}

.wpsr-field textarea {
  resize: vertical;
  min-height: 90px;
}

.wpsr-field-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wpsr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.wpsr-note {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: 0.75;
}

/* List */
.wpsr-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.wpsr-item {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.wpsr-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.wpsr-item-stars {
  font-size: 14px;
  opacity: 0.9;
}

.wpsr-item-country {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85em;
  opacity: 0.85;
}

.wpsr-item-flag {
  font-size: 1.1em;
}

.wpsr-item-country {
  font-size: 12px;
  opacity: 0.85;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.03);
}

.wpsr-item-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  opacity: 0.75;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wpsr-item-title {
  margin: 6px 0 6px;
  font-size: 15px;
  line-height: 1.25;
}

.wpsr-item-body p {
  margin: 0 0 8px;
}

.wpsr-item-body p:last-child {
  margin-bottom: 0;
}

.wpsr-empty {
  padding: 10px 0;
  opacity: 0.85;
}

/* Helpful footer */
.wpsr-item-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #111;          /* make sure text is dark */
  opacity: 0.95;
}

.wpsr-helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #fef3c7;          /* light amber */
  color: #92400e;               /* dark amber text */
  cursor: pointer;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

/* optional: add a small icon without changing HTML */
.wpsr-helpful-btn::before {
  content: "👍";
  font-size: 13px;
}

.wpsr-helpful-btn:hover:not(.is-disabled):not([disabled]),
.wpsr-helpful-btn:focus-visible:not(.is-disabled):not([disabled]) {
  background: #fbbf24;          /* stronger amber on hover */
  color: #111;
  border-color: rgba(0,0,0,0.2);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
  outline: none;
}

.wpsr-helpful-btn.is-disabled,
.wpsr-helpful-btn[disabled] {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.wpsr-helpful-count {
  font-size: 12px;
  opacity: 0.9;
  color: #374151;              /* readable grey */
}


/* Pagination */
.wpsr-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.wpsr-page-link {
  text-decoration: none;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
}

.wpsr-page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.wpsr-page-status {
  font-size: 13px;
  opacity: 0.75;
}

/* Hub */
.wpsr-hub-head {
  margin-bottom: 10px;
}

.wpsr-hub-title {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.15;
}

.wpsr-hub-subtitle {
  margin: 0;
  opacity: 0.75;
  font-size: 14px;
}

.wpsr-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.wpsr-tab {
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.wpsr-tab.is-active {
  background: rgba(0,0,0,0.90);
  color: #fff;
  border-color: rgba(0,0,0,0.90);
}

.wpsr-panels {
  margin-top: 6px;
}

.wpsr-panel.is-active {
  display: block;
}

.wpsr-hub-card {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.wpsr-hub-tool {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.2;
}

.wpsr-hub-tool a {
  text-decoration: none;
}

.wpsr-hub-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.wpsr-hub-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
}

.wpsr-hub-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wpsr-hub-actions {
  margin-top: 6px;
}

.wpsr-hub-note {
  margin: 0;
  font-size: 13px;
  opacity: 0.75;
}

/* Hub – ensure readable tab and CTA colors */
.wpsr-tabs .wpsr-tab {
  color: rgba(15, 23, 42, 0.9);
}

.wpsr-tabs .wpsr-tab:hover {
  color: #111;
}

.wpsr-tabs .wpsr-tab.is-active {
  background: rgba(0,0,0,0.90);
  color: #fff;
  border-color: rgba(0,0,0,0.90);
}

.wpsr-hub-tool a {
  color: #111;
}

.wpsr-hub-tool a:hover,
.wpsr-hub-tool a:focus {
  color: #111;
  text-decoration: underline;
}

.wpsr-btn-primary,
.wpsr-btn-primary:hover,
.wpsr-btn-primary:focus {
  color: #fff;
  background: rgba(0,0,0,0.90);
  border-color: rgba(0,0,0,0.90);
}

/* Responsive */
@media (max-width: 700px) {
  .wpsr-head {
    flex-direction: column;
    align-items: stretch;
  }
  .wpsr-summary {
    justify-content: flex-start;
  }
  .wpsr-field-split {
    grid-template-columns: 1fr;
  }
  .wpsr-hub-card {
    grid-template-columns: 1fr;
  }
}
