/* reviews page */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.9;
  margin-bottom: 1.1rem;
  display: none;
}

.auth-alert.show { display: block; }
.auth-alert.error { background: rgba(255, 62, 100, 0.12); border: 1px solid rgba(255, 62, 100, 0.35); color: #ff9db1; }
.auth-alert.success { background: rgba(34, 201, 138, 0.12); border: 1px solid rgba(34, 201, 138, 0.32); color: #6ee7b0; }
/* light theme */
body.light-theme .auth-alert.error { color: #c62a4c; }
body.light-theme .auth-alert.success { color: #14875c; }

/* review summary */
.review-summary {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  padding: 1.5rem 1.8rem;
  border-radius: 22px;
  background: rgba(18, 18, 32, 0.86);
  border: 1px solid rgba(124, 92, 255, 0.18);
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

body.light-theme .review-summary {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(16, 24, 48, 0.09);
}

.summary-score { text-align: center; flex-shrink: 0; }

/* summary score */
.summary-score strong {
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffb84c, #ff7a45);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.summary-score span { font-size: 0.75rem; opacity: 0.6; }
.summary-stars { display: flex; gap: 3px; justify-content: center; margin: 0.3rem 0; }
.summary-stars .icon { width: 1rem; height: 1rem; color: #3a3a52; }
body.light-theme .summary-stars .icon { color: #9aa2bb; }
body.light-theme .summary-stars .icon.on { color: #e08a00; }
.summary-stars .icon.on { color: #ffb84c; }

.summary-bars { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 5px; }

/* summary row */
.summary-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  opacity: 0.75;
}

.summary-row .track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

body.light-theme .summary-row .track { background: rgba(16, 24, 48, 0.09); }

.summary-row .fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb84c, #ff7a45);
}

/* review form */
.review-form-card .card-sub {
  font-size: 0.78rem;
  opacity: 0.62;
  margin-bottom: 1.1rem;
}

/* rating picker */
.rating-picker {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

/* star btn */
.star-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: #3a3a52;
  transition: transform 0.16s ease, color 0.16s ease;
}

body.light-theme .star-btn { color: #9aa2bb; }
body.light-theme .star-btn.on { color: #e08a00; }
.star-btn:hover { transform: scale(1.12); }
.star-btn.on { color: #ffb84c; }
.star-btn svg { width: 100%; height: 100%; fill: currentColor; }

.rating-label { font-size: 0.76rem; opacity: 0.62; margin-right: 0.6rem; }

.field { margin-bottom: 1rem; }

/* field */
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-family: inherit;
  font-size: 0.87rem;
  line-height: 2;
  resize: vertical;
  min-height: 110px;
}

body.light-theme .field textarea {
  border-color: rgba(16, 24, 48, 0.14);
  background: rgba(16, 24, 48, 0.03);
}

.field textarea:focus {
  outline: none;
  border-color: #7c5cff;
  background: rgba(124, 92, 255, 0.07);
}

.field-hint { font-size: 0.7rem; opacity: 0.55; margin-top: 0.4rem; }

.review-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.review-actions .btn { flex: 1; min-width: 150px; }

/* btn */
.btn {
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #7c5cff, #00d4ff);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* cancel edit */
.btn.ghost {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  color: inherit;
  box-shadow: none;
  flex: 0 0 auto;
  min-width: 150px;
}

.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.btn.ghost[hidden] { display: none; }

body.light-theme .btn.ghost {
  background: rgba(18, 22, 48, .05);
  border-color: rgba(18, 22, 48, .13);
}

/* btn ghost */
.btn-ghost {
  background: none;
  border: 1px solid rgba(255, 107, 138, 0.4);
  color: #ff8fa6;
  flex: 0 0 auto;
}

body.light-theme .btn-ghost { color: #c62a4c; }

/* spinner */
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: revSpin 0.65s linear infinite;
  display: none;
}

.btn.loading .spinner { display: block; }
@keyframes revSpin { to { transform: rotate(360deg); } }

.review-list { display: flex; flex-direction: column; gap: 0.9rem; }

/* review item */
.review-item {
  padding: 1.2rem 1.4rem;
  border-radius: 18px;
  background: rgba(18, 18, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

body.light-theme .review-item {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(16, 24, 48, 0.08);
}

/* review head */
.review-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

/* review avatar */
.review-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #00d4ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.review-who { flex: 1; min-width: 0; }
.review-who strong { display: block; font-size: 0.85rem; font-weight: 700; }
.review-who small { font-size: 0.68rem; opacity: 0.55; }

.review-stars { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* score in digits next to the stars */
.review-score {
  margin-inline-start: .35rem;
  font-size: .72rem;
  font-weight: 700;
  color: #ffb84c;
  white-space: nowrap;
}

body.light-theme .review-score { color: #b36b00; }
.review-stars .icon { width: 0.85rem; height: 0.85rem; color: #3a3a52; }
body.light-theme .review-stars .icon { color: #9aa2bb; }
body.light-theme .review-stars .icon.on { color: #e08a00; }
.review-stars .icon.on { color: #ffb84c; }

.review-body { font-size: 0.85rem; line-height: 2.05; opacity: 0.85; white-space: pre-wrap; word-break: break-word; }

/* review mine */
.review-mine-badge {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.2);
  color: #b8a8ff;
}

body.light-theme .review-mine-badge { background: rgba(106, 75, 255, 0.13); color: #4a34b8; }

.review-empty { text-align: center; padding: 2.5rem 1rem; font-size: 0.85rem; opacity: 0.5; }

/* mobile 640px */
@media (max-width: 640px) {
  .review-summary { padding: 1.2rem; gap: 1.1rem; }
  .summary-score strong { font-size: 2.1rem; }
  .star-btn { width: 36px; height: 36px; }
  .rating-label { width: 100%; margin: 0.3rem 0 0; }
  .review-actions .btn { min-width: 100%; }
}

/* review item */
.review-item.pinned {
  border-color: rgba(124, 92, 255, .4);
  background: rgba(124, 92, 255, .07);
}

.review-badge.pinned { background: linear-gradient(135deg, #7c5cff, #00d4ff); color: #fff; }

/* review reply */
.review-reply {
  margin-top: .8rem;
  padding: .7rem .9rem;
  border-radius: 0 12px 12px 0;
  border-inline-start: 3px solid #7c5cff;
  background: rgba(124, 92, 255, .11);
}

/* reply head */
.reply-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .45rem;
  flex-wrap: wrap;
}

/* logo avatar, same circle as the author */
.reply-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(124, 92, 255, .45);
  background: radial-gradient(circle at 35% 30%, rgba(124, 92, 255, .35), rgba(0, 212, 255, .18));
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .12);
}

.reply-avatar img { width: 22px; height: 22px; display: block; }

.review-reply strong {
  font-size: .78rem;
  font-weight: 700;
  color: #a894ff;
}

.reply-head small { font-size: .7rem; color: #8b93a5; }

.review-reply .icon { width: .8rem; height: .8rem; }

.review-reply p {
  font-size: .84rem;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* review votes */
.review-votes {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .8rem;
  flex-wrap: wrap;
}

/* vote btn */
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  color: inherit;
  font-family: inherit;
  font-size: .76rem;
  border-radius: 999px;
  padding: .3rem .75rem;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.vote-btn .icon { width: 1rem; height: 1rem; }
.vote-btn .vote-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.vote-btn:hover { border-color: rgba(124, 92, 255, .5); transform: translateY(-1px); }
.vote-btn:active { transform: translateY(0); }
.vote-btn.up.on { color: #052e1a; background: linear-gradient(135deg, #4ade80, #22c55e); border-color: transparent; }
.vote-btn.down.on { color: #fff; background: linear-gradient(135deg, #ff5f6d, #ff2d55); border-color: transparent; }


body.light-theme .review-reply { background: rgba(91, 61, 240, .09); }
body.light-theme .reply-avatar {
  border-color: rgba(91, 61, 240, .3);
  background: radial-gradient(circle at 35% 30%, rgba(91, 61, 240, .18), rgba(0, 131, 200, .1));
  box-shadow: 0 0 0 3px rgba(91, 61, 240, .08);
}
body.light-theme .reply-head small { color: #6b7290; }
body.light-theme .review-reply strong { color: #5b3df0; }

/* vote btn */
body.light-theme .vote-btn {
  border-color: rgba(18, 22, 48, .13);
  background: rgba(18, 22, 48, .04);
}

body.light-theme .review-item.pinned { background: rgba(91, 61, 240, .07); }

/* admin review */
.review-item.from-admin {
  border-color: rgba(0, 212, 255, .48);
  background:
    linear-gradient(135deg, rgba(0, 212, 255, .12), rgba(124, 92, 255, .09)),
    rgba(18, 18, 32, .8);
  box-shadow: 0 10px 34px rgba(0, 140, 200, .16);
}

.review-item.from-admin::before {
  content: "";
  display: block;
  height: 3px;
  margin: -1.2rem -1.4rem .9rem;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #00d4ff, #7c5cff);
}

/* review avatar */
.review-avatar.admin {
  background: linear-gradient(135deg, #00d4ff, #0ea5e9);
  font-size: .95rem;
}

/* review badge */
.review-badge.admin {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: #04212b;
  background: linear-gradient(135deg, #00d4ff, #38bdf8);
}

.review-badge.admin .icon { width: .7rem; height: .7rem; }

/* review item */
body.light-theme .review-item.from-admin {
  background:
    linear-gradient(135deg, rgba(0, 160, 220, .12), rgba(91, 61, 240, .08)),
    rgba(255, 255, 255, .95);
  border-color: rgba(0, 160, 220, .4);
}

/* admin tools */
.review-admin-tools {
  display: inline-flex;
  gap: .4rem;
  margin-inline-start: auto;
  flex-wrap: wrap;
}

/* review tool */
.review-tool {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px dashed rgba(255, 255, 255, .2);
  background: transparent;
  color: #9aa3b8;
  font-family: inherit;
  font-size: .73rem;
  border-radius: 999px;
  padding: .3rem .7rem;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.review-tool .icon { width: .72rem; height: .72rem; }
.review-tool:hover { color: #cdd4e6; border-color: rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .05); }
.review-tool.danger:hover { color: #ff8a97; border-color: rgba(255, 95, 122, .5); background: rgba(255, 95, 122, .1); }

body.light-theme .review-tool { color: #6b7290; border-color: rgba(18, 22, 48, .18); }
body.light-theme .review-tool:hover { color: #1b2039; border-color: rgba(18, 22, 48, .35); background: rgba(18, 22, 48, .04); }

/* mobile 520px */
@media (max-width: 520px) {
  .review-admin-tools { margin-inline-start: 0; width: 100%; }
  .review-tool { flex: 1; justify-content: center; }
}
