/*
 * Lexxy editor styling for ShapeUp application
 */

/* Lexxy CSS Variables */
:root {
  /* Background highlight colors */
  --highlight-bg-1: #fef3c7;  /* Yellow */
  --highlight-bg-2: #fecaca;  /* Red */
  --highlight-bg-3: #fed7aa;  /* Orange */
  --highlight-bg-4: #fbcfe8;  /* Pink */
  --highlight-bg-5: #ddd6fe;  /* Purple */
  --highlight-bg-6: #bfdbfe;  /* Blue */
  --highlight-bg-7: #bfdbfe;  /* Light blue */
  --highlight-bg-8: #a7f3d0;  /* Green */
  --highlight-bg-9: #d1d5db;  /* Gray */

  /* Text/foreground colors (used by lexxy) */
  --highlight-1: #ca8a04;  /* Yellow */
  --highlight-2: #dc2626;  /* Red */
  --highlight-3: #ea580c;  /* Orange */
  --highlight-4: #db2777;  /* Pink */
  --highlight-5: #7c3aed;  /* Purple */
  --highlight-6: #2563eb;  /* Blue */
  --highlight-7: #0284c7;  /* Light blue */
  --highlight-8: #059669;  /* Green */
  --highlight-9: #6b7280;  /* Gray */

  /* Tables */
  --lexxy-color-table-header-bg: #f3f4f6;
  --lexxy-color-table-cell-border: #e5e7eb;
  --lexxy-color-table-cell-selected: #dbeafe;
  --lexxy-color-table-cell-selected-border: #3b82f6;
  --lexxy-color-table-cell-selected-bg: #dbeafe;
}

.dark {
  /* Darker background highlights for dark mode */
  --highlight-bg-1: #713f12;
  --highlight-bg-2: #7f1d1d;
  --highlight-bg-3: #7c2d12;
  --highlight-bg-4: #831843;
  --highlight-bg-5: #4c1d95;
  --highlight-bg-6: #1e3a8a;
  --highlight-bg-7: #075985;
  --highlight-bg-8: #065f46;
  --highlight-bg-9: #374151;

  /* Brighter text colors for dark mode */
  --highlight-1: #fbbf24;  /* Yellow */
  --highlight-2: #f87171;  /* Red */
  --highlight-3: #fb923c;  /* Orange */
  --highlight-4: #f472b6;  /* Pink */
  --highlight-5: #a78bfa;  /* Purple */
  --highlight-6: #60a5fa;  /* Blue */
  --highlight-7: #38bdf8;  /* Light blue */
  --highlight-8: #34d399;  /* Green */
  --highlight-9: #9ca3af;  /* Gray */

  /* Tables (dark mode) */
  --lexxy-color-table-header-bg: #374151;
  --lexxy-color-table-cell-border: #4b5563;
  --lexxy-color-table-cell-selected: #4b5563;
  --lexxy-color-table-cell-selected-border: #6b7280;
  --lexxy-color-table-cell-selected-bg: #4b5563;
}

/* Lexxy content styling (for rendered rich text and editor) */
.lexxy-content h1,
.lexxy-content h2,
.lexxy-content h3,
.lexxy-content h4,
.trix-content h1,
.trix-content h2,
.trix-content h3,
.trix-content h4,
.lexxy-editor__content h1,
.lexxy-editor__content h2,
.lexxy-editor__content h3,
.lexxy-editor__content h4 {
  font-weight: 800;
  letter-spacing: -0.02ch;
  line-height: 1.1;
  margin-block: 0 0.5em;
}

.lexxy-content h1,
.trix-content h1,
.lexxy-editor__content h1 {
  font-size: 2em;
}

.lexxy-content h2,
.trix-content h2,
.lexxy-editor__content h2 {
  font-size: 1.5em;
}

/* Add extra top margin for h2 headings in editor for better visual separation */
.lexxy-editor__content h2 {
  margin-top: 1.5em;
}

.lexxy-content h3,
.trix-content h3,
.lexxy-editor__content h3 {
  font-size: 1.17em;
}

.lexxy-content h4,
.trix-content h4,
.lexxy-editor__content h4 {
  font-size: 1em;
}

.lexxy-content blockquote,
.trix-content blockquote,
.lexxy-editor__content blockquote {
  border-left: 0.25em solid #d1d5db;
  font-style: italic;
  margin: 0.5em 0;
  padding-left: 1rem;
}

.dark .lexxy-content blockquote,
.dark .trix-content blockquote,
.dark .lexxy-editor__content blockquote {
  border-left-color: #4b5563;
}

.lexxy-content ul,
.trix-content ul {
  list-style: disc;
  padding-left: 12px;
}

.lexxy-content ol,
.trix-content ol {
  list-style: decimal;
  padding-left: 12px;
}

.lexxy-content a,
.trix-content a {
  color: #3b82f6;
  text-decoration: underline;
}

.dark .lexxy-content a,
.dark .trix-content a {
  color: #60a5fa;
}

.lexxy-content strong,
.lexxy-content b,
.trix-content strong,
.trix-content b {
  color: #111827;
}

.dark .lexxy-content strong,
.dark .lexxy-content b,
.dark .trix-content strong,
.dark .trix-content b {
  color: #f3f4f6;
}

/* Strikethrough */
.lexxy-content s,
.lexxy-content__strikethrough,
.lexxy-content [style*="text-decoration"][style*="line-through"],
.trix-content s,
.trix-content [style*="text-decoration"][style*="line-through"],
.lexxy-editor__content s,
.lexxy-editor__content [style*="text-decoration"][style*="line-through"],
.lexxy-editor__content [data-lexical-text="true"][style*="text-decoration"][style*="line-through"] {
  text-decoration: line-through !important;
}


.lexxy-content,
.trix-content {
  color: #374151;
}

.dark .lexxy-content,
.dark .trix-content {
  color: #d1d5db;
}

/* Table styling */
.lexxy-content__table-wrapper,
.trix-content__table-wrapper {
  margin: 1ch 0;
  overflow-x: auto;
}

.lexxy-content table,
.trix-content table,
.lexxy-editor__content table {
  border-collapse: collapse;
  border-spacing: 0;
  width: calc(100% - 0.5ch);
  margin: 0.25ch;
}

.lexxy-content table th,
.lexxy-content table td,
.trix-content table th,
.trix-content table td,
.lexxy-editor__content table th,
.lexxy-editor__content table td {
  border: 1px solid var(--lexxy-color-table-cell-border);
  padding: 12px;
  text-align: start;
  word-break: normal;
  background-color: white;
}

.dark .lexxy-content table th,
.dark .lexxy-content table td,
.dark .trix-content table th,
.dark .trix-content table td,
.dark .lexxy-editor__content table th,
.dark .lexxy-editor__content table td {
  background-color: #1f2937;
}

.lexxy-content table th *:last-child,
.lexxy-content table td *:last-child,
.trix-content table th *:last-child,
.trix-content table td *:last-child,
.lexxy-editor__content table th *:last-child,
.lexxy-editor__content table td *:last-child {
  margin-bottom: 0;
}

.lexxy-content table th.lexxy-content__table-cell--header,
.lexxy-content table td.lexxy-content__table-cell--header,
.trix-content table th.lexxy-content__table-cell--header,
.trix-content table td.lexxy-content__table-cell--header,
.lexxy-editor__content table th.lexxy-content__table-cell--header,
.lexxy-editor__content table td.lexxy-content__table-cell--header {
  background-color: var(--lexxy-color-table-header-bg) !important;
  font-weight: bold;
}

.lexxy-content table .table-cell--selected,
.trix-content table .table-cell--selected,
.lexxy-editor__content table .table-cell--selected {
  background-color: var(--lexxy-color-table-cell-selected-bg) !important;
}

.lexxy-content table .lexxy-content__table-cell--selected,
.trix-content table .lexxy-content__table-cell--selected,
.lexxy-editor__content table .lexxy-content__table-cell--selected {
  background-color: var(--lexxy-color-table-cell-selected-bg) !important;
  border-color: var(--lexxy-color-table-cell-selected-border) !important;
}

.lexxy-editor__content table.lexxy-content__table--selection ::selection {
  background: transparent;
}

.lexxy-editor__content action-text-attachment {
  cursor: pointer;
}

/* Lexxy editor base styling */
lexxy-editor {
  display: block;
  position: relative;
  background-color: #f3f4f6;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  min-height: 80px;
  color: #374151;
}

.dark lexxy-editor {
  background-color: #374151;
  color: #d1d5db;
}

lexxy-editor:focus-within {
  outline: none;
  background-color: #e5e7eb;
}

.dark lexxy-editor:focus-within {
  background-color: #4b5563;
}

/* Remove focus outline from content area */
.lexxy-editor__content {
  outline: none !important;
  min-height: 200px;
  cursor: text;
}

.lexxy-editor__content:focus {
  outline: none !important;
  border: none !important;
}

/* Placeholder styling */
lexxy-editor[placeholder]:empty .lexxy-editor__content:before {
  content: attr(placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.dark lexxy-editor[placeholder]:empty .lexxy-editor__content:before {
  color: #6b7280;
}

/* Borderless editor variant (for documents) */
lexxy-editor.borderless-editor {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 !important;
  min-height: auto;
}

lexxy-editor.borderless-editor:focus-within {
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

lexxy-editor.borderless-editor[placeholder]:empty .lexxy-editor__content:before {
  color: #9ca3af;
  font-size: 16px;
  font-weight: normal;
}

.dark lexxy-editor.borderless-editor[placeholder]:empty .lexxy-editor__content:before {
  color: #6b7280;
}

/* Compact editor variant (for comments) */
.lexxy-compact lexxy-editor {
  margin-top: 0;
}

.lexxy-compact .lexxy-editor__content {
  min-height: 60px;
}

.lexxy-compact lexxy-toolbar {
  padding: 4px 0;
  margin-bottom: 4px;
  font-size: 0.875rem;
}

.lexxy-compact .lexxy-editor__toolbar-button {
  width: 28px;
  height: 28px;
}

.lexxy-compact .lexxy-editor__toolbar-button svg {
  width: 16px;
  height: 16px;
}

/* Lexxy toolbar styling */
lexxy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 2px 0 6px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.dark lexxy-toolbar {
  border-bottom-color: #4b5563;
}

.lexxy-editor__toolbar-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background-color 0.15s ease;
}

/* Push undo/redo buttons to the right */
.lexxy-editor__toolbar-spacer {
  margin-left: auto;
}

.lexxy-editor__toolbar-button svg {
  fill: currentColor;
  width: 18px;
  height: 18px;
}

.lexxy-editor__toolbar-button:hover {
  background: #f3f4f6 !important;
}

.dark .lexxy-editor__toolbar-button:hover {
  background: #4b5563 !important;
}

.lexxy-editor__toolbar-button[aria-pressed="true"] {
  background: #e5e7eb !important;
}

.dark .lexxy-editor__toolbar-button[aria-pressed="true"] {
  background: #374151 !important;
}

/* Dropdown controls (links, highlights, etc.) */
.lexxy-editor__toolbar-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 12px;
  font-size: 14px;
  z-index: 1000;
}

.dark .lexxy-editor__toolbar-dropdown-content {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

/* Link dropdown */
lexxy-link-dropdown input {
  min-width: 30ch;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  background: white;
  color: #111827;
}

.dark lexxy-link-dropdown input {
  background: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

lexxy-link-dropdown input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lexxy-editor__toolbar-dropdown-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.lexxy-editor__toolbar-dropdown-actions button {
  flex: 1;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
}

.lexxy-editor__toolbar-dropdown-actions button[type="submit"] {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.lexxy-editor__toolbar-dropdown-actions button[type="submit"]:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.dark .lexxy-editor__toolbar-dropdown-actions button {
  background: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

.dark .lexxy-editor__toolbar-dropdown-actions button[type="submit"] {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Highlight dropdown (color picker) */
lexxy-highlight-dropdown [data-button-group] {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

lexxy-highlight-dropdown [data-button-group] + [data-button-group] {
  margin-top: 6px;
}

.lexxy-highlight-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  cursor: pointer;
  display: grid;
  place-content: center;
  font-weight: 600;
  font-size: 11px;
  position: relative;
  appearance: none;
  outline: none;
}

/* Background color buttons - white background */
[data-button-group="background-color"] .lexxy-highlight-button {
  background: white;
  color: #000;
}

.dark [data-button-group="background-color"] .lexxy-highlight-button {
  background: #374151;
  color: #fff;
  border-color: #4b5563;
}

/* Text color buttons - show color on text */
[data-button-group="color"] .lexxy-highlight-button {
  background: white;
}

.dark [data-button-group="color"] .lexxy-highlight-button {
  background: #374151;
  border-color: #4b5563;
}

.lexxy-highlight-button::after {
  content: "Aa";
  color: inherit;
}

.lexxy-highlight-button:hover {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.dark .lexxy-highlight-button:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.lexxy-highlight-button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #3b82f6;
  border-color: #3b82f6;
}

.lexxy-highlight-button[aria-pressed="true"]::after {
  content: "✓";
}

.lexxy-editor__toolbar-dropdown-reset {
  width: 100%;
  margin-top: 12px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}

.dark .lexxy-editor__toolbar-dropdown-reset {
  background: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

.lexxy-editor__toolbar-dropdown-reset[disabled] {
  display: none;
}

/* Code language picker */
.lexxy-code-language-picker {
  appearance: none;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 4px 24px 4px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin: 6px 6px 0 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%23000'/%3E%3C/svg%3E");
  background-position: center right 8px;
  background-repeat: no-repeat;
  background-size: 10px;
}

.dark .lexxy-code-language-picker {
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%23fff'/%3E%3C/svg%3E");
}

/* Table action menu */
.table-cell-action-button-container {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 4px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.dark .table-cell-action-button-container {
  background: #1f2937;
  border-color: #374151;
}

.table-action-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: #374151;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.dark .table-action-button {
  color: #d1d5db;
}

.table-action-button:hover {
  background: #f3f4f6;
}

.dark .table-action-button:hover {
  background: #374151;
}

.table-action-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Table handle buttons (toolbar above selected rows/columns) */
.lexxy-table-handle-buttons {
  color: white;
  display: none;
  flex-direction: row;
  font-size: 0.875rem;
  gap: 4px;
  line-height: 1;
  position: absolute;
  transform: translate(-50%, -120%);
  z-index: 10;
}

.lexxy-table-control {
  align-items: center;
  background-color: #111827;
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 2px;
  white-space: nowrap;
}

.dark .lexxy-table-control {
  background-color: #1f2937;
}

.lexxy-table-control button {
  aspect-ratio: 1 / 1;
  align-items: center;
  background-color: transparent;
  border-radius: 6px;
  border: 0;
  color: white;
  cursor: pointer;
  display: flex;
  font-weight: bold;
  justify-content: center;
  line-height: 1;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
}

.lexxy-table-control button:hover,
.lexxy-table-control button:focus-visible {
  background-color: #374151;
}

.dark .lexxy-table-control button:hover,
.dark .lexxy-table-control button:focus-visible {
  background-color: #4b5563;
}

.lexxy-table-control button svg {
  height: 1em;
  width: 1em;
  fill: currentColor;
}

.lexxy-table-control button span {
  display: none;
}

.lexxy-table-control__more-menu {
  gap: 0;
  padding: 2px;
  position: relative;
}

.lexxy-table-control__more-menu summary {
  aspect-ratio: 1 / 1;
  align-items: center;
  background: transparent;
  border-radius: 6px;
  border: 0;
  box-sizing: border-box;
  display: flex;
  font-size: inherit;
  justify-content: center;
  list-style: none;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  color: white;
}

.lexxy-table-control__more-menu summary::-webkit-details-marker {
  display: none;
}

.lexxy-table-control__more-menu summary:hover {
  background: #374151;
}

.dark .lexxy-table-control__more-menu summary:hover {
  background: #4b5563;
}

.lexxy-table-control__more-menu-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  top: 105%;
  left: 0;
  padding: 0;
  position: absolute;
}

.lexxy-table-control__more-menu-section {
  background: #111827;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  padding: 2px;
}

.dark .lexxy-table-control__more-menu-section {
  background: #1f2937;
}

.lexxy-table-control__more-menu-section button {
  aspect-ratio: unset;
  align-items: center;
  display: flex;
  flex-direction: row;
  font-weight: normal;
  gap: 8px;
  justify-content: flex-start;
  padding: 8px 32px;
  padding-left: 12px;
  white-space: nowrap;
}

.lexxy-table-control__more-menu-section button span {
  display: inline-block;
}

.lexxy-table-control__more-menu-section button svg {
  height: 20px;
  width: 20px;
  fill: currentColor;
}

/* Lexxy prompt menu (mentions) */
.lexxy-prompt-menu {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  padding: 4px 0;
  transform: translateX(8px);
  visibility: hidden;
}

.lexxy-prompt-menu--visible {
  visibility: visible;
}

.dark .lexxy-prompt-menu {
  background: #1f2937;
  border-color: #374151;
}

.lexxy-prompt-menu lexxy-prompt-item,
.lexxy-prompt-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 2px 4px;
  cursor: pointer;
  color: #374151;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.dark .lexxy-prompt-menu lexxy-prompt-item,
.dark .lexxy-prompt-menu__item {
  color: #d1d5db;
}

.lexxy-prompt-menu lexxy-prompt-item:hover,
.lexxy-prompt-menu lexxy-prompt-item[aria-selected],
.lexxy-prompt-menu__item:hover,
.lexxy-prompt-menu__item[aria-selected],
.lexxy-prompt-menu__item:focus {
  background: #f3f4f6;
  outline: none;
}

.dark .lexxy-prompt-menu lexxy-prompt-item:hover,
.dark .lexxy-prompt-menu lexxy-prompt-item[aria-selected],
.dark .lexxy-prompt-menu__item:hover,
.dark .lexxy-prompt-menu__item[aria-selected],
.dark .lexxy-prompt-menu__item:focus {
  background: #374151;
  outline: none;
}

/* Mention attachments (inline avatars) */
.lexxy-content action-text-attachment[content-type="application/vnd.actiontext.mention"],
.trix-content action-text-attachment[content-type="application/vnd.actiontext.mention"],
.lexxy-editor__content action-text-attachment[content-type="application/vnd.actiontext.mention"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: -4px;
  margin: 0;
  padding: 0;
  line-height: inherit;
}

.lexxy-content action-text-attachment[content-type="application/vnd.actiontext.mention"] img,
.trix-content action-text-attachment[content-type="application/vnd.actiontext.mention"] img,
.lexxy-editor__content action-text-attachment[content-type="application/vnd.actiontext.mention"] img {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  margin: 0;
}

/* Generic action-text attachments (files, etc) */
.lexxy-content action-text-attachment[content-type^="application/vnd.actiontext"]:not([content-type="application/vnd.actiontext.mention"]),
.trix-content action-text-attachment[content-type^="application/vnd.actiontext"]:not([content-type="application/vnd.actiontext.mention"]),
.lexxy-editor__content action-text-attachment[content-type^="application/vnd.actiontext"]:not([content-type="application/vnd.actiontext.mention"]) {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: -4px;
}

/* Attachment gallery - maintain compatibility with ActionText */
.lexxy-content .attachment-gallery > action-text-attachment,
.lexxy-content .attachment-gallery > .attachment,
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.lexxy-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
.lexxy-content .attachment-gallery.attachment-gallery--2 > .attachment,
.lexxy-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
.lexxy-content .attachment-gallery.attachment-gallery--4 > .attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.lexxy-content action-text-attachment .attachment,
.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}

/* Comment thread connecting lines - maintain existing */
.comment-thread {
  position: relative;
}

.comment-thread > div {
  position: relative;
}

.comment-thread > div::before {
  content: '';
  position: absolute;
  left: -28px;
  top: -16px;
  width: 28px;
  height: 32px;
  border-left: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-bottom-left-radius: 12px;
}

.dark .comment-thread > div::before {
  border-color: #374151;
}

.comment-thread > div:first-child::before {
  top: -68px;
  height: 84px;
}

.comment-thread > div:not(:last-child)::after {
  content: '';
  position: absolute;
  left: -28px;
  top: 32px;
  bottom: -16px;
  width: 1px;
  background-color: #e5e7eb;
}

.dark .comment-thread > div:not(:last-child)::after {
  background-color: #374151;
}

/* Avatar AI overlay (sparkle icon for AI-generated content) */
.avatar-ai-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.3));
}

.avatar-ai-overlay svg {
  color: #f59e0b;
}

.dark .avatar-ai-overlay svg {
  color: #fbbf24;
}
