/* FAQ editor (balik 2A). Pravidla pod .rd. Zdroj: prototyp-zahlavi/servis.css (#admin/faq, #admin/faq/edit, modaly cats a files).
   Panel, toolbar, seg, tick, icon-btn, edit-layout, adm-form, switch a progress jsou ve spolecne casti admin.css.
   Dialogy maji .adm-faq na .modal-box (RdModal) nebo na obalu uvnitr .rd-modal (stary ramecek Blazored.Modal). */

.rd .adm-faq {
  --adm-form-label: 150px;
}

.rd .adm-faq .adm-head h1 .fq-country {
  margin-left: 6px;
  vertical-align: 5px;
}

/* ---------- seznam ---------- */
.rd .adm-faq .cat-block + .cat-block {
  border-top: 1px solid var(--border-color);
}

.rd .adm-faq .cat-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--light-gray-color);
  background: #fafbfc;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--navy);
}

.rd .adm-faq .cat-block h3 small {
  font-weight: 500;
  color: var(--muted-text-color);
}

.rd .adm-faq .tbl th.fq-col-name {
  width: 100%;
}

/* ---------- detail ---------- */
.rd .adm-faq .edit-side .callout .mono {
  word-break: break-all;
}

/* obal #editor; CKEditor ma vlastni styly (components/ckeditor5/ckeditor5.css) */
.rd .adm-faq .fq-editor {
  min-width: 0;
  margin-top: 20px;
}

.rd .adm-faq .fq-editor .ck-editor__editable {
  min-height: 360px;
}

/* tlacitko vzhledu pole (vyber skupiny v dialogu) */
.rd .adm-faq .fq-pick {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.rd .adm-faq .fq-pick > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd .adm-faq .fq-switches {
  display: grid;
  gap: 12px;
}

/* ---------- dialogy: skupiny a soubory ---------- */
.rd .adm-faq .fq-new-cat .input {
  flex: 1 1 180px;
  min-width: 0;
  height: 38px;
  font-size: 13.5px;
}

.rd .adm-faq .fq-cats .fq-cat-name {
  width: 100%;
}

.rd .adm-faq .fq-cat-pick {
  text-align: left;
  color: var(--navy);
}

.rd .adm-faq .fq-cat-edit {
  display: flex;
  gap: 8px;
}

.rd .adm-faq .fq-cat-edit .input {
  height: 36px;
}

.rd .adm-faq .fq-confirm {
  margin-bottom: 16px;
}

.rd .adm-faq .fq-confirm .btn-row {
  gap: 8px;
  margin-top: 10px;
}

.rd .adm-faq .dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 22px;
  border: 2px dashed #c9cdd6;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 20px;
  text-align: center;
  color: var(--body-text);
  cursor: pointer;
}

.rd .adm-faq .dropzone:hover,
.rd .adm-faq .dropzone:focus-within {
  border-color: var(--navy);
  background: #fafbfc;
}

.rd .adm-faq .dropzone b,
.rd .adm-faq .dropzone .rd-icon {
  color: var(--navy);
}

.rd .adm-faq .fq-upload {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.rd .adm-faq .fq-files-title {
  margin: 18px 0 10px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--navy);
}

.rd .adm-faq .fq-files-title small {
  font-weight: 500;
  color: var(--muted-text-color);
}

.rd .adm-faq .file-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rd .adm-faq .file-tile {
  position: relative;
  min-width: 0;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #fafbfc;
}

.rd .adm-faq .file-tile:hover {
  border-color: var(--border-color);
}

.rd .adm-faq .file-tile.on {
  border-color: var(--navy);
  background: var(--accent-soft);
}

.rd .adm-faq .file-tile .pv {
  display: block;
  width: 100%;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, #eef0f4 0 8px, #e4e7ed 8px 16px);
  overflow: hidden;
  cursor: pointer;
}

.rd .adm-faq .file-tile .pv img {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  object-fit: contain;
}

.rd .adm-faq .file-tile small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd .adm-faq .file-tile .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: var(--err);
  cursor: pointer;
}

.rd .adm-faq .file-tile .del:hover {
  background: var(--err-soft);
}

.rd .adm-faq .fq-file-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  list-style: none;
}

.rd .adm-faq .fq-file-list li {
  margin: 0;
}

.rd .adm-faq .fq-file-list li + li {
  border-top: 1px solid var(--light-gray-color);
}

.rd .adm-faq .fq-file-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  text-align: left;
  color: var(--primary-text-color);
  cursor: pointer;
}

.rd .adm-faq .fq-file-list button:hover {
  background: #fafbfc;
}

.rd .adm-faq .fq-file-list button.on {
  background: var(--accent-soft);
}

.rd .adm-faq .fq-file-list .mono {
  min-width: 0;
  word-break: break-all;
}

.rd .adm-faq .fq-sel-count {
  align-self: center;
  margin-right: auto;
  font-size: 13px;
}

/* obsah ve starem ramecku Blazored.Modal (ostatni editory, ktere popup otviraji pres IModalService) */
.rd .fq-pop-legacy {
  width: min(760px, 86vw);
  font-size: 14px;
  line-height: 22px;
}

.rd .fq-pop-legacy .fq-pop-title {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--navy);
}

.rd .fq-pop-legacy .modal-foot {
  margin-top: 16px;
  padding: 16px 0 0;
  border-radius: 0;
}

/* ---------- mobil a tablet ---------- */
@media (max-width: 1000px) {
  .rd .adm-faq .file-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .rd .adm-faq .adm-toolbar .adm-seg {
    width: 100%;
  }

  .rd .adm-faq .cat-block h3 {
    padding: 10px 14px;
  }

  .rd .adm-faq .adm-switch {
    min-height: 32px;
  }

  .rd .adm-faq .file-tile .del {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 560px) {
  .rd .adm-faq .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Hodnoceni navodu (/admin/hodnoceni-navodu) ---------- */
.rd .fb-comments td {
  background: var(--light-gray-color);
}

.rd .fb-comments ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.rd .fb-comments li {
  display: grid;
  gap: 2px;
  font-size: 13px;
  line-height: 20px;
  white-space: pre-line;
}

.rd .fb-comments li small {
  font-size: 12px;
  color: var(--muted-text-color);
}
