/* Table Grid Menu */
.table-grid-menu {
  padding: 10px;
  width: 220px; }
  .table-grid-menu .table-grid-container {
    position: relative;
    width: 200px; }
    .table-grid-menu .table-grid-container .table-grid-row {
      display: flex; }
    .table-grid-menu .table-grid-container .table-grid-cell {
      width: 18px;
      height: 18px;
      border: 1px solid #ddd;
      margin: 1px;
      background: #fff;
      cursor: pointer; }
      .table-grid-menu .table-grid-container .table-grid-cell.active {
        background: #b3d4fc;
        border-color: #5c9ded; }
    .table-grid-menu .table-grid-container .table-grid-label {
      text-align: center;
      margin-top: 5px;
      font-size: 12px;
      color: #666; }

.tiptap-container {
  border: 1px solid #ccc;
  border-radius: 4px;
  /* overflow: hidden;  <-- Removed to allow dropdowns to show */
  background: #fff;
  display: flex;
  flex-direction: column; }
  .tiptap-container .tiptap-toolbar {
    background: #fff;
    border-bottom: 1px solid #ccc;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    z-index: 10;
    /* Ensure toolbar stays above content */
    position: relative; }
    .tiptap-container .tiptap-toolbar .toolbar-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 4px;
      padding: 2px 0; }
    .tiptap-container .tiptap-toolbar .btn-group {
      margin-right: 5px;
      display: flex; }
      .tiptap-container .tiptap-toolbar .btn-group .btn {
        background: transparent;
        border: 1px solid transparent;
        border-radius: 3px;
        padding: 4px 8px;
        cursor: pointer;
        color: #333;
        font-size: 14px;
        line-height: 1.4; }
        .tiptap-container .tiptap-toolbar .btn-group .btn:hover {
          background: #e0e0e0;
          border-color: #bbb; }
        .tiptap-container .tiptap-toolbar .btn-group .btn.is-active {
          background: #d0d0d0;
          border-color: #aaa;
          box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); }
        .tiptap-container .tiptap-toolbar .btn-group .btn i {
          pointer-events: none; }
  .tiptap-container .editor-content {
    padding: 15px;
    min-height: 300px;
    height: 450px;
    outline: none;
    overflow-y: auto;
    /* Mimic basic document typography */ }
    .tiptap-container .editor-content .ProseMirror {
      outline: none;
      font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-size: 14px;
      line-height: 1.6;
      /* Placeholder styling */ }
      .tiptap-container .editor-content .ProseMirror p {
        margin-bottom: 1em; }
      .tiptap-container .editor-content .ProseMirror h1, .tiptap-container .editor-content .ProseMirror h2, .tiptap-container .editor-content .ProseMirror h3, .tiptap-container .editor-content .ProseMirror h4, .tiptap-container .editor-content .ProseMirror h5, .tiptap-container .editor-content .ProseMirror h6 {
        margin-top: 1em;
        margin-bottom: 0.5em;
        font-weight: 600;
        display: block;
        width: 100%; }
      .tiptap-container .editor-content .ProseMirror ul, .tiptap-container .editor-content .ProseMirror ol {
        padding-left: 2em;
        margin-bottom: 1em; }
      .tiptap-container .editor-content .ProseMirror blockquote {
        border-left: 3px solid #eee;
        padding-left: 1em;
        margin-left: 0;
        color: #666; }
      .tiptap-container .editor-content .ProseMirror img {
        max-width: 100%;
        height: auto; }
        .tiptap-container .editor-content .ProseMirror img.ProseMirror-selectednode {
          outline: 3px solid #68cef8; }
      .tiptap-container .editor-content .ProseMirror .image-resizer {
        display: inline-flex;
        position: relative; }
        .tiptap-container .editor-content .ProseMirror .image-resizer.ProseMirror-selectednode {
          outline: 3px solid #68cef8; }
        .tiptap-container .editor-content .ProseMirror .image-resizer .image-resizer-handler {
          position: absolute;
          width: 10px;
          height: 10px;
          background-color: #68cef8;
          border: 1px solid white;
          border-radius: 50%;
          z-index: 10; }
          .tiptap-container .editor-content .ProseMirror .image-resizer .image-resizer-handler.top-left {
            top: -5px;
            left: -5px;
            cursor: nwse-resize; }
          .tiptap-container .editor-content .ProseMirror .image-resizer .image-resizer-handler.top-right {
            top: -5px;
            right: -5px;
            cursor: nesw-resize; }
          .tiptap-container .editor-content .ProseMirror .image-resizer .image-resizer-handler.bottom-left {
            bottom: -5px;
            left: -5px;
            cursor: nesw-resize; }
          .tiptap-container .editor-content .ProseMirror .image-resizer .image-resizer-handler.bottom-right {
            bottom: -5px;
            right: -5px;
            cursor: nwse-resize; }
      .tiptap-container .editor-content .ProseMirror a {
        color: #337ab7;
        cursor: pointer; }
      .tiptap-container .editor-content .ProseMirror p.is-editor-empty:first-child::before {
        color: #adb5bd;
        content: attr(data-placeholder);
        float: left;
        height: 0;
        pointer-events: none; }

/* Nested Dropdown Styles */
.dropdown-submenu {
  position: relative; }
  .dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    border-radius: 0 6px 6px 6px;
    z-index: 1001;
    /* Ensure high z-index */ }
  .dropdown-submenu:hover > .dropdown-menu {
    display: block; }
  .dropdown-submenu > a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-left-color: #ccc;
    margin-top: 5px;
    margin-right: -10px; }
  .dropdown-submenu:hover > a:after {
    border-left-color: #fff; }
  .dropdown-submenu.pull-left {
    float: none; }
    .dropdown-submenu.pull-left > .dropdown-menu {
      left: -100%;
      margin-left: 10px;
      border-radius: 6px 0 6px 6px; }

/* Color Palette Menu */
.color-palette-menu {
  padding: 10px;
  width: 230px; }
  .color-palette-menu .color-palette-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    margin-bottom: 10px; }
    .color-palette-menu .color-palette-grid .color-palette-cell {
      width: 18px;
      height: 18px;
      border: 1px solid #ddd;
      cursor: pointer;
      border-radius: 2px; }
      .color-palette-menu .color-palette-grid .color-palette-cell:hover {
        border-color: #666;
        transform: scale(1.1); }
      .color-palette-menu .color-palette-grid .color-palette-cell.remove-color {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: #666;
        background-color: #fff; }
  .color-palette-menu .color-palette-actions {
    border-top: 1px solid #eee;
    padding-top: 5px;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center; }
    .color-palette-menu .color-palette-actions label {
      margin-bottom: 0;
      font-weight: normal;
      font-size: 12px;
      cursor: pointer;
      color: #337ab7; }
      .color-palette-menu .color-palette-actions label:hover {
        text-decoration: underline; }
