/* Deskora Quick Comment (isolated styles)
   IMPORTANT: in DeskoraTheme the contextual buttons are styled via .icon-time-add.
   So we apply our “standalone” styling only when the theme does NOT provide it. */
.deskora-qc-action:not(.icon-time-add) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 4px;
  background: #4879d4;
  color: #fff !important;
  font-weight: 500;
  text-decoration: none !important;
  border: 1px solid #4879d4;
  margin-right: 6px;
}
.deskora-qc-action:not(.icon-time-add):hover { filter: brightness(0.95); }

.deskora-qc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.deskora-qc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.deskora-qc-dialog {
  position: relative;
  max-width: 820px;
  width: calc(100% - 32px);
  margin: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.18);
  overflow: hidden;
  max-height: calc(100vh - 32px);
  overflow: auto;
  z-index: 1;
}
.deskora-qc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: #f7f8fb;
}
.deskora-qc-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.deskora-qc-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.deskora-qc-close:hover { background: rgba(0,0,0,0.06); }

.deskora-qc-body { padding: 16px; }

.deskora-qc-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.16);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.deskora-qc-textarea:focus {
  border-color: #4879d4;
  box-shadow: 0 0 0 3px rgba(72,121,212,0.18);
}

.deskora-qc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.deskora-qc-toolbar-left,
.deskora-qc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deskora-qc-upload-btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  padding: 0 10px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.deskora-qc-upload-btn:hover { background: rgba(0,0,0,0.04); }

.deskora-qc-attach-list {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: #334155;
  overflow: auto;
}
.deskora-qc-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 999px;
  margin: 0 6px 6px 0;
  background: #fff;
}
.deskora-qc-file-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
}
.deskora-qc-file-remove:hover { color: #64748b; }

.deskora-qc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0 12px;
  height: 32px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.deskora-qc-btn-primary {
  background: #4879d4;
  border-color: #4879d4;
  color: #fff;
}
.deskora-qc-btn-primary:hover { filter: brightness(0.95); }

.deskora-qc-btn-danger {
  background: #d84a4a;
  border-color: #d84a4a;
  color: #fff;
}
.deskora-qc-btn-danger:hover { filter: brightness(0.95); }

.deskora-qc-error {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}

/* Ensure the action button keeps its look inside themes that heavily style .contextual a
   (but do not override DeskoraTheme's own contextual button styling). */
.contextual a.deskora-qc-action:not(.icon-time-add) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 4px;
  background: #4879d4;
  border: 1px solid #4879d4;
  color: #fff !important;
  text-decoration: none !important;
  vertical-align: middle;
}

/* Wiki toolbar (same as standard Redmine editor) inside our modal */
#deskora-qc-modal .jstEditor {
  width: 100%;
}
#deskora-qc-modal .jstElements {
  margin-top: 10px;
}

/* Hide the last three buttons in the standard Redmine wiki toolbar: Help, Image, Wiki link */
#deskora-qc-modal .jstElements .jstb_help,
#deskora-qc-modal .jstElements .jstb_img,
#deskora-qc-modal .jstElements .jstb_link {
  display: none !important;
}
/* Fallback for themes/variants where classnames differ: hide the last three controls
   (only buttons/links, to avoid hiding layout spacers). */
#deskora-qc-modal .jstElements > button:nth-last-child(-n+3),
#deskora-qc-modal .jstElements > a:nth-last-child(-n+3) {
  display: none !important;
}

/* Mobile */
@media (max-width: 720px) {
  .deskora-qc-modal { padding: 10px; }
  .deskora-qc-dialog { width: 100%; }
  .deskora-qc-toolbar { flex-direction: column; align-items: stretch; }
  .deskora-qc-toolbar-right { justify-content: flex-end; }
}
