.backbtn {
    display: inline-block;
    padding: calc(2 * var(--sjs-base-unit, var(--base-unit, 8px)))
        calc(6 * var(--sjs-base-unit, var(--base-unit, 8px)));
    background: var(
        --sjs-questionpanel-backcolor,
        var(
            --sjs-question-background,
            var(--sjs-general-backcolor, var(--background, #fff))
        )
    );
    box-shadow: var(--sjs-shadow-small, 0px 1px 2px 0px rgba(0, 0, 0, 0.15));
    border-radius: calc(1 * var(--sjs-corner-radius, 4px));
    cursor: pointer;
    font-family: var(--font-family, var(--font-family));
    font-style: normal;
    font-weight: 600;
    font-size: calc(1 * var(--sjs-font-size, 16px));
    line-height: calc(1.5 * var(--sjs-font-size, 16px));
    text-align: center;
    color: rgb(48 61 80);
    border: none;
    outline: none;
    text-decoration: none;
}

.cancle-confirm {
    background-color: #f1f6ff;
}

.backbtn.cancle-confirm:hover {
    background-color: #d9e6fd;
}

.cancle-and-delete {
    background-color: #fbbebe;
}

.backbtn.cancle-and-delete:hover {
    background-color: #faaaaa;
}

.backbtn:hover {
    background-color: #f1f6ff;
}

.cancle-btn-wrapper {
    width: 100%;
    height: 70px;
    padding-top: 10px;
    padding-left: 50px;
}

.test-run-wrapper {
    width: 100%;
}

.flex-container-completed {
    align-items: center;
    justify-content: center;
    margin-top: 25vh;
    height: auto;
}

.container-completed {
    overflow: auto;
    width: fit-content;
    margin: auto;
    background-color: #fff;
    box-shadow:
        0 0 0 1px hsla(230, 13%, 9%, 0.05),
        0 0.3px 0.4px hsla(230, 13%, 9%, 0.02),
        0 0.9px 1.5px hsla(230, 13%, 9%, 0.045),
        0 3.5px 6px hsla(230, 13%, 9%, 0.09);
    border-radius: 0.375em;
    padding: 50px;
    text-align: center;
}

.text-divider {
    margin: 0.5rem auto;
    display: flex;
    text-align: center;
    align-items: center;
}

.text-divider span {
    font-size: 0.9375rem;
    white-space: nowrap;
    padding: 0 1rem;
}

.text-divider::before,
.text-divider::after {
    content: "";
    display: inline-block;
    height: 1px;
    width: 20px;
    flex-grow: 1;
    background: hsl(240, 4%, 90%);
    vertical-align: middle;
}

.body_background {
    background-color: #f3f2f3;
}

em {
    font-style: italic !important;
}

mark {
    background-color: #e9e9e9;
    color: black;
    font-weight: bold;
}

line {
    text-decoration: underline;
}

[class*="--disabled"] {
    opacity: 0.9 !important;
}

.sd-question--disabled .sd-table__cell {
    opacity: 0.9 !important;
}

.sd-matrix__label:hover {
    background-color: #eaeaea;
    cursor: pointer;
}

/* Fix: SurveyJS v2.5.3 survey-core.css doesn't override inline
   min-width/width set by rowTitleWidth on mobile card layout */
.sd-question--mobile .sd-table__cell.sd-matrix__cell:first-of-type {
    min-width: 100% !important;
    width: 100% !important;
}

/* Fix: SurveyJS v2.5.3 survey-core.css doesn't show the cursor and hover when the matrix has numbers instead 
of options */
.sd-matrix__text:hover {
  background-color:#80808045!important;
  cursor:pointer;
}

/* ========================================================================================
   FLOATING STICKY HEADER FOR MATRIX QUESTIONS (JS clone approach)
   ========================================================================================
   Problem:  survey-core.css sets overflow-x:auto on .sd-question--table, which (per CSS spec)
             forces overflow-y to compute as auto too. This makes the question wrapper a scroll
             container, trapping any position:sticky descendants inside it so they never stick
             to the viewport. Additional ancestor scroll containers (.sv-scroll__scroller) make
             pure CSS solutions impossible.

   Solution: JavaScript creates a position:fixed clone of the matrix <thead> (only the <th>
             column labels, not the leading empty <td>). A scroll listener shows/hides the
             clone when the original thead leaves the viewport.

   Used in:  - run.blade.php        (test-taker view)  -> floater at top:0 (no offset)
             - survey_json.blade.php (creator preview)  -> floater at top:200px (below creator menu)

   The JS for both lives in their respective blade files, searching for "matrix-sticky-header-float".
   ======================================================================================== */

/* The fixed-position container that holds the cloned thead */
.matrix-sticky-header-float {
    padding-top: var(--sp-mm);
    background-color: inherit;
    position: fixed;
    top: 0; /* JS overrides this to 200px on the creator page */
    z-index: 1000;
    display: none; /* JS toggles to 'block' when the original thead scrolls out */
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    pointer-events: none; /* Clicks pass through to the real table below */
}

/* The cloned table uses fixed layout so explicit cell widths (set by JS) are respected */
.matrix-sticky-header-float table {
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}

/* Clone header cells: padding is zeroed out so that the width values synced from
   getBoundingClientRect() on the original cells map 1:1 (getBoundingClientRect includes
   padding, and with padding:0 + border-box the set width IS the full visual width). */
.matrix-sticky-header-float .sd-table__cell--header {
    background-color: var(
        --sjs-questionpanel-backcolor,
        var(--sjs-general-backcolor, var(--background, #fff))
    );
    padding: 0 !important;
    box-sizing: border-box;
}

.sd-progress__bar {
    height: 5px !important;
}

.sd-footer {
    justify-content: flex-end;
}

/* Custom styles for language selector */
#languageSelectorContainer {
}

.language-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 200px;
    /* Adjust based on your needs */
}

.language-icon {
    width: 20px;
    height: 20px;
}

#languageSelector {
    width: fit-content;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    font-size: 11px;
    color: #333;
    cursor: pointer;
    outline: none;
    /* Remove default select arrow in webkit browsers */
    -webkit-appearance: none;
    /* Remove default select arrow in Firefox */
    -moz-appearance: none;
    appearance: none;
    /* Add custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
    /* Make room for custom arrow */
}

#languageSelector:hover {
    border-color: #999;
}

#languageSelector:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.language_container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px;
    border-radius: 0.25em;
    /* margin: 0px 0px 0px 5px; */
    background-color: white;
    justify-content: flex-end;
}

#languageSelectorContainer {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 5;
}

.language_svg_icon {
    width: 25px;
    height: 25px;
}

.running {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#surveyElement {
    height: 100%;
}

#page-content {
    position: relative;
    min-height: 95vh;
    display: flex;
    flex-direction: column;
}

#surveyContainer {
    height: 100%;
}

.run-body {
    margin: 0;
    position: relative;
    background-color: var(--sjs-general-backcolor-dim);
    padding-bottom: 20px;
}

.main-class {
    position: relative;
}

.origin_ref {
    display: flex;
    font-size: 12px;
    justify-content: center;
    align-items: center;
    margin: 0px;
}

.run-sj-cstm-ol {
    list-style: auto !important;
    padding-left: var(--sp-x) !important;
    margin-bottom: var(--sp-mm)!important;
}

.run-sj-cstm-ul {
    list-style: disc !important;
    padding-left: var(--sp-x) !important;
    margin-bottom: var(--sp-mm)!important;
}

.run-sj-cstm-ol li,
.run-sj-cstm-ul li {
    margin-top: var(--sp-s) !important;
}

.ql-align-right{
    text-align: right!important;
}

.ql-align-center{
    text-align: center!important;
}

.ql-align-justify{
    text-align: justify!important;
}

@media (max-width: 767px) {
    .origin_ref {
        padding: 0 3em;
    }
}
