/* ==========================================================================
   Company Reviews - Train & Hire
   Review listings, star ratings, category bars, form components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page Layout
   -------------------------------------------------------------------------- */

.rv-page {
  font-family: var(--th-font);
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.rv-page-header {
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--th-border);
  margin-bottom: 2rem;
}

.rv-page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.rv-company-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--th-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.rv-page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.rv-page-subtitle {
  font-size: 0.92rem;
  color: var(--th-text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 540px;
}

.rv-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--th-font);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--th-accent);
  border: 1.5px solid var(--th-accent);
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.rv-btn-primary:hover {
  background: var(--th-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
}

.rv-btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.rv-btn-primary svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.rv-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--th-text-secondary);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.15s ease;
}

.rv-back-link:hover {
  color: var(--th-accent);
}

.rv-back-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --------------------------------------------------------------------------
   Star Ratings - Display
   -------------------------------------------------------------------------- */

.rv-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rv-stars svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.rv-stars-lg svg {
  width: 22px;
  height: 22px;
}

.rv-star-filled {
  fill: #f59e0b;
  stroke: #f59e0b;
  stroke-width: 1;
}

.rv-star-half {
  fill: url(#rv-half-star-grad);
  stroke: #f59e0b;
  stroke-width: 1;
}

.rv-star-empty {
  fill: #e5e7eb;
  stroke: #d1d5db;
  stroke-width: 1;
}

.rv-rating-big {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rv-rating-number {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.04em;
  line-height: 1;
}

.rv-rating-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rv-rating-meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--th-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rv-rating-meta-count {
  font-size: 0.82rem;
  color: var(--th-text-secondary);
}

/* --------------------------------------------------------------------------
   Star Ratings - Interactive (form)
   -------------------------------------------------------------------------- */

.rv-star-input {
  display: flex;
  align-items: center;
  gap: 3px;
}

.rv-star-input-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  transition: transform 0.1s ease;
  line-height: 0;
}

.rv-star-input-btn:hover {
  transform: scale(1.15);
}

.rv-star-input-btn svg {
  width: 28px;
  height: 28px;
  transition: fill 0.1s ease, stroke 0.1s ease;
}

.rv-star-input-btn[data-state="filled"] svg {
  fill: #f59e0b;
  stroke: #f59e0b;
}

.rv-star-input-btn[data-state="empty"] svg {
  fill: #e5e7eb;
  stroke: #d1d5db;
}

.rv-star-input-btn[data-state="hover"] svg {
  fill: #fbbf24;
  stroke: #fbbf24;
}

.rv-star-input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f59e0b;
  margin-left: 0.5rem;
  min-width: 80px;
  transition: opacity 0.15s ease;
}

.rv-star-input-sm .rv-star-input-btn svg {
  width: 22px;
  height: 22px;
}

/* --------------------------------------------------------------------------
   Aggregate Ratings
   -------------------------------------------------------------------------- */

.rv-aggregate {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  padding: 1.75rem;
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.rv-aggregate-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 2rem;
  border-right: 1px solid var(--th-border-light);
  min-width: 160px;
}

.rv-aggregate-categories {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  justify-content: center;
}

.rv-category-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  align-items: center;
  gap: 0.75rem;
}

.rv-category-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--th-text-secondary);
  white-space: nowrap;
}

.rv-category-bar {
  height: 8px;
  background: #f0f1f3;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.rv-category-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rv-category-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--th-text);
  text-align: right;
}

.rv-category-na {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  text-align: right;
}

/* --------------------------------------------------------------------------
   Review Cards
   -------------------------------------------------------------------------- */

.rv-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rv-card {
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rv-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rv-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.rv-card-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rv-card-rating-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--th-text);
}

.rv-card-date {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  white-space: nowrap;
}

.rv-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--th-text);
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.rv-card-pros,
.rv-card-cons {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--th-text);
}

.rv-card-pros {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
}

.rv-card-cons {
  background: #fef2f2;
  border-left: 3px solid #ef4444;
}

.rv-card-pros-label,
.rv-card-cons-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.rv-card-pros .rv-card-pros-label {
  color: #16a34a;
}

.rv-card-cons .rv-card-cons-label {
  color: #dc2626;
}

.rv-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--th-border-light);
}

.rv-card-author {
  font-size: 0.78rem;
  color: var(--th-text-secondary);
  font-weight: 500;
}

.rv-card-author strong {
  font-weight: 700;
  color: var(--th-text);
}

/* --------------------------------------------------------------------------
   Review Response (inline)
   -------------------------------------------------------------------------- */

.rv-response {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  background: #f8fafc;
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  position: relative;
}

.rv-response::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: #f8fafc;
  border-left: 1px solid #e8ecf0;
  border-top: 1px solid #e8ecf0;
  transform: rotate(45deg);
}

.rv-response-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rv-response-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--th-accent);
  background: #eff6ff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.rv-response-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--th-text-secondary);
}

.rv-response-body {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--th-text);
}

/* Response form */
.rv-response-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f1f3;
}

.rv-response-form-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--th-text-secondary);
  margin-bottom: 0.5rem;
}

.rv-response-form textarea {
  font-family: var(--th-font);
  font-size: 0.85rem;
  width: 100%;
  border: 1.5px solid var(--th-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: #fff;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rv-response-form textarea:focus {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  outline: none;
}

.rv-response-form-hint {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  margin-top: 0.35rem;
  line-height: 1.5;
}

.rv-response-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

/* --------------------------------------------------------------------------
   Review Form Page
   -------------------------------------------------------------------------- */

.rv-form {
  max-width: 620px;
}

.rv-form-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #f0f1f3;
}

.rv-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rv-form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--th-text-secondary);
  margin-bottom: 1rem;
}

.rv-field {
  margin-bottom: 1.25rem;
}

.rv-field:last-child {
  margin-bottom: 0;
}

.rv-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--th-text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.005em;
}

.rv-field-help {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  margin-top: 0.2rem;
  line-height: 1.45;
}

.rv-field input[type="text"],
.rv-field textarea {
  font-family: var(--th-font);
  font-size: 0.85rem;
  width: 100%;
  border: 1.5px solid var(--th-border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  background: #f9fafb;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rv-field input[type="text"]:focus,
.rv-field textarea:focus {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background: #fff;
  outline: none;
}

.rv-field textarea {
  resize: vertical;
  min-height: 100px;
}

.rv-field-pros textarea {
  border-left: 3px solid #22c55e;
}

.rv-field-cons textarea {
  border-left: 3px solid #ef4444;
}

/* Rating field */
.rv-rating-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rv-rating-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rv-rating-field-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--th-text);
}

/* Anonymous toggle */
.rv-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: #f8fafc;
  border: 1.5px solid var(--th-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.rv-toggle:hover {
  border-color: #c9cdd3;
}

.rv-toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.rv-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.rv-toggle-track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 11px;
  transition: background 0.2s ease;
}

.rv-toggle-switch input:checked + .rv-toggle-track {
  background: var(--th-accent);
}

.rv-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.rv-toggle-switch input:checked + .rv-toggle-track::after {
  transform: translateX(18px);
}

.rv-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rv-toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--th-text);
}

.rv-toggle-desc {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  line-height: 1.45;
}

/* Form actions */
.rv-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--th-border);
  margin-top: 1.75rem;
}

.rv-form-actions a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--th-text-secondary);
  text-decoration: none;
}

.rv-form-actions a:hover {
  color: var(--th-text);
}

/* Form errors */
.rv-form-errors {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.rv-form-errors-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 0.35rem;
}

.rv-form-errors ul {
  margin: 0;
  padding: 0 0 0 1rem;
  font-size: 0.78rem;
  color: #b91c1c;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */

.rv-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--th-bg-card);
  border: 1.5px dashed var(--th-border);
  border-radius: 12px;
}

.rv-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--th-text-muted);
}

.rv-empty-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.rv-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--th-text);
  margin: 0 0 0.35rem;
}

.rv-empty-message {
  font-size: 0.85rem;
  color: var(--th-text-secondary);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Company Show - Reviews Summary Card
   -------------------------------------------------------------------------- */

.rv-summary-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.rv-summary-score {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rv-summary-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.rv-summary-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rv-summary-count {
  font-size: 0.78rem;
  color: var(--th-text-secondary);
}

.rv-summary-categories {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  flex: 1;
}

.rv-summary-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.rv-summary-cat-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--th-text);
}

.rv-summary-cat-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--th-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Job Card - Inline Rating
   -------------------------------------------------------------------------- */

.rv-inline-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 0.4rem;
}

.rv-inline-rating svg {
  width: 11px;
  height: 11px;
  fill: #f59e0b;
  stroke: none;
  flex-shrink: 0;
}

.rv-inline-rating-value {
  font-size: 0.72rem;
  font-weight: 700;
  color: #92400e;
}

/* --------------------------------------------------------------------------
   Admin - Status Badges (supplement existing co-badge)
   -------------------------------------------------------------------------- */

.co-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.co-badge-published {
  background: #d1fae5;
  color: #065f46;
}

.co-badge-flagged {
  background: #fee2e2;
  color: #991b1b;
}

/* --------------------------------------------------------------------------
   Admin Review Detail
   -------------------------------------------------------------------------- */

.rv-admin-detail {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: start;
}

.rv-admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rv-admin-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rv-admin-actions form {
  display: contents;
}

.rv-admin-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  font-family: var(--th-font);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1.5px solid;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  text-align: center;
}

.rv-admin-action-btn:hover {
  transform: translateY(-1px);
}

.rv-admin-action-btn:active {
  transform: translateY(0);
}

.rv-admin-action-publish {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.rv-admin-action-publish:hover {
  background: #bbf7d0;
}

.rv-admin-action-flag {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.rv-admin-action-flag:hover {
  background: #fde68a;
}

.rv-admin-action-remove {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.rv-admin-action-remove:hover {
  background: #fecaca;
}

/* --------------------------------------------------------------------------
   Filter Tabs (admin)
   -------------------------------------------------------------------------- */

.rv-filter-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--th-border-light);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.rv-filter-tab {
  font-family: var(--th-font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--th-text-secondary);
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.rv-filter-tab:hover {
  color: var(--th-text);
  background: #e5e7eb;
}

.rv-filter-tab-active {
  color: var(--th-text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .rv-page {
    padding: 0 1rem 2rem;
  }

  .rv-aggregate {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .rv-aggregate-overall {
    border-right: none;
    border-bottom: 1px solid var(--th-border-light);
    padding-right: 0;
    padding-bottom: 1.25rem;
    flex-direction: row;
    gap: 1rem;
  }

  .rv-category-row {
    grid-template-columns: 100px 1fr 32px;
    gap: 0.5rem;
  }

  .rv-category-label {
    font-size: 0.72rem;
  }

  .rv-page-header-top {
    flex-direction: column;
    gap: 0.75rem;
  }

  .rv-admin-detail {
    grid-template-columns: 1fr;
  }

  .rv-summary-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
