@import './czi-vars.css';

/* Table Styles */

.ProseMirror .tableWrapper {
  overflow-x: auto;
}

.prosemirror-mention-node {
  background-color: red;
}

[data-mention-name] {
  background-color: greenyellow;
}

.ProseMirror table {
  border-collapse: initial;
  border-spacing: 0;
  border: 1px solid var(--czi-table-border-color);
  border-width: 0 thin thin 0;
  table-layout: fixed;
  width: 100%;
  margin: 0;
  overflow: hidden;
  page-break-inside: avoid;
}

.ProseMirror td,
.ProseMirror th {
  background-color: #fff;
  border: 1px solid var(--czi-table-border-color);
  border-width: thin 0 0 thin;
  box-sizing: border-box;
  min-width: 1em;
  padding: 8px;
  position: relative;
  vertical-align: top;
}

.ProseMirror th {
  background-color: var(--czi-table-header-background-color);
  font-weight: bold;
  text-align: left;
}

.ProseMirror .column-resize-handle {
  background-color: #adf;
  border: solid 1px #fff;
  border-width: 0 1px;
  bottom: 0;
  pointer-events: none;
  position: absolute;
  right: -2px;
  top: 0;
  width: 4px;
  z-index: 20;
}

.ProseMirror th:last-child > .column-resize-handle,
.ProseMirror td:last-child > .column-resize-handle {
  right: 0;
}

.ProseMirror .column-resize-handle.for-margin-left.for-margin-left {
  left: 0;
  right: auto;
}

.ProseMirror.resize-cursor {
  cursor: ew-resize;
  cursor: col-resize;
}

/* Give selected cells a blue overlay */
.ProseMirror .selectedCell::after {
  background: var(--czi-selection-highlight-color);
  content: '';
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

@media only print {
  .ProseMirror table {
    width: 100% !important;
  }
}
