/* Basic editor styling */
.ProseMirror {
    min-height: 300px;
    padding: 10px;
    outline: none;
}

/* Image styling */
.ProseMirror img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ProseMirror img.tiptap-image {
    cursor: pointer;
}

.ProseMirror img.tiptap-image:hover {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.ProseMirror img.ProseMirror-selectednode {
    outline: 3px solid #68cef8;
    border-radius: 4px;
}

/* Table styling */
.ProseMirror table {
    border-collapse: collapse;
    margin: 20px 0;
    width: 100%;
    position: relative;
}

.ProseMirror th,
.ProseMirror td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    position: relative;
}

.ProseMirror th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.ProseMirror tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Styling for cells with rowspan/colspan */
.ProseMirror td[colspan],
.ProseMirror th[colspan] {
    text-align: center;
    background-color: #f0f7ff;
}

.ProseMirror td[rowspan],
.ProseMirror th[rowspan] {
    vertical-align: middle;
    background-color: #f0f7ff;
}

.ProseMirror td[rowspan][colspan],
.ProseMirror th[rowspan][colspan] {
    background-color: #e1f0ff;
    font-weight: 500;
}

/* Selected table styling */
.ProseMirror table.has-focus {
    outline: 2px solid #4dabf7;
}

/* Table resizing */
.ProseMirror .tableWrapper {
    overflow-x: auto;
}

.ProseMirror .column-resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #0096fd;
    pointer-events: none;
}

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

.ProseMirror.dragging .column-resize-handle {
    background-color: #68cef8;
    opacity: 0.5;
}

/* Nested table styling */
.ProseMirror td .tableWrapper,
.ProseMirror th .tableWrapper {
    margin: 5px 0;
}

.ProseMirror td table,
.ProseMirror th table {
    width: 100%;
    border: 2px solid #aaa; /* Make nested tables visually distinct */
}

.ProseMirror td table td,
.ProseMirror th table td,
.ProseMirror td table th,
.ProseMirror th table th {
    background-color: #f8f8f8; /* Slightly different background for nested tables */
}

/* Editor container */
.editor-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Editor content wrapper */
.editor-content-wrapper {
    border: 1px solid #ccc;
    border-radius: 4px;
    position: relative;
}

/* List styles for Tiptap (Tailwind compatibility) */
.ProseMirror ul {
    padding-left: 1.5rem; /* Adjust indentation as needed */
    list-style-type: disc;
}

.ProseMirror ol {
    padding-left: 1.5rem; /* Adjust indentation as needed */
    list-style-type: decimal;
}

/* Optional: Adjust paragraph spacing within list items if needed */

/* .ProseMirror ul li p,
.ProseMirror ol li p {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
} */

/* Heading styles for Tiptap (Tailwind compatibility) */
.ProseMirror h1 {
    font-size: 2em;
    font-weight: bold;
    margin-top: 0.67em;
    margin-bottom: 0.67em;
}

.ProseMirror h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 0.83em;
    margin-bottom: 0.83em;
}

.ProseMirror h3 {
    font-size: 1.17em;
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 1em;
}

.ProseMirror h4 {
    font-size: 1em;
    font-weight: bold;
    margin-top: 1.33em;
    margin-bottom: 1.33em;
}

.ProseMirror h5 {
    font-size: 0.83em;
    font-weight: bold;
    margin-top: 1.67em;
    margin-bottom: 1.67em;
}

.ProseMirror h6 {
    font-size: 0.67em;
    font-weight: bold;
    margin-top: 2.33em;
    margin-bottom: 2.33em;
}
