/* ──────────────────────────────────────────────────────────────────────────────
   Quill rich editor - Cours Studio
────────────────────────────────────────────────────────────────────────────── */

.cm-courseStudioRichEditor {
  position: relative;
  border: 1px solid #d8e3ef;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #fdfefe 0%, #f7faff 100%);
  box-shadow:
    0 10px 28px rgba(17, 38, 66, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cm-courseStudioQuillToolbar {
  position: relative;
  z-index: 80;
  display: block;
  padding: 10px 12px;
  background:
    radial-gradient(circle at top left, rgba(47, 95, 226, 0.04), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-bottom: 1px solid #dde8f3;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  overflow: visible;
}

.cmrte-toolbarRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
  width: 100%;
  overflow: visible;
}

.cmrte-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.cmrte-separator {
  width: 1px;
  height: 20px;
  flex: 0 0 auto;
  background: #dfe7f0;
  border-radius: 999px;
  margin: 0 1px;
}

.cmrte-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.cmrte-dropdownPanel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 9999;
  min-width: 148px;
  padding: 8px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(17, 38, 66, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
}

.cmrte-dropdown.is-open .cmrte-dropdownPanel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.cmrte-dropdownPanel--menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cmrte-dropdownPanel--palette {
  width: 156px;
  min-width: 156px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cmrte-toolButton,
.cmrte-menuItem,
.cmrte-colorAction {
  font-family: inherit;
  border: 1px solid #d7e0eb;
  background: #ffffff;
  color: #173d70;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease,
    color 0.16s ease;
}

.cmrte-toolButton {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(16, 47, 89, 0.03);
  flex: 0 0 auto;
}

.cmrte-toolButton:hover,
.cmrte-menuItem:hover,
.cmrte-colorAction:hover {
  border-color: #bfd0e4;
  background: #f8fbff;
}

.cmrte-toolButton:active,
.cmrte-menuItem:active,
.cmrte-colorAction:active {
  transform: translateY(1px);
}

.cmrte-toolButton.is-active,
.cmrte-menuItem.is-active,
.cmrte-dropdown.is-open > .cmrte-toolButton {
  border-color: #2f5fe2;
  background: #edf3ff;
  box-shadow: 0 0 0 3px rgba(47, 95, 226, 0.08);
}

.cmrte-toolButton strong,
.cmrte-toolButton em,
.cmrte-underlined {
  font-size: 13px;
  line-height: 1;
  color: #334155;
}

.cmrte-toolButton strong {
  font-weight: 800;
}

.cmrte-toolButton em {
  font-style: italic;
  font-weight: 700;
}

.cmrte-underlined {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cmrte-toolButton--select {
  min-width: 96px;
  justify-content: space-between;
  padding-right: 10px;
  padding-left: 10px;
}

.cmrte-toolButton-text {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  line-height: 1;
}

.cmrte-caret {
  position: relative;
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: 0 0 auto;
}

.cmrte-caret::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0;
  width: 6px;
  height: 6px;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: rotate(45deg);
}

.cmrte-colorIcon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  min-height: 16px;
}

.cmrte-colorIcon--text {
  flex-direction: column;
  gap: 2px;
}

.cmrte-colorIcon-letter {
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  color: #334155;
}

.cmrte-dropdown-preview--underline {
  width: 13px;
  height: 3px;
  border-radius: 999px;
}

.cmrte-colorIcon--highlight {
  flex-direction: column;
  gap: 2px;
}

.cmrte-highlightPen {
  position: relative;
  width: 14px;
  height: 10px;
  display: inline-block;
}

.cmrte-highlightPen::before,
.cmrte-highlightPen::after {
  content: "";
  position: absolute;
  display: block;
}

.cmrte-highlightPen::before {
  width: 10px;
  height: 3px;
  background: #334155;
  top: 4px;
  left: 2px;
  transform: rotate(-18deg);
  border-radius: 999px;
}

.cmrte-highlightPen::after {
  width: 4px;
  height: 4px;
  background: #334155;
  top: 2px;
  right: 1px;
  transform: rotate(-18deg);
  border-radius: 1px;
}

.cmrte-dropdown-preview--bar {
  width: 13px;
  height: 4px;
  border-radius: 999px;
}

.cmrte-listIcon {
  width: 13px;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.cmrte-listIcon span {
  display: block;
  width: 13px;
  height: 2px;
  background: #334155;
  border-radius: 999px;
}

.cmrte-linkIcon {
  position: relative;
  width: 13px;
  height: 13px;
  display: inline-block;
}

.cmrte-linkIcon::before,
.cmrte-linkIcon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 4px;
  border: 2px solid #334155;
  border-radius: 999px;
  transform: rotate(-35deg);
}

.cmrte-linkIcon::before {
  left: 0;
  top: 6px;
}

.cmrte-linkIcon::after {
  right: 0;
  top: 1px;
}

.cmrte-cleanIcon {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #334155;
}

.cmrte-menuItem,
.cmrte-colorAction {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.cmrte-colorAction {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.cmrte-colorSwatch {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(23, 61, 112, 0.12);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.cmrte-colorSwatch:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 61, 112, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 6px 14px rgba(17, 38, 66, 0.1);
}

.cm-courseStudioRichBody {
  position: relative;
  z-index: 1;
  background: #ffffff;
  overflow: hidden;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}

.cm-courseStudioRichEditor .ql-toolbar.ql-snow {
  display: none;
}

.cm-courseStudioRichEditor .ql-container.ql-snow {
  border: 0;
  font-family: inherit;
  background: transparent;
}

.cm-courseStudioRichEditor .ql-editor {
  min-height: 540px;
  max-height: 720px;
  overflow: auto;
  padding: 18px 20px 20px;
  background: #ffffff;
  color: #183a6a;
  font-size: 15px;
  line-height: 1.7;
}

.cm-courseStudioRichEditor .ql-editor.ql-blank::before {
  left: 20px;
  right: 20px;
  color: #90a2b8;
  font-style: normal;
  font-size: 15px;
  font-weight: 500;
}

.cm-courseStudioRichEditor .ql-editor p {
  margin: 0 0 12px;
}

.cm-courseStudioRichEditor .ql-editor p:last-child {
  margin-bottom: 0;
}

.cm-courseStudioRichEditor .ql-editor .cm-inline-style-title-h2 {
  font-size: 24px;
  line-height: 1.28;
  font-weight: 800;
  color: #123cde;
}

.cm-courseStudioRichEditor .ql-editor .cm-inline-style-title-h3 {
  font-size: 20px;
  line-height: 1.34;
  font-weight: 800;
  color: #173d70;
}

.cm-courseStudioRichEditor .ql-editor ul,
.cm-courseStudioRichEditor .ql-editor ol {
  margin: 0 0 14px;
  padding-left: 1.35rem;
}

.cm-courseStudioRichEditor .ql-editor li {
  margin-bottom: 6px;
}

.cm-courseStudioRichEditor .ql-editor a {
  color: #2f5fe2;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.cm-courseStudioRichEditor .ql-editor strong {
  font-weight: 800;
}

.cm-courseStudioRichEditor .ql-editor em {
  font-style: italic;
}

.cm-courseStudioRichEditor .ql-editor::-webkit-scrollbar {
  width: 10px;
}

.cm-courseStudioRichEditor .ql-editor::-webkit-scrollbar-track {
  background: #f3f7fb;
  border-radius: 999px;
}

.cm-courseStudioRichEditor .ql-editor::-webkit-scrollbar-thumb {
  background: rgba(23, 61, 112, 0.16);
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Course Studio Rich Editor - Responsive                                   */
/* ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .cm-courseStudioQuillToolbar {
    padding: 10px 12px;
  }

  .cmrte-toolbarRow {
    gap: 6px;
    flex-wrap: wrap;
  }

  .cmrte-group {
    flex-wrap: nowrap;
  }

  .cmrte-toolButton {
    min-width: 38px;
    height: 36px;
    padding: 0 10px;
  }

  .cmrte-toolButton--select {
    min-width: 104px;
  }

  .cmrte-toolButton-text {
    font-size: 12px;
  }

  .cm-courseStudioRichEditor .ql-editor {
    min-height: 260px;
    max-height: 460px;
    padding: 16px 18px 18px;
  }

  .cm-courseStudioRichEditor .ql-editor.ql-blank::before {
    left: 18px;
    right: 18px;
  }
}

@media (max-width: 640px) {
  .cm-courseStudioQuillToolbar {
    padding: 10px;
  }

  .cmrte-toolbarRow {
    row-gap: 8px;
    flex-wrap: wrap;
  }

  .cmrte-separator {
    display: none;
  }

  .cmrte-group {
    flex-wrap: wrap;
  }

  .cmrte-toolButton--select {
    min-width: 100px;
  }

  .cmrte-dropdownPanel {
    left: 0;
    right: auto;
  }

  .cm-courseStudioRichEditor .ql-editor {
    min-height: 220px;
    padding: 15px 16px 16px;
  }

  .cm-courseStudioRichEditor .ql-editor.ql-blank::before {
    left: 16px;
    right: 16px;
  }
}

