.tiptap-container {
    padding: 8px;
    border: 1px solid #aaa;
    border-radius: 4px;
    position: relative;

    textarea {
        top: 0px;
        left: 0px;
        width: 100%;
        height: 100px;
    }

    .ProseMirror {
        h1 {
            font-size: 1.5em;
            font-weight: 700;
            margin-top: 2em;
            margin-bottom: 0px;
        }

        h2 {
            font-size: 1.25em;
            font-weight: 700;
            margin-top: 1.5em;
            margin-bottom: 0px;
        }

        h3 {
            font-size: 1.125em;
            font-weight: 600;
            margin-top: 1em;
            margin-bottom: 0px;
        }

        h4 {
            font-size: 1em;
            font-weight: 600;
            margin-top: 1em;
            margin-bottom: 0px;
        }
    }
}

.tiptap-content {
    max-height: 50vh;
    overflow: auto;
}

.tiptap-toolbar {
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;

    .toolbar-block:not(:last-child) {
        border-right: 1px solid #ddd;
    }

    .toolbar-block {
        display: inline-flex;
        gap: 2px;
        margin-right: 6px;
        padding-right: 6px;
    }

    i:hover {
        background: #e6e6e6;
        border-radius: 4px;
    }

    i.disabled {
        opacity: 0.4;
    }

    i {
        padding: 6px;
        user-select: none;
        cursor: pointer;
        min-width: 24px;
        text-align: center;
    }

    i.active {
        background: #f2f2f2;
        color: rgb(0, 121, 56);
    }

    label > input[type="file"] {
        display: none;
    }
}

/* Basic editor styles */
.tiptap {
    outline: none !important;
    margin: 1.25rem;
    font-size: 14px;

    :first-child {
        margin-top: 0;
    }

    p {
        margin-bottom: 0.5rem;
    }

    /* List styles */
    ul,
    ol {
        padding: 0 1rem;
        margin: 1.25rem 1rem 1.25rem 0.4rem;
        
        li p {
            margin-top: 0.25em;
            margin-bottom: 0.25em;
        }
    }

    ul {
        list-style: disc;
    }

    ol {
        list-style: auto;
    }

    /* Task list specific styles */
    ul[data-type='taskList'] {
        list-style: none;
        margin-left: 0;
        padding: 0;

        li {
            align-items: flex-start;
            display: flex;

            & > label {
                flex: 0 0 auto;
                margin-right: 0.5rem;
                user-select: none;
            }

            & > div {
                flex: 1 1 auto;
            }
        }

        input[type='checkbox'] {
            cursor: pointer;
        }

        ul[data-type='taskList'] {
            margin: 0;
        }
    }

    /* Horizontal break */
    hr {
        border-color: black;
    }

    /* Required value */
    [data-required="true"] {
        border: 2px dashed red; 
        padding: 2px 4px; 
        background-color: #ffff96
    }

    table {
        border-collapse: collapse;
        margin: 0;
        overflow: hidden;
        table-layout: fixed;
        width: 100%;

        td, th {
            border: 1px solid rgba(61, 37, 20, .12);
            box-sizing: border-box;
            min-width: 1em;
            padding: 6px 8px;
            position: relative;
            vertical-align: top;

            & > * {
                margin-bottom: 0;
            }
        }

        th {
            background-color: rgba(61, 37, 20, .05);
            font-weight: bold;
            text-align: left;
        }

        .selectedCell:after {
            background: rgba(61, 37, 20, .08);
            content: '';
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            pointer-events: none;
            position: absolute;
            z-index: 2;
        }

        .column-resize-handle {
            background-color: #6a00f5;
            bottom: -2px;
            pointer-events: none;
            position: absolute;
            right: -2px;
            top: 0;
            width: 4px;
        }
    }

    .tableWrapper {
        margin: 1.5rem 0;
        overflow-x: auto;
    }

    &.resize-cursor {
        cursor: col-resize;
    }

    img {
        display: block;
        height: auto;
        margin: 1.5rem auto !important;
        max-width: 100%;

        &.ProseMirror-selectednode {
            outline: 3px solid #6a00f5;
        }
    }
}

.color-square {
    width: 20px;
    height: 20px;
    border: 1px solid rgb(221, 221, 221);
    border-radius: 4px;
    cursor: pointer;
}

.color-square:hover {
    filter: brightness(0.9);
}

.simple-dropdown {
    position: relative;
    display: inline-block;

    .simple-content {
        display: none;
        width: max-content;
        background: white;
        position: absolute;
        z-index: 3;
        padding: 8px 0px;
        border: 1px solid #d2d2d2;
        border-radius: 6px;
    }

    .simple-item {
        padding: 4px 16px;
        cursor: pointer;
    }

    .simple-item:hover {
        background: #e6e6e6
    }

    hr {
        margin: 4px 0px;
        border-color: #dddddd
    }
}

.tippy-box[data-animation=fade][data-state=hidden] {
    opacity: 0
}

[data-tippy-root] {
    max-width: calc(100vw - 10px)
}

.tippy-box {
    position: relative;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    outline: 0;
    transition-property: transform, visibility, opacity
}

.tippy-box[data-placement^=top]>.tippy-arrow {
    bottom: 0
}

.tippy-box[data-placement^=top]>.tippy-arrow:before {
    bottom: -7px;
    left: 0;
    border-width: 8px 8px 0;
    border-top-color: initial;
    transform-origin: center top
}

.tippy-box[data-placement^=bottom]>.tippy-arrow {
    top: 0
}

.tippy-box[data-placement^=bottom]>.tippy-arrow:before {
    top: -7px;
    left: 0;
    border-width: 0 8px 8px;
    border-bottom-color: initial;
    transform-origin: center bottom
}

.tippy-box[data-placement^=left]>.tippy-arrow {
    right: 0
}

.tippy-box[data-placement^=left]>.tippy-arrow:before {
    border-width: 8px 0 8px 8px;
    border-left-color: initial;
    right: -7px;
    transform-origin: center left
}

.tippy-box[data-placement^=right]>.tippy-arrow {
    left: 0
}

.tippy-box[data-placement^=right]>.tippy-arrow:before {
    left: -7px;
    border-width: 8px 8px 8px 0;
    border-right-color: initial;
    transform-origin: center right
}

.tippy-box[data-inertia][data-state=visible] {
    transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)
}

.tippy-arrow {
    width: 16px;
    height: 16px;
    color: #333
}

.tippy-arrow:before {
    content: "";
    position: absolute;
    border-color: transparent;
    border-style: solid
}

.tippy-content {
    position: relative;
    padding: 5px 9px;
    z-index: 1
}