/* ==========================================================================
   VakhifyDigital — Phase 3: Client reviews (public) + admin dashboard UI
   ========================================================================== */

/* ---------- Public review grid ---------- */
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.review-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 28px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.review-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.review-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.review-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  flex: none;
}
.review-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--navy-800), var(--navy-600));
  color: var(--yellow-400);
  font-weight: 700;
  font-size: 1.1rem;
  flex: none;
}
.review-who { min-width: 0; }
.review-who h3 { font-size: 1.03rem; }
.review-date { font-size: 0.79rem; color: var(--muted); }

.stars { display: inline-flex; gap: 3px; color: var(--orange-500); }
.stars svg { display: block; }

.review-msg { font-size: 0.95rem; color: var(--body); }

/* Empty state */
.review-empty {
  grid-column: 1 / -1;
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(36px, 5vw, 56px) 28px;
  text-align: center;
  background: var(--bg-soft);
  border: 1px dashed #cdd8e6;
  border-radius: var(--radius-lg);
}
.review-empty h3 { font-size: 1.2rem; margin-bottom: 8px; }
.review-empty p { color: var(--muted); margin-inline: auto; }

/* ---------- Review form ---------- */
.review-form-wrap {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(26px, 4vw, 42px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.field { margin-bottom: 22px; }
.field > label,
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.field-label .req,
.field > label .req { color: var(--orange-600); }
.field-hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #d5deea;
  border-radius: var(--radius-sm);
  background: #fbfdff;
  font: inherit;
  font-size: 0.97rem;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input[type="text"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #dc2626; }

.field-error {
  display: none;
  margin-top: 7px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #dc2626;
}
.field-error.show { display: block; }

/* Star rating input */
.rating-field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; }
.rating-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.rating-input label {
  cursor: pointer;
  color: #d7dfeb;
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
  line-height: 0;
}
.rating-input label svg { width: 32px; height: 32px; }
.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label { color: var(--orange-500); }
.rating-input input:focus-visible + label {
  outline: 3px solid var(--orange-500);
  outline-offset: 3px;
  border-radius: 8px;
}
.rating-input:hover { transform: translateX(0); }

/* File input */
.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.file-row input[type="file"] {
  font-size: 0.87rem;
  color: var(--muted);
  max-width: 100%;
}
.file-row input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 9px 16px;
  border: 1px solid #d5deea;
  border-radius: var(--pill);
  background: var(--bg-soft);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-note {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 46ch;
}

/* Thank-you panel */
.review-success {
  display: none;
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(34px, 5vw, 52px) 30px;
  text-align: center;
  background: linear-gradient(165deg, #ffffff, #f5fbf7);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.review-success.show { display: block; }
.success-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.review-success h3 { font-size: 1.35rem; margin-bottom: 10px; }
.review-success p { color: var(--body); margin-inline: auto; margin-bottom: 10px; }
.success-note {
  font-size: 0.84rem;
  color: var(--muted) !important;
  background: var(--bg-soft);
  border: 1px dashed #cdd8e6;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-top: 18px !important;
}

/* Hero button area for reviews page */
.reviews-hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* ---------- Admin dashboard ---------- */
.admin-shell { max-width: 1080px; margin-inline: auto; padding: 40px 24px 72px; }
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.admin-top h1,
.admin-top h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 4px; }
.admin-top .back-link { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.admin-top .back-link:hover { color: var(--orange-600); }

.admin-warning {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 30px;
  background: rgba(255, 197, 61, 0.12);
  border: 1px solid rgba(234, 156, 41, 0.5);
  border-radius: var(--radius-md);
  font-size: 0.89rem;
  color: var(--body);
}
.admin-warning strong { color: var(--ink); }

/* Gate */
.admin-gate {
  max-width: 460px;
  margin: clamp(30px, 8vh, 90px) auto;
  padding: 36px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.admin-gate h1 { font-size: 1.4rem; margin-bottom: 10px; }
.admin-gate > p { color: var(--muted); font-size: 0.93rem; margin-bottom: 22px; }
.admin-gate .field { text-align: left; }
.admin-gate .btn { width: 100%; }
.gate-note {
  margin-top: 18px;
  padding: 13px 15px;
  background: var(--bg-soft);
  border: 1px dashed #cdd8e6;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: left;
}
.gate-note strong { color: var(--ink); }

.admin-panel { display: none; }
.admin-panel.show { display: block; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.admin-stat {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.admin-stat span {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.admin-stat strong { font-size: 1.7rem; color: var(--ink); }
.admin-stat.pending strong { color: var(--orange-600); }
.admin-stat.approved strong { color: #059669; }
.admin-stat.rejected strong { color: #dc2626; }

.admin-section-title {
  font-size: 1.05rem;
  margin: 30px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.admin-list { display: grid; gap: 16px; }

.admin-review {
  display: flex;
  gap: 18px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange-500);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.admin-review.st-approved { border-left-color: #10b981; }
.admin-review.st-rejected { border-left-color: #dc2626; }

.admin-review-main { flex: 1; min-width: 240px; }
.admin-review-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.admin-review-head h3 { font-size: 1rem; }
.admin-status {
  padding: 3px 11px;
  border-radius: var(--pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-status.pending { background: rgba(249, 115, 22, 0.14); color: var(--orange-600); }
.admin-status.approved { background: rgba(16, 185, 129, 0.14); color: #047857; }
.admin-status.rejected { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.admin-meta { font-size: 0.79rem; color: var(--muted); margin-bottom: 8px; }
.admin-review-msg { font-size: 0.93rem; color: var(--body); margin-bottom: 6px; }
.admin-photo {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}
.admin-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-actions .btn-sm { min-width: 104px; }
.btn-approve {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.28);
}
.btn-reject {
  background: #fff;
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #dc2626;
}
.btn-reject:hover { background: rgba(220, 38, 38, 0.06); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.admin-empty {
  padding: 34px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px dashed #cdd8e6;
  border-radius: var(--radius-md);
  font-size: 0.93rem;
}
.admin-empty strong { color: var(--ink); }

/* ---------- Reviews responsive ---------- */
@media (max-width: 1024px) {
  .review-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .review-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-review { flex-direction: column; }
}
@media (max-width: 640px) {
  .reviews-hero-actions .btn { width: 100%; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
}
