/* === highlight-within-textarea – MudBlazor aligned overlay === */

/* match MudTextField or Bootstrap textarea metrics */
:root {
    --hwt-padding-block: .375rem; /* top/bottom */
    --hwt-padding-inline: .75rem; /* left/right */
}

/* base container */
.hwt-container {
    position: relative;
    display: block;
    -webkit-text-size-adjust: none;
}

/* overlay behind textarea */
.hwt-backdrop {
    position: absolute;
    inset: 0; /* top/right/bottom/left: 0 */
    overflow: hidden;
    pointer-events: none;
    background: transparent;
    z-index: 0; /* ensure it sits behind textarea */
}

/* both layers share exact font/padding */
.hwt-highlights,
.hwt-input {
    box-sizing: border-box;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    word-spacing: inherit;
    text-indent: inherit;
    text-transform: inherit;
    padding: var(--hwt-padding-block) var(--hwt-padding-inline);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* invisible text; only <mark> backgrounds show */
.hwt-highlights {
    color: transparent;
}

/* textarea on top with transparent background */
.hwt-input {
    position: relative;
    background: transparent !important;
    overflow-x: hidden;
    z-index: 1;
}

/* MudBlazor multiline textfield compatibility */
.hwt-container .mud-input-slot > textarea {
    background: transparent !important;
}

/* mark styling – minimal to keep lines aligned */
.hwt-content mark {
    padding: 0;
    border-radius: 3px;
    color: inherit;
}

    /* highlight colors */
    .hwt-content mark.red {
        background-color: #ffc9c9 !important;
    }

    .hwt-content mark.blue {
        background-color: #a3daff !important;
    }

    .hwt-content mark.yellow {
        background-color: #ffec99 !important;
    }

/* optional toggle button if you use one */
.highlightToggle {
    color: #fff;
    background-color: #003140;
    cursor: default;
    z-index: 1000000;
    width: 70px;
    height: 46px;
    display: block;
    opacity: .65;
    position: fixed;
    right: -1px;
    bottom: 10px;
}

    .highlightToggle .btn-primary {
        font-size: .69rem;
        background: none;
        border: none;
        width: 70px;
        height: 50px;
    }

/* Lift above VR chrome */
body:has(#speechBarContainer) .highlightToggle,
body.vr-element .highlightToggle {
    bottom: 75px;
}

/* === overrides to make HWT layers fill MudBlazor control height (custom classes only) === */
.hwt-container {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.hwt-backdrop {
    width: 100%;
    height: 100%;
}

.hwt-highlights {
    height: 100%;
    min-height: 100%;
}

.hwt-input {
    width: 100%;
    height: 100% !important;
    min-height: 100%;
    resize: none;
    display: block;
}
