/* Lesson rating card, "Xato topdim" button and form, report notices (public/js/feedback.js).
   Uses the tokens from style.css (--gold, --card-border, --line, --muted, --radius, --serif). */

/* ---------- Floating "Xato topdim" button ---------- */
.fb-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px 8px 11px; border-radius: 999px;
  font: 500 13px var(--sans); color: var(--muted); cursor: pointer;
  background: rgba(16, 15, 19, 0.88); border: 1px solid var(--card-border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: color .2s, border-color .2s;
}
.fb-fab:hover, .fb-fab:focus-visible { color: var(--gold); border-color: var(--gold); outline: none; }
.fb-fab .icon { display: inline-flex; width: 16px; height: 16px; color: var(--gold); }
.fb-fab .icon svg { width: 100%; height: 100%; }
/* In a lesson the bottom belongs to the mic and answer controls. */
.fb-fab.fb-top { top: 18px; bottom: auto; }

/* ---------- Dialogs ---------- */
.fb-layer {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, 0); transition: background .18s;
}
.fb-layer.open { background: rgba(0, 0, 0, 0.62); }
.fb-dialog {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 24px 22px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, #16151a, #0f0e12); border: 1px solid var(--card-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(214, 178, 102, 0.04);
  opacity: 0; transform: translateY(12px); transition: opacity .18s, transform .18s;
}
.fb-layer.open .fb-dialog { opacity: 1; transform: none; }
.fb-dialog h2 { margin: 0 0 4px; font-size: 28px; }
.fb-dialog .eyebrow { margin-bottom: 6px; }
.fb-sub { margin: 0 0 14px; }
.fb-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; justify-content: center; align-items: center; font-size: 22px; line-height: 1; }

.fb-form { display: grid; gap: 14px; margin-top: 6px; }
.fb-stars { display: flex; justify-content: center; gap: 6px; }
.fb-star {
  width: 48px; height: 48px; border-radius: 12px; cursor: pointer;
  font-size: 30px; line-height: 1; color: rgba(255, 255, 255, 0.16);
  background: transparent; border: 1px solid transparent; transition: color .15s, transform .15s;
}
.fb-star:hover, .fb-star:focus-visible { transform: scale(1.08); color: rgba(214, 178, 102, 0.55); outline: none; border-color: var(--line); }
.fb-star.on { color: var(--gold); text-shadow: 0 0 16px var(--gold-glow); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { padding: 7px 13px; }
.fb-text {
  width: 100%; resize: vertical; min-height: 64px;
  font: 14.5px/1.5 var(--sans); color: var(--text);
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none;
}
.fb-text:focus { border-color: var(--gold); }
.fb-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: -6px; }
.fb-context { min-width: 0; overflow-wrap: anywhere; }
.fb-meta > span:last-child { flex: none; }
.fb-error { margin: 0; color: var(--danger); font-size: 13.5px; }
.fb-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-actions .fb-report-link { margin-right: auto; font-size: 13.5px; }
.fb-actions .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Notice: a report was accepted / fixed ---------- */
.fb-notice {
  position: fixed; left: 50%; top: 20px; z-index: 55; /* under an open dialog */ transform: translate(-50%, -16px);
  display: flex; align-items: flex-start; gap: 12px; width: max-content; max-width: min(440px, calc(100vw - 32px));
  padding: 14px 12px 14px 16px; border-radius: 14px;
  background: #17161a; border: 1px solid var(--gold); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(214, 178, 102, 0.12);
  opacity: 0; transition: opacity .25s, transform .25s;
}
.fb-notice.show { opacity: 1; transform: translate(-50%, 0); }
.fb-notice p { margin: 0; }
.fb-notice p + p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.fb-notice-mark { color: var(--gold); font-size: 18px; line-height: 1.4; text-shadow: 0 0 12px var(--gold-glow); }
.fb-notice .icon-btn { font-size: 20px; line-height: 1; padding: 0 4px; }

@media (max-width: 760px) {
  /* Above the bottom bar; in a lesson, just under the top bar on the right. */
  /* A round icon button on a phone, so it hides as little of the list as possible; the page gets
     room at the bottom so its last item can scroll clear of it. */
  .fb-fab { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 44px; height: 44px; padding: 0; justify-content: center; }
  .fb-fab > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fb-fab .icon { width: 18px; height: 18px; }
  #view[data-page="darslar"] > .page { padding-bottom: 84px; }
  /* In a lesson it sits in the top bar, left of the profile initial, so it never covers the
     lesson header, the phrases or the conversation. */
  .fb-fab.fb-top { top: calc(6px + env(safe-area-inset-top)); right: 56px; bottom: auto; box-shadow: none; }
  .fb-layer { align-items: flex-end; padding: 0; }
  .fb-dialog { max-width: none; border-radius: var(--radius) var(--radius) 0 0; padding: 22px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92dvh; transform: translateY(24px); }
  .fb-dialog h2 { font-size: 25px; }
  .fb-star { width: 46px; height: 46px; font-size: 28px; }
  .fb-text { font-size: 16px; }
  /* Tap targets in the sheet: close 44px, chips 40px (the "Xato topdim" link: .linklike in style.css). */
  .fb-x { top: 6px; right: 6px; width: 44px; height: 44px; }
  .fb-chip { min-height: 40px; }
  .fb-notice { top: calc(60px + env(safe-area-inset-top)); }
}

/* ---------- Admin: Fikrlar ---------- */
.adm-fb-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.adm-fb-list { display: grid; gap: 12px; }
.adm-fb { display: grid; gap: 10px; }
.adm-fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.adm-fb-head strong { font-weight: 600; }
.adm-fb-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-fb-ctx { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 12.5px; color: var(--muted); }
.adm-fb-ctx dt { color: var(--muted); opacity: .75; }
.adm-fb-ctx dd { margin: 0; overflow-wrap: anywhere; color: var(--text); }
.adm-fb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-fb-actions input { flex: 1 1 200px; min-width: 0; padding: 7px 10px; font-size: 13.5px; }
.adm-fb-status { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.adm-fb-status.new { color: var(--gold); border-color: var(--gold); }
.adm-fb-status.accepted { color: #8fc79a; border-color: rgba(143, 199, 154, 0.5); }
.adm-fb-status.fixed { color: #9db8e8; border-color: rgba(157, 184, 232, 0.5); }
.adm-fb-status.rejected { color: var(--danger); border-color: rgba(196, 90, 78, 0.5); }
.adm-fb-section { margin-top: 28px; }
.adm-rate { display: grid; gap: 8px; }
.adm-rate-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.adm-rate-avg { font: 600 26px var(--serif); color: var(--gold); line-height: 1; }
.adm-rate-avg.low { color: var(--danger); }
.adm-rate-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-rate-comments { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; }
.adm-rate-comments li { overflow-wrap: anywhere; }
.adm-rate-comments b { color: var(--gold); font-weight: 500; margin-right: 6px; }
