/* ReactSlate Editor Styles */

/* Main editor container */
.slate-editor {
  /* Base styles for the editor */
  display: flex;
  flex-direction: column;
}

/* Editor content area with scrolling */
.slate-editor .slate-editable {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scroll-behavior: smooth;
}

/* Custom scrollbar styling for webkit browsers */
.slate-editor .slate-editable::-webkit-scrollbar {
  width: 8px;
}

.slate-editor .slate-editable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.slate-editor .slate-editable::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.slate-editor .slate-editable::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* List item styles */
.slate-editor .slate-list-item {
  position: relative;
  margin: 4px 0;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
}

/* Bullet spans are hidden - bullets are rendered via ::before pseudo-elements */
.slate-editor .slate-list-item .slate-list-bullet {
  display: none;
}

.slate-editor .slate-list-item .slate-list-content {
  flex: 1;
  min-height: 1.5em;
}

/* List indentation levels */
.slate-editor .slate-list-item[data-indent="0"] { margin-left: 0px; }
.slate-editor .slate-list-item[data-indent="1"] { margin-left: 20px; }
.slate-editor .slate-list-item[data-indent="2"] { margin-left: 40px; }
.slate-editor .slate-list-item[data-indent="3"] { margin-left: 60px; }
.slate-editor .slate-list-item[data-indent="4"] { margin-left: 80px; }
.slate-editor .slate-list-item[data-indent="5"] { margin-left: 100px; }

/* Different bullet styles for different levels - using pseudo-elements directly on list items */
.slate-editor .slate-list-item.slate-list-unordered[data-indent="0"]::before { content: "•"; }
.slate-editor .slate-list-item.slate-list-unordered[data-indent="1"]::before { content: "◦"; }
.slate-editor .slate-list-item.slate-list-unordered[data-indent="2"]::before { content: "▪"; }
.slate-editor .slate-list-item.slate-list-unordered[data-indent="3"]::before { content: "▫"; }
.slate-editor .slate-list-item.slate-list-unordered[data-indent="4"]::before { content: "•"; }
.slate-editor .slate-list-item.slate-list-unordered[data-indent="5"]::before { content: "◦"; }

/* Position bullets for unordered lists */
.slate-editor .slate-list-item.slate-list-unordered::before {
  flex-shrink: 0;
  width: 20px;
  text-align: right;
  padding-right: 8px;
  user-select: none;
  color: #666;
  font-size: 1.2em;
  line-height: 1.25;
}

/* Display calculated numbers for ordered lists using data attributes */
.slate-editor .slate-list-item.slate-list-ordered::before { 
  content: attr(data-list-number);
  flex-shrink: 0;
  min-width: 20px;
  text-align: right;
  padding-right: 8px;
  user-select: none;
  color: #333;
  font-weight: 500;
  margin-top: 0;
}

/* Toolbar styles */
.slate-editor .toolbar {
  padding: 6px;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0; /* Prevent toolbar from shrinking */
  background: white; /* Ensure toolbar background */
}

.slate-editor .toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.slate-editor .toolbar-button-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 2px;
}

.slate-editor .toolbar-dropdown-container {
  display: inline-block;
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 2px;
}

.slate-editor .toolbar-dropdown-button {
  padding: 5px 10px;
  margin: 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-width: 120px;
  justify-content: space-between;
}

.slate-editor .toolbar-dropdown-button:not(:disabled) {
  background: transparent;
}

.slate-editor .toolbar-dropdown-button:not(:disabled):hover {
  background: rgba(0, 0, 0, 0.05);
}

.slate-editor .toolbar-dropdown-button.active {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.slate-editor .toolbar-dropdown-button:disabled {
  background: transparent;
  cursor: not-allowed;
  opacity: 0.6;
}

.slate-editor .toolbar-dropdown-arrow {
  margin-left: 5px;
  flex-shrink: 0;
}

.slate-editor .toolbar-dropdown-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slate-editor .toolbar-dropdown-icon {
  display: flex;
  align-items: center;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Link styles */
.slate-editor .slate-link {
  cursor: pointer;
  padding: 0 3px;
  border-radius: 2px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-weight: 500;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.slate-editor .slate-link:hover {
  border-bottom-color: currentColor;
}

.slate-editor .slate-link:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 1px;
}

.slate-editor .slate-link.internal-link {
  color: #0f6a0f;
  background-color: rgba(15, 106, 15, 0.12);
}

.slate-editor .slate-link.external-link {
  color: #0058b0;
  background-color: rgba(0, 88, 176, 0.12);
}

/* Keep explicit underline as a distinct formatting signal */
.slate-editor .slate-link u {
  text-decoration-thickness: 2px;
}

/* Special mark styles */
.slate-editor .extrabold {
  font-weight: 800;
  text-transform: uppercase;
}

/* Chunking support for performance optimization */
/* Only apply spacing when chunking is actually enabled */
[data-slate-chunk] > * + * {
  margin-top: 0.5em;
} 