/* ============================================
   Rich Text Editor Styles (Composer)
   ============================================ */

/* Inline code styling for composer */
.cometchat-rich-text__code,
code.cometchat-rich-text__code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--cometchat-extended-primary-color-100);
  color: var(--cometchat-primary-color);
  padding: var(--cometchat-spacing) var(--cometchat-spacing-1);
  border-radius: var(--cometchat-radius-1);
}
/* Nested ordered list cycling: decimal → lower-alpha → lower-roman */
.cometchat-text-bubble__content ol ol {
  list-style-type: lower-alpha;
}
.cometchat-text-bubble__content ol ol ol {
  list-style-type: lower-roman;
}

/* Nested unordered list cycling: disc → circle → square */
.cometchat-text-bubble__content ul ul {
  list-style-type: circle;
}
.cometchat-text-bubble__content ul ul ul {
  list-style-type: square;
}
/* Reset rich text element spacing inside subtitle preview */
.cometchat-message-composer__reply-preview p,
.cometchat-message-composer__reply-preview blockquote,
.cometchat-message-composer__reply-preview pre,
.cometchat-message-composer__reply-preview code,
.cometchat-message-composer__reply-preview ul,
.cometchat-message-composer__reply-preview ol,
.cometchat-message-composer__reply-preview li,
.cometchat-message-composer__reply-preview h1,
.cometchat-message-composer__reply-preview h2,
.cometchat-message-composer__reply-preview h3,
.cometchat-message-composer__reply-preview h4,
.cometchat-message-composer__reply-preview h5,
.cometchat-message-composer__reply-preview h6 {
  margin: 0;
  padding: 0;
  display: inline;
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  white-space: nowrap;
}
.cometchat-conversation-item__subtitle-text ol , .cometchat-conversation-item__subtitle-text ul{
  margin: 0;
  padding: 0;
  padding-left: var(--cometchat-padding-4);
}
/* ============================================
   Content Editable Area
   ============================================ */

.cometchat-rich-text-editor__content {
  padding: 0;
  overflow: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.cometchat-rich-text-editor__content p{
  margin: 0;
}
.cometchat-rich-text-editor__content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.cometchat-message-composer__input-section--multiline .cometchat-rich-text-editor__content{
  padding: 0;
}

.cometchat-rich-text__code-block{
    background: var(--cometchat-neutral-color-100);
    margin: 0;
    padding: var(--cometchat-spacing-2) var(--cometchat-spacing-3);
    display: block;
    line-height: 1.5;
}

/* Reset inline code styles when <code> is inside a <pre> code block */
.cometchat-rich-text__code-block .cometchat-rich-text__code,
.cometchat-rich-text__code-block code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    vertical-align: baseline;
}
.cometchat-rich-text-editor__content:focus-visible{
    outline: none;
}
.cometchat-rich-text-editor__content ol,.cometchat-rich-text-editor__content ul{
    padding-left: var(--cometchat-padding-8);
    margin: 0;
}
/* ProseMirror wraps every line in a <p>, which carries the UA default ~1em top/bottom margin. In
   plain mode the `--plain *` reset zeroes it, but rich-text mode had no equivalent — so editing a
   populated caption showed a 14px band above and below the text. Zero it; consecutive paragraphs
   keep a small gap so multi-paragraph content doesn't collapse into one block. */
.cometchat-rich-text-editor__content p{
    margin: 0;
}
.cometchat-rich-text-editor__content p + p{
    margin-top: var(--cometchat-spacing-1);
}
/* Nested ordered list cycling in composer: decimal → lower-alpha → lower-roman */
.cometchat-rich-text-editor__content ol ol {
    list-style-type: lower-alpha;
}
.cometchat-rich-text-editor__content ol ol ol {
    list-style-type: lower-roman;
}
/* Nested unordered list cycling in composer: disc → circle → square */
.cometchat-rich-text-editor__content ul ul {
    list-style-type: circle;
}
.cometchat-rich-text-editor__content ul ul ul {
    list-style-type: square;
}
.cometchat-rich-text__blockquote{
    display: block;
    margin: var(--cometchat-rich-text-blockquote-margin, var(--cometchat-spacing-1) 0);
    padding: var(--cometchat-rich-text-blockquote-padding, var(--cometchat-spacing-2) var(--cometchat-spacing-3));
    border-left: var(--cometchat-rich-text-blockquote-border-left, 4px solid var(--cometchat-neutral-color-400));
    color: var(--cometchat-rich-text-blockquote-color, var(--cometchat-text-color-secondary));
    background: var(--cometchat-background-color-02, rgba(0,0,0,0.04));
    border-radius: 0 var(--cometchat-radius-1) var(--cometchat-radius-1) 0;
}

/* ============================================
   Text Bubble Rich Text Formatting Styles
   Styles for dynamically generated HTML from markdown formatter
   ============================================ */

/**
 * Inline code
 */
.cometchat-text-bubble__content code {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.9em;
  padding: var(--cometchat-spacing) var(--cometchat-spacing-1);
  border-radius: var(--cometchat-radius-1);
}

/* Inline code in incoming messages — exclude code inside pre (code blocks) */
.cometchat-text-bubble-incoming .cometchat-text-bubble__content code:not(pre code),
.cometchat-text-bubble.cometchat-text-bubble-incoming .cometchat-text-bubble__content code:not(pre code) {
  background: var(--cometchat-extended-primary-color-100);
  color: var(--cometchat-primary-color);
}

/* Inline code in outgoing messages — exclude code inside pre (code blocks) */
.cometchat-text-bubble-outgoing .cometchat-text-bubble__content code:not(pre code),
.cometchat-text-bubble.cometchat-text-bubble-outgoing .cometchat-text-bubble__content code:not(pre code) {
  background: rgba(255, 255, 255, 0.2);
  color: var(--cometchat-static-white);
}


.cometchat-message-composer__edit-preview-subtitle * {
margin: 0;
}
/**
 * Code blocks
 */
.cometchat-text-bubble__content pre {
  border-radius: var(--cometchat-radius-2);
  overflow-x: auto;
  max-width: 100%;
  margin: var(--cometchat-spacing-1) 0;
  padding: var(--cometchat-spacing-2) var(--cometchat-spacing-3);
  white-space: pre;
}

/* Code blocks in incoming messages */
.cometchat-text-bubble-incoming .cometchat-text-bubble__content pre,
.cometchat-text-bubble.cometchat-text-bubble-incoming .cometchat-text-bubble__content pre {
  background: var(--cometchat-background-color-02);
  color: var(--cometchat-neutral-color-900);
}

/* Code blocks in outgoing messages */
.cometchat-text-bubble-outgoing .cometchat-text-bubble__content pre,
.cometchat-text-bubble.cometchat-text-bubble-outgoing .cometchat-text-bubble__content pre {
  background: rgba(255, 255, 255, 0.2);
  color: var(--cometchat-static-white);
}

.cometchat-text-bubble__content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
  color: inherit;
}

/**
 * Blockquote
 */
.cometchat-text-bubble__content blockquote {
  display: block;
  margin: var(--cometchat-spacing-1) 0;
  padding: var(--cometchat-spacing-2) var(--cometchat-spacing-3);
  border-left: 4px solid;
  border-radius: 0 var(--cometchat-radius-1) var(--cometchat-radius-1) 0;
  font-style: normal;
}

/* Blockquote in incoming messages */
.cometchat-text-bubble-incoming .cometchat-text-bubble__content blockquote,
.cometchat-text-bubble.cometchat-text-bubble-incoming .cometchat-text-bubble__content blockquote {
  border-left-color: var(--cometchat-neutral-color-400);
  color: var(--cometchat-text-color-secondary);
  background: var(--cometchat-background-color-02);
}

/* Blockquote in outgoing messages */
.cometchat-text-bubble-outgoing .cometchat-text-bubble__content blockquote,
.cometchat-text-bubble.cometchat-text-bubble-outgoing .cometchat-text-bubble__content blockquote {
  border-left-color: rgba(255, 255, 255, 0.6);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
}

/**
 * Unordered lists
 */
.cometchat-text-bubble__content ul {
  margin: var(--cometchat-spacing-2) 0;
  padding-left: var(--cometchat-spacing-5);
  list-style-type: disc;
  white-space: normal; /* Override pre-wrap for lists */
}

/**
 * Ordered lists
 */
.cometchat-text-bubble__content ol {
  margin: var(--cometchat-spacing-2) 0;
  padding-left: var(--cometchat-spacing-5);
  list-style-type: decimal;
  white-space: normal; /* Override pre-wrap for lists */
}

/**
 * Nested lists inside list items — remove extra margin
 */
.cometchat-text-bubble__content li ul,
.cometchat-text-bubble__content li ol {
  margin: 0;
}

/**
 * List items
 */
.cometchat-text-bubble__content li {
  margin: var(--cometchat-spacing-1) 0;
  line-height: 1.5;
  white-space: normal; /* Override pre-wrap for list items */
}

.cometchat-text-bubble__content li:first-child {
  margin-top: 0;
}

.cometchat-text-bubble__content li:last-child {
  margin-bottom: 0;
}

/**
 * Bold text
 */
.cometchat-text-bubble__content strong {
  font-weight: 700;
}

/**
 * Italic text
 */
.cometchat-text-bubble__content em {
  font-style: italic;
}

/**
 * Underline text
 */
.cometchat-text-bubble__content u {
  text-decoration: underline;
}

/**
 * Strikethrough text
 */
.cometchat-text-bubble__content s {
  text-decoration: line-through;
}

/**
 * Links
 */
.cometchat-text-bubble__content a {
  text-decoration: underline;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

/* Links in incoming messages */
.cometchat-text-bubble-incoming .cometchat-text-bubble__content a,
.cometchat-text-bubble.cometchat-text-bubble-incoming .cometchat-text-bubble__content a {
  color: var(--cometchat-info-color);
}

.cometchat-text-bubble-incoming .cometchat-text-bubble__content a:hover,
.cometchat-text-bubble.cometchat-text-bubble-incoming .cometchat-text-bubble__content a:hover {
  opacity: 0.8;
}

.cometchat-text-bubble-incoming .cometchat-text-bubble__content a:focus,
.cometchat-text-bubble.cometchat-text-bubble-incoming .cometchat-text-bubble__content a:focus {
  outline: 2px solid var(--cometchat-info-color);
  outline-offset: 2px;
}

/* Links in outgoing messages */
.cometchat-text-bubble-outgoing .cometchat-text-bubble__content a,
.cometchat-text-bubble.cometchat-text-bubble-outgoing .cometchat-text-bubble__content a {
  color: var(--cometchat-static-white);
}

.cometchat-text-bubble-outgoing .cometchat-text-bubble__content a:hover,
.cometchat-text-bubble.cometchat-text-bubble-outgoing .cometchat-text-bubble__content a:hover {
  opacity: 0.8;
}

.cometchat-text-bubble-outgoing .cometchat-text-bubble__content a:focus,
.cometchat-text-bubble.cometchat-text-bubble-outgoing .cometchat-text-bubble__content a:focus {
  outline: 2px solid var(--cometchat-static-white);
  outline-offset: 2px;
}

/**
 * Headings
 */
.cometchat-text-bubble__content h1 {
  font: var(--cometchat-font-heading1-bold);
  margin: var(--cometchat-spacing-3) 0 var(--cometchat-spacing-2);
}

.cometchat-text-bubble__content h2 {
  font: var(--cometchat-font-heading2-bold);
  margin: var(--cometchat-spacing-3) 0 var(--cometchat-spacing-2);
}

.cometchat-text-bubble__content h3 {
  font: var(--cometchat-font-heading3-bold);
  margin: var(--cometchat-spacing-2) 0 var(--cometchat-spacing-1);
}

.cometchat-text-bubble__content h4 {
  font: var(--cometchat-font-heading4-bold);
  margin: var(--cometchat-spacing-2) 0 var(--cometchat-spacing-1);
}

.cometchat-text-bubble__content h5,
.cometchat-text-bubble__content h6 {
  font: var(--cometchat-font-body-bold);
  margin: var(--cometchat-spacing-2) 0 var(--cometchat-spacing-1);
}

/**
 * Paragraphs
 */
.cometchat-text-bubble__content p {
  margin: 0;
}

.cometchat-text-bubble__content p + p {
  margin-top: var(--cometchat-spacing-2);
}
.cometchat-rich-text-editor__content {
  position: relative;
}
.cometchat-rich-text-editor__content:empty::before {
  content: attr(data-placeholder);
  color: var(--cometchat-text-color-tertiary);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 479px) {
  .cometchat-message-composer__input-section--multiline .cometchat-rich-text-editor__content{
padding: var(--cometchat-padding-1);
}
}
.cometchat-rich-text__link{
  text-decoration: none;
  color: var(--cometchat-primary-color);
  cursor: pointer;
}
