﻿button.ql-table-better > svg > path {
    opacity: 1;
    fill: var(--quill-dark-text-color);
}
button.ql-table-better > svg > path:hover {
    opacity: 1;
    fill: var(--quill-hover-fg-color);
}
button.ql-table-better > svg:hover > path {
    opacity: 1;
    fill: var(--quill-hover-fg-color);
}

.ql-table-dropdown > span.ql-table-tooltip-hover > svg > path {
    fill: var(--quill-dark-text-color);
}



/* Überschreiben der Selektions-Hintergründe */
.ql-cell-selected-after,
.ql-cell-selected::after,
.ql-cell-focused::after {
    content: "";
    pointer-events: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--quill-selection-bg-color, rgba(158,207,250,0.3));
}

/* Container, Dropdowns & Co. */
.ql-table-border-shadow,
.ql-table-select-container,
.ql-table-dropdown-list,
.ql-table-dropdown-properties-list,
.ql-table-menus-container {
    border-radius: var(--mud-border-radius, 2px);
    border: 1px solid var(--quill-border-color, #ccced1);
    background: var(--quill-bg-color, #fff);
    box-shadow: var(--mud-box-shadow, 0 1px 2px 1px rgba(0,0,0,0.15));
}

/* Dreiecke und Tooltips (transparente Basis) */
.ql-table-triangle-common,
.ql-table-tooltip-error::before,
.label-field-view-status::before,
.ql-table-tooltip::before,
.ql-table-triangle-down:not(.ql-table-triangle-none)::after,
.ql-table-triangle-down:not(.ql-table-triangle-none)::before,
.ql-table-triangle-up:not(.ql-table-triangle-none)::after,
.ql-table-triangle-up:not(.ql-table-triangle-none)::before {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    content: "";
    border: 10px solid rgba(0,0,0,0);
}

/* Fokus, Auswahl und Eingabefelder */
.ql-table-input-focus,
.ql-table-color-container .color-picker .color-picker-select > .erase-container,
.ql-table-selected,
.ql-table-properties-form .ql-table-dropdown-selected,
.ql-table-properties-form .ql-table-color-selected,
.ql-table-input:focus,
.ql-table-color-container .label-field-view-color .property-input:focus,
.ql-table-properties-form .property-input:focus {
    border: 1px solid var(--quill-focus-border-color, #3779eb);
    box-shadow: 0 0 0 3px var(--quill-focus-box-shadow-color, #cae1fc);
}

.ql-table-input,
.ql-table-color-container .label-field-view-color .property-input,
.ql-table-properties-form .property-input {
    width: 80px;
    height: 30px;
    border: 1px solid var(--quill-border-color, #ccced1);
    outline: none;
    padding-left: 6px;
    background: inherit;
}

    .ql-table-input:focus::placeholder,
    .ql-table-color-container .label-field-view-color .property-input:focus::placeholder,
    .ql-table-properties-form .property-input:focus::placeholder {
        color: rgba(0,0,0,0);
    }

    .ql-table-input:focus + label,
    .ql-table-color-container .label-field-view-color .property-input:focus + label,
    .ql-table-properties-form .property-input:focus + label,
    .ql-table-input:not(:placeholder-shown) + label,
    .ql-table-color-container .label-field-view-color .property-input:not(:placeholder-shown) + label,
    .ql-table-properties-form .property-input:not(:placeholder-shown) + label {
        display: block;
    }

.ql-table-temporary {
    display: none;
}

/* Zentrierte Elemente */
.ql-table-center,
.ql-table-select-container .ql-table-select-list,
.ql-table-select-container,
.ql-table-color-container .color-picker .color-picker-palette .color-picker-wrap .iro-container,
.ql-table-color-container .color-picker,
.ql-table-properties-form .properties-form-action-row > button,
.ql-operate-line-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Selektierte Bereiche mit Hintergrundbild */
.ql-table-selected,
.ql-table-properties-form .ql-table-dropdown-selected,
.ql-table-properties-form .ql-table-color-selected {
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAM1BMVEUAAAAyMjIyMjIiIiIyMjIyMjIyMjIyMjIxMTEyMjIyMjIyMjIwMDAzMzMxMTEwMDAzMzOYbpUsAAAAEXRSTlMA/XgF8HRua2fm2rI3rzk1Lf2cC1oAAAA8SURBVBjTY6AUsHKh8RnZ8PKZoHwBZhifHcLg5GVG4TPwsXAzQ/gwwAMUYWLkALIQIlxgPgLwc3JQ4h0Ae0ABBy2kuXoAAAAASUVORK5CYII=);
    background-repeat: no-repeat;
    background-size: 16px;
    box-sizing: border-box;
}

/* Operate Line & Blocks */
.ql-operate-line-container {
    position: absolute;
    z-index: 10;
}

    .ql-operate-line-container .ql-operate-line {
        background-color: var(--quill-primary-color, #0589f3);
    }

.ql-operate-block {
    position: absolute;
    z-index: 10;
    border: 1px solid var(--quill-border-color, #979797);
    cursor: nwse-resize;
}

.ql-operate-block-move {
    cursor: crosshair;
    border: none;
}

.ql-operate-drag-table {
    border: 1px dashed var(--quill-border-color, #000);
    position: absolute;
}

/* Fokussierte Zellen */
.ql-cell-focused {
    position: relative;
}

    .ql-cell-focused::after {
        border: 1px solid var(--quill-focus-border-color, #3779eb);
    }

.ql-cell-selected {
    position: relative;
}

/* Menüs und Dropdowns */
.ql-table-menus-container {
    position: absolute;
    display: flex;
    align-items: center;
    height: 40px;
    width: fit-content;
    padding: 4px;
    box-sizing: border-box;
    z-index: 1;
}

.ql-table-triangle-up:not(.ql-table-triangle-none)::before {
    bottom: -20px;
    border-top-color: var(--quill-tooltip-shadow-color, rgba(0,0,0,0.15)) !important;
}

.ql-table-triangle-up:not(.ql-table-triangle-none)::after {
    bottom: -19px;
    border-top-color: var(--quill-bg-color, #fff) !important;
}

.ql-table-triangle-down:not(.ql-table-triangle-none)::before {
    top: -20px;
    border-bottom-color: var(--quill-tooltip-shadow-color, rgba(0,0,0,0.15)) !important;
}

.ql-table-triangle-down:not(.ql-table-triangle-none)::after {
    top: -19px;
    border-bottom-color: var(--quill-bg-color, #fff) !important;
}

/* Label-Felder & Status */
.label-field-view {
    position: relative;
}

.label-field-view-input-wrapper {
    position: relative;
    height: 100%;
}

    .label-field-view-input-wrapper > label {
        position: absolute;
        left: 0;
        top: -50%;
        transform: translateY(50%) scale(0.75);
        color: var(--mud-palette-text-secondary, #999);
        background: var(--quill-bg-color, #fff);
        display: none;
    }

.label-field-view-status {
    max-width: 160px;
    width: max-content;
}

/* Fehlerhafte Eingaben */
.label-field-view-error > input {
    border-color: var(--quill-error-color, #db3700) !important;
    animation: ql-table-input-shake 0.3s ease both;
}

    .label-field-view-error > input:focus {
        box-shadow: 0 0 0 3px var(--quill-error-box-shadow-color, rgba(255,64,31,0.3)) !important;
    }

.label-field-view-error > label {
    color: var(--quill-error-color, #db3700);
}

/* Dropdowns */
.ql-table-dropdown,
.ql-table-dropdown-properties {
    display: flex;
    height: 100%;
    align-items: center;
    position: relative;
    padding: 0 4px;
}

    .ql-table-dropdown:hover,
    .ql-table-dropdown-properties:hover {
        background: var(--quill-hover-bg-color, #f0f0f0);
    }

.ql-table-dropdown-text,
.ql-table-dropdown-properties-text {
    flex: 1;
    height: 100%;
    margin-right: 7px;
    display: flex;
    align-items: center;
}

/* Dropdown-Listen */
.ql-table-dropdown-list,
.ql-table-dropdown-properties-list {
    position: absolute;
    left: 0;
    bottom: 0;
    transform: translateY(100%);
    margin: 0;
    padding: 0;
    width: 170px;
    z-index: 10;
}

    .ql-table-dropdown-list li,
    .ql-table-dropdown-properties-list li {
        list-style: none;
        line-height: 30px;
        padding-left: 10px;
    }

        .ql-table-dropdown-list li:hover,
        .ql-table-dropdown-properties-list li:hover {
            background-color: var(--quill-hover-bg-color, #f0f0f0);
        }

.ql-table-dropdown-label,
.ql-table-dropdown-properties-label {
    width: 100%;
    min-width: 100%;
    line-height: 24px;
    font-weight: bold;
    margin-bottom: 6px;
    display: block;
}

/* Tooltips */
.ql-table-tooltip-hover {
    display: flex;
    position: relative;
}

    .ql-table-tooltip-hover:hover .ql-table-tooltip,
    .ql-table-tooltip-hover:hover + .ql-table-tooltip {
        display: block;
    }

.ql-table-tooltip {
    font-size: 12px;
    min-width: 32px;
    line-height: 20px;
    padding: 6px;
    white-space: nowrap;
    color: var(--quill-tooltip-text-color, #fff);
    text-align: center;
    word-wrap: break-word;
    background: var(--quill-tooltip-bg-color, rgba(0,0,0,0.85));
    border-radius: var(--quill-tooltip-border-radius, 6px);
    position: absolute;
    z-index: 11;
    left: 50%;
    bottom: -10px;
    transform: translate(-50%, 100%);
}

    .ql-table-tooltip::before {
        border-bottom-color: var(--quill-tooltip-bg-color, rgba(0,0,0,0.85)) !important;
        top: -20px;
    }

    .ql-table-tooltip:hover {
        display: block;
    }

.ql-table-tooltip-hidden {
    display: none !important;
}

/* Tooltip Fehler & Status */
.ql-table-tooltip-error,
.label-field-view-status {
    font-size: 12px;
    min-width: 32px;
    line-height: 20px;
    padding: 6px;
    white-space: nowrap;
    color: var(--quill-tooltip-text-color, #fff);
    text-align: center;
    word-wrap: break-word;
    background: var(--quill-error-color, #db3700);
    border-radius: var(--quill-tooltip-border-radius, 6px);
    position: absolute;
    z-index: 9;
    left: 50%;
    bottom: -10px;
    transform: translate(-50%, 100%);
    white-space: pre-wrap;
}

    .ql-table-tooltip-error::before,
    .label-field-view-status::before {
        border-bottom-color: var(--quill-error-color, #db3700) !important;
        top: -20px;
    }

    .ql-table-tooltip-error:hover,
    .label-field-view-status:hover {
        display: block;
    }

.ql-table-tooltip-error-hidden {
    display: none !important;
}

/* Dropdown Properties */
.ql-table-dropdown-properties {
    width: 80px;
    height: 30px;
    border: 1px solid var(--quill-border-color, #ccced1);
    box-sizing: border-box;
}

    .ql-table-dropdown-properties:hover {
        background: none;
    }

/* Table Properties Form */
.ql-table-properties-form {
    width: 320px;
    position: absolute;
    left: 50%;
    padding-bottom: 8px;
    background: var(--quill-bg-color, #fff);
    z-index: 1;
    box-shadow: var(--mud-box-shadow, 0 1px 2px 1px var(--quill-border-color, #ccced1));
}

    .ql-table-properties-form .properties-form-header {
        height: 40px;
        line-height: 40px;
        padding: 0 12px;
        border-bottom: 1px solid var(--quill-border-color, #ccced1);
        margin: 0;
        box-sizing: border-box;
        color: var(--mud-palette-text-primary, #333);
        font-size: 14px;
    }

    .ql-table-properties-form .properties-form-row {
        display: flex;
        flex-wrap: wrap;
        padding: 8px 12px;
        justify-content: space-between;
    }

        .ql-table-properties-form .properties-form-row .ql-table-check-container {
            display: flex;
            border: 1px solid var(--quill-border-color, #ccced1);
            align-items: center;
        }

            .ql-table-properties-form .properties-form-row .ql-table-check-container .ql-table-tooltip-hover {
                padding: 6px 10px;
                cursor: pointer;
            }

                .ql-table-properties-form .properties-form-row .ql-table-check-container .ql-table-tooltip-hover:hover {
                    background: var(--quill-hover-bg-color, #f0f0f0);
                }

            .ql-table-properties-form .properties-form-row .ql-table-check-container .ql-table-btns-checked {
                background: var(--quill-btn-checked-bg-color, #f0f7ff);
            }

                .ql-table-properties-form .properties-form-row .ql-table-check-container .ql-table-btns-checked > svg path {
                    stroke: var(--quill-btn-checked-stroke-color, #2977ff);
                }

    .ql-table-properties-form .properties-form-row-full .ql-table-color-container {
        width: 100%;
    }

        .ql-table-properties-form .properties-form-row-full .ql-table-color-container .property-input {
            width: 100%;
        }

    .ql-table-properties-form .properties-form-action-row {
        display: flex;
        justify-content: space-around;
        padding: 0 12px;
    }

        .ql-table-properties-form .properties-form-action-row > button {
            background: var(--quill-bg-color, #fff);
            outline: none;
            border: none;
            height: 30px;
            cursor: pointer;
            flex: 1;
        }

            .ql-table-properties-form .properties-form-action-row > button > span {
                margin: 0 2px;
                display: flex;
            }

            .ql-table-properties-form .properties-form-action-row > button:hover {
                background: var(--quill-hover-bg-color, #f0f0f0);
            }

            .ql-table-properties-form .properties-form-action-row > button[disabled] {
                background-color: rgba(0,0,0,0);
            }

    .ql-table-properties-form .ql-table-color-selected {
        background-position: center;
    }

    .ql-table-properties-form .ql-table-dropdown-selected {
        background-position: calc(100% - 10px) center;
    }

/* Table Color Container */
.ql-table-color-container {
    border: 1px solid var(--quill-border-color, #ccced1);
    height: 30px;
    box-sizing: border-box;
    display: flex;
}

    .ql-table-color-container .label-field-view-color {
        flex: 1;
    }

        .ql-table-color-container .label-field-view-color .property-input {
            border: 1px solid rgba(0,0,0,0);
            height: 100%;
        }

    .ql-table-color-container .color-picker {
        width: 30px;
        border-left: 1px solid var(--quill-border-color, #ccced1);
        box-sizing: border-box;
        position: relative;
    }

        .ql-table-color-container .color-picker .color-button {
            width: 20px;
            height: 20px;
            border: 1px solid var(--quill-border-color, #ccced1);
            box-sizing: border-box;
            cursor: pointer;
            position: relative;
        }

        .ql-table-color-container .color-picker .color-unselected {
            position: relative;
        }

            .ql-table-color-container .color-picker .color-unselected::after {
                content: "";
                position: absolute;
                width: 1px;
                height: 26px;
                background: var(--quill-unselected-color, red);
                transform-origin: 50%;
                transform: rotate(45deg);
                left: 50%;
                top: -4px;
            }

        .ql-table-color-container .color-picker .color-picker-select {
            position: absolute;
            right: 0;
            bottom: 0;
            width: 156px;
            transform: translateY(100%);
            background: var(--quill-bg-color, #fff);
            z-index: 10;
            box-shadow: var(--mud-box-shadow, 0 1px 2px 1px var(--quill-border-color, #ccced1));
        }

            .ql-table-color-container .color-picker .color-picker-select .erase-container {
                display: flex;
                height: 30px;
                align-items: center;
                padding: 0 12px;
                cursor: pointer;
            }

                .ql-table-color-container .color-picker .color-picker-select .erase-container:hover {
                    background: var(--quill-hover-bg-color, #f0f0f0);
                }

                .ql-table-color-container .color-picker .color-picker-select .erase-container > button {
                    border: none;
                    outline: none;
                    background: inherit;
                    height: 100%;
                    cursor: pointer;
                }

            .ql-table-color-container .color-picker .color-picker-select > .erase-container {
                margin-bottom: 4px;
            }

            .ql-table-color-container .color-picker .color-picker-select .color-list {
                display: flex;
                flex-wrap: wrap;
                padding: 0 12px;
                margin: 0;
                justify-content: space-between;
            }

                .ql-table-color-container .color-picker .color-picker-select .color-list > li {
                    list-style: none;
                    width: 24px;
                    height: 24px;
                    margin: 2px 0;
                    position: relative;
                    cursor: pointer;
                }

                    .ql-table-color-container .color-picker .color-picker-select .color-list > li[data-color="#ffffff"] {
                        border: 1px solid var(--quill-border-color, #ccced1);
                        box-sizing: border-box;
                    }

        .ql-table-color-container .color-picker .color-picker-palette {
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            z-index: 1;
            background: var(--quill-bg-color, #fff);
        }

            .ql-table-color-container .color-picker .color-picker-palette .color-picker-wrap {
                width: 100%;
                height: 100%;
                display: flex;
                flex-direction: column;
            }

                .ql-table-color-container .color-picker .color-picker-palette .color-picker-wrap .iro-container {
                    flex: 1;
                }

/* Disabled States */
.ql-table-disabled {
    background: var(--quill-disabled-bg-color);
    color: var(--quill-disabled-fg-color) !important;
    pointer-events: none;
}

.ql-table-button-disabled {
    background: var(--quill-disabled-bg-color) !important;
    color: var(--quill-disabled-fg-color) !important;
    pointer-events: none;
}

    .ql-table-button-disabled svg .ql-fill {
        fill: var(--mud-palette-text-secondary, #999) !important;
    }

    .ql-table-button-disabled svg .ql-stroke {
        stroke: var(--mud-palette-text-secondary, #999) !important;
    }

button.ql-table-better {
    position: relative;
}

/* Table Select Container */
.ql-table-select-container {
    flex-direction: column;
    width: 190px;
    padding: 2px;
    position: absolute;
    top: 24px;
    z-index: 10;
    box-sizing: border-box;
}

    .ql-table-select-container .ql-table-select-list {
        flex-wrap: wrap;
    }

    .ql-table-select-container .ql-table-select-label {
        width: 100%;
        line-height: 16px;
        text-align: center;
        color: var(--quill-select-label-color, rgba(34,47,62,0.7));
        margin-top: 2px;
    }

    .ql-table-select-container span {
        width: 16px;
        height: 16px;
        border: 1px solid var(--quill-border-color, #000);
        box-sizing: border-box;
        margin: 1px;
    }

/* Zähler & Keyframes */
ol.table-list-container {
    counter-reset: list-0;
}

@keyframes ql-table-input-shake {
    20% {
        transform: translateX(-2px);
    }

    40% {
        transform: translateX(2px);
    }

    60% {
        transform: translateX(-1px);
    }

    80% {
        transform: translateX(1px);
    }
}





/* Dialog für Table Properties */
.ql-table-properties-form {
    border: 1px solid var(--quill-border-color);
    /* Bestehende Styles beibehalten */
    width: 320px;
    position: absolute;
    left: 50%;
    padding-bottom: 8px;
    background: var(--quill-bg-color, #fff);
    z-index: 1;
    box-shadow: var(--mud-box-shadow, 0 1px 2px 1px rgba(0,0,0,0.15));
}

/* Falls ein separater Dialog für Cell Properties existiert, z.B.: */
.ql-cell-properties-form {
    border: 1px solid var(--quill-border-color);
    width: 320px;
    position: absolute;
    left: 50%;
    padding: 8px;
    background: var(--quill-bg-color, #fff);
    z-index: 1;
    box-shadow: var(--mud-box-shadow, 0 1px 2px 1px rgba(0,0,0,0.15));
}

/* ----------------------------------------
   3. Dialoge sollen „floating“ sein, resizable und per Drag move verschiebbar
---------------------------------------- */

.ql-table-properties-form,
.ql-cell-properties-form {
    resize: both;
    overflow: auto;
    cursor: move;
}
