/* TipTap/ProseMirror Table Styles */

/* Basic table styling within the prose editor */
.ProseMirror table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 1rem 0;
    overflow: hidden;
}

.ProseMirror td,
.ProseMirror th {
    min-width: 1em;
    border: 2px solid #ced4da;
    padding: 0.5rem;
    vertical-align: top;
    box-sizing: border-box;
    position: relative;
}

.ProseMirror th {
    font-weight: bold;
    text-align: left;
    background-color: #f8f9fa;
}

.ProseMirror .selectedCell:after {
    z-index: 2;
    position: absolute;
    content: "";
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(13, 110, 253, 0.1);
    pointer-events: none;
}

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

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

/* Table wrapper for better control */
.tableWrapper {
    overflow-x: auto;
    margin: 1rem 0;
}

/* Dark mode support */
body.dark-mode .ProseMirror td,
body.dark-mode .ProseMirror th {
    border-color: #495057;
}

body.dark-mode .ProseMirror th {
    background-color: #343a40;
}

/* Rendered content (not in editor) */
.prose-editor-output table,
.prose-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.prose-editor-output td,
.prose-editor-output th,
.prose-content td,
.prose-content th {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
}

.prose-editor-output th,
.prose-content th {
    font-weight: bold;
    background-color: #f8f9fa;
}

body.dark-mode .prose-editor-output td,
body.dark-mode .prose-editor-output th,
body.dark-mode .prose-content td,
body.dark-mode .prose-content th {
    border-color: #495057;
}

body.dark-mode .prose-editor-output th,
body.dark-mode .prose-content th {
    background-color: #343a40;
}
