/* Copyright (c) 2026 David Walker
   Licensed under the MIT License. */

.ProseMirror {
  background: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  min-height: 240px;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
}

.ProseMirror table { border-collapse: collapse; margin: 12px 0; width: auto; }
.ProseMirror td, .ProseMirror th {
  border: 1px solid #d0d0d0;
  padding: 6px 12px;
  min-width: 60px;
  vertical-align: top;
  position: relative;
}
.ProseMirror th { background: #f5f5f5; font-weight: 600; }
.ProseMirror .selectedCell { background: #d4e5ff; }
.ProseMirror .column-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  z-index: 20;
  background: #adf;
  cursor: col-resize;
}
.ProseMirror pre {
  background: #f5f5f5;
  padding: 12px 16px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
}
.ProseMirror code {
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.ProseMirror pre code { background: none; padding: 0; }
.ProseMirror blockquote {
  border-left: 3px solid #d0d0d0;
  margin: 8px 0;
  padding: 4px 16px;
  color: #555;
}

.table-toolbar,
.link-toolbar {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 4px;
  display: flex;
  gap: 2px;
}
.table-toolbar button,
.link-toolbar button {
  padding: 4px 8px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  color: #333;
  font-family: inherit;
}
.table-toolbar button:hover,
.link-toolbar button:hover {
  background: #f0f0ff;
}
.table-toolbar button:disabled,
.link-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.table-toolbar button:disabled:hover,
.link-toolbar button:disabled:hover {
  background: none;
}
.table-toolbar .sep {
  width: 1px;
  background: #e0e0e0;
  margin: 2px 3px;
}
.table-toolbar .danger:hover {
  background: #fff0f0;
  color: #c00;
}

.slash-menu {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
}
.slash-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}
.slash-menu-item:hover,
.slash-menu-item.active {
  background: #f0f0ff;
}
.slash-menu-item .icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 5px;
  font-size: 15px;
  flex-shrink: 0;
}
.slash-menu-item .label {
  font-weight: 500;
}
.slash-menu-item .desc {
  font-size: 12px;
  color: #888;
}
