/** Utility Classes **/

.img-object-fit-cv {
    object-fit: cover;
}

/***********************************/

body {
    --ps-global-color-3:#3a4f66;
}

.select_exam_form option {
    display:none;
}

/* hide "Patient" field for the front end form because this should/must(?) not be changed */
#acf-form-wrapper div.acf-field[data-name="patient"] {
    display:none;
}

#create-new-therapist-form {
    display:none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0 10px 0 #d8d8d8;
    padding: 10px 42px 10px 42px;
}

/* eventuelle Lösung für Anzeige-Bug bei Unterschriften-Feld
.forminator-signature {
    display:block;
}*/


td[data-name="info_readonly"] textarea {
    display:none !important;
}

/*
//will distort the field...
.dsgvo-unterschrift canvas {
    min-width:100%;
}*/


/*
.user-label {
    font-weight: bold;
}*/


/*
Hide with CSS the input field of forminator form. Using a "hidden" field type isn't possible 
because the field value will be inserted by external Javascript and Forminator will
ignore values of hidden fields that are inserted/changed after the form intialization.
*/
.forminator-custom-form .spange-patient-id,
.forminator-custom-form .podo-patient-id,
.forminator-custom-form .podo-hp-patient-id {
    display:none;
}


.patient-acf-form .acf-form .acf-repeater .acf-icon.-minus,
.patient-acf-form .acf-form .acf-repeater .acf-row:hover > .acf-icon.-minus {
    display: none !important;
}


/* full calendar */

.appointment-calendar a.fc-event {
    color:#8223e3;
}

.appointment-calendar .fc-event-title {
    white-space:normal;
}

.appointment-calendar .fc-daygrid-dot-event {
    align-items:baseline;
}

/* Schedule X calendar */
#schedule-x-calendar {
    /* */
}



/* Fluent Forms */

.psff-hide-file-input .ff-el-input--content {
    display:none;
}

.psff-hidden {
    display:none;
}

/* data table */
.dt-search input {
    min-width: 300px;
    max-width: 400px;
    border-radius: 6px !important;
    border: 1px solid #d9d9d9 !important;
    padding: 10px 16px !important;
    height: 44px !important;
    font-size: 16px !important;
    background-color: #f5f5f5 !important;
    box-sizing: border-box !important;
}

/* Fix length menu layout - keep label inline with select */
.dt-length {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dt-length label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.dt-length select {
    margin: 0 8px;
}

/* Fix search label alignment */
.dt-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dt-search label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Pagination: Show page numbers, hide text buttons */
.dt-paging button.dt-paging-button:not(.current):not([data-dt-idx]) {
    display: none !important;
}

/* Hide "First", "Previous", "Next", "Last" text buttons */
.dt-paging button[aria-label="First"],
.dt-paging button[aria-label="Previous"],
.dt-paging button[aria-label="Next"],
.dt-paging button[aria-label="Last"],
.dt-paging button[aria-label="Erste"],
.dt-paging button[aria-label="Vorherige"],
.dt-paging button[aria-label="Nächste"],
.dt-paging button[aria-label="Letzte"] {
    display: none !important;
}

.ps-data-table-box.patients,
.ps-data-table-box.history-entries {
    visibility: hidden;
}

/* Vertikale Zentrierung für alle Zellen + feste Höhe */
.ps-data-table-box.history-entries table.ps-data-table tbody tr td {
    vertical-align: middle !important;
    height: 60px !important;
    padding: 8px 10px !important;
}

/* Status-Spalte mit Multiselect: Flexbox centering */
.ps-data-table-box.history-entries table.ps-data-table tbody tr td:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* Fix Issue #11: DataTables body should not restrict height when using pagination */
.dt-scroll-body {
    max-height: none !important;
    overflow-y: visible !important;
}


/* modal box */
.modal-bg {
    position:fixed;
    z-index:200; /* theme has elements below body with z-index=99 */
    width:100%;
    height:100%;
    left:0;
    top:0;
    overflow: auto; /*if scrolling is needed*/
    background-color:rgba(0,0,0, 0.15); /* leicht abgedunkelt, durchlässig */
    backdrop-filter: blur(2px); /* leichter Blur-Effekt */
}

.modal-box {
    background-color:white;
    margin:80px auto;
    padding:30px 40px;
    box-sizing:border-box;
    max-width:750px;
    border-radius:21px; /* abgerundet mit 21px Radius */
    box-shadow: 0px 2px 20px #99999933 !important;

}

.modal-box .close-modal {
    font-size:28px;
    font-weight:700;
    color:var(--ps-global-color-3);
}

.modal-box .close-modal:hover {
    cursor:pointer;
}

.modal-box header {
    text-align:right; /* close button on the right top */
}


/* bugfix: signature form field in modal box has width of zero */

.ff_modal_container .fluentform-signature-pad-wrapper {
    width:100%;
}

.ff_modal_container .fluentform-signature-pad {
    width:100% !important; /* because width:fit-content is set as inline styles */
}


/* Patient bearbeiten-Button als modale Box*/
.ff_modal_btn.btn-edit-patient {
    background-color: var(--tpgb-C4);
    padding: 10px;
    border-width: 1px;
    border-style: solid;
    border-color: var(--nxt-global-color-3);
    color: var(--nxt-global-color-3);
    border-radius: 4px;
    transition: all .3s linear;
}

/* .ff_modal_btn.btn-edit-patient:focus, */
.ff_modal_btn.btn-edit-patient:hover {
    background-color: var(--nxt-global-color-3);
    color: var(--nxt-global-color-5);
    transform: translateY(3px);
}

.ff_modal_btn.btn-edit-patient:before {
    content: "\f4fe"; /* person + cog wheel icon */
    font-weight: 900;
    font-family: "Font Awesome 5 Free";
    -webkit-font-smoothing: antialiased;
    text-rendering: auto;
    line-height: 100%;
    color: var(--nxt-global-color-3);
    display: inline-block;
    padding-right: 5px;
    transition: all .3s linear;
}

/* .ff_modal_btn.btn-edit-patient:focus:before, */
.ff_modal_btn.btn-edit-patient:hover:before {
    color: var(--nxt-global-color-5);
}


/* generic style for a modal button */
.ff_modal_btn.ps-modal-btn {
    background-color: var(--nxt-global-color-3);
    padding: 10px 16px;
    color: var(--stk-button-text-color);
    border-radius: 4px;
    border-width:0px;
    line-height:24px;
    transition: all .15s linear;
}

.ff_modal_btn.btn-new-patient:hover {
    filter: brightness(.9) contrast(1.2);
}


#new_patient_document_ui .ff_form_modal {
    display:none;
}

#new_patient_document_ui .ff_form_modal:has(.selected) {
    display:initial;
}

/* addtional styles for modifying Fluent Forms */

/* 🎨 UI Improvements: Modal Backdrop & Content (Issue #14) */
.lity {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(2px);
}

.lity-content,
.ff_modal_container {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.lity-wrap {
    animation: lityFadeIn 0.3s ease-in-out;
}

@keyframes lityFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media only screen and (min-width: 1100px) {
    .ff_landing_page_body .ff_landing_wrapper .ff_landing_form_wrapper:has(.fluentform_wrapper_18),
    .lity-content .ff_modal_container:has(.fluentform_wrapper_18) {
        width: 1000px;
        max-width: 1000px;
    }
}


@media only screen and (min-width: 1200px) {
    .ff_landing_page_body .ff_landing_wrapper .ff_landing_form_wrapper:has(.fluentform_wrapper_18),
    .lity-content .ff_modal_container:has(.fluentform_wrapper_18) {
        width: 1100px;
        max-width: 1100px;
    }
}

@media only screen and (min-width: 1400px) {
    .ff_landing_page_body .ff_landing_wrapper .ff_landing_form_wrapper:has(.fluentform_wrapper_18),
    .lity-content .ff_modal_container:has(.fluentform_wrapper_18) {
        width: 1300px;
        max-width: 1300px;
    }
}

/* bugfix of multi select Fluent Forms field */
.frm-fluent-form .choices .choices__list--dropdown {
    max-height: 310px;
}





/*combo multiselect - minimalistisches Design */

.combo-multiselect-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
}

.combo-multiselect-wrapper .combo {
    display: block;
    margin-bottom: 1.5em;
    max-width: 400px;
    position: relative;
}

/* Kein Dropdown-Pfeil mehr */
.combo-multiselect-wrapper .combo::after {
    display: none;
}

.combo-multiselect-wrapper .input-wrapper {
    border-radius: 8px;
}

.combo-multiselect-wrapper .combo-input {
    background-color: transparent;
    border: none;
    border-radius: 8px;
    display: block;
    font-size: 1em;
    min-height: calc(1.4em + 26px);
    padding: 12px 16px 14px;
    text-align: left;
    width: 100%;
}

.combo-multiselect-wrapper select.combo-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.combo-multiselect-wrapper .open .combo-input {
    border-radius: 8px 8px 0 0;
}

.combo-multiselect-wrapper .combo-input:focus {
    outline: none;
}

.combo-multiselect-wrapper .combo-label {
    display: block;
    font-size: 20px;
    font-weight: 100;
    margin-bottom: 0.25em;
}

.combo-multiselect-wrapper .combo-menu {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    left: 0;
    position: absolute;
    top: 100%;
    width: 100%;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.combo-multiselect-wrapper .open .combo-menu {
    display: block;
}

.combo-multiselect-wrapper .combo-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.combo-multiselect-wrapper .combo-option.option-current,
.combo-multiselect-wrapper .combo-option:hover {
    background-color: #f5f5f5;
}

.combo-multiselect-wrapper .combo-option.option-selected {
    padding-right: 30px;
    position: relative;
    background-color: #f0f7ff;
}

.combo-multiselect-wrapper .combo-option.option-selected::after {
    border-bottom: 2px solid #0067b8;
    border-right: 2px solid #0067b8;
    content: '';
    height: 12px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translate(0, -50%) rotate(45deg);
    width: 6px;
}

/* Locked options styling */
.combo-multiselect-wrapper .combo-option.option-locked {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #fafafa;
    color: #999;
}

.combo-multiselect-wrapper .combo-option.option-locked:hover {
    background-color: #fafafa;
}

/* multiselect list of selected options */
.combo-multiselect-wrapper .selected-options {
    list-style-type: none;
    margin: 0;
    max-width: 400px;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.combo-multiselect-wrapper .selected-options li {
    display: inline-flex;
    margin-bottom: 0;
}

.combo-multiselect-wrapper .remove-option {
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 0;
    padding: 2px 6px 2px 8px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    line-height: 1;
    box-shadow: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Grün für sichtbar */
.combo-multiselect-wrapper .remove-option[data-type="sichtbar"] {
    background-color: #e8f5e9 !important;
    border: 1px solid #4caf50 !important;
    color: #2e7d32 !important;
}

.combo-multiselect-wrapper .remove-option[data-type="sichtbar"] .close-x::before,
.combo-multiselect-wrapper .remove-option[data-type="sichtbar"] .close-x::after {
    background-color: #2e7d32 !important;
}

/* Rot für abrechenbar */
.combo-multiselect-wrapper .remove-option[data-type="abrechenbar"] {
    background-color: #ffebee !important;
    border: 1px solid #f44336 !important;
    color: #c62828 !important;
}

.combo-multiselect-wrapper .remove-option[data-type="abrechenbar"] .close-x::before,
.combo-multiselect-wrapper .remove-option[data-type="abrechenbar"] .close-x::after {
    background-color: #c62828 !important;
}

.combo-multiselect-wrapper .remove-option .option-text {
    font-weight: 500;
}

.combo-multiselect-wrapper .remove-option .close-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.combo-multiselect-wrapper .remove-option .close-x:hover {
    opacity: 0.7;
    background-color: rgba(0, 0, 0, 0.05);
}

.combo-multiselect-wrapper .remove-option .close-x::before,
.combo-multiselect-wrapper .remove-option .close-x::after {
    content: "";
    position: absolute;
    width: 1.5px;
    height: 0.75em;
    top: 50%;
    left: 50%;
}

.combo-multiselect-wrapper .remove-option .close-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.combo-multiselect-wrapper .remove-option .close-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}


/* Locked remove buttons */
.combo-multiselect-wrapper .remove-option.locked {
    opacity: 0.5;
    background-color: #e0e0e0;
    border-color: #bdbdbd;
    box-shadow: none;
}

.combo-multiselect-wrapper .remove-option.locked .close-x {
    cursor: not-allowed;
    pointer-events: none;
}


.combo-multiselect-wrapper .multiselect-inline {
    align-items: center;
    background-color: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    display: flex;
    flex-wrap: nowrap;
    min-height: 44px;
    max-height: 44px;
    padding: 0 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    gap: 6px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
}

.combo-multiselect-wrapper .multiselect-inline:hover {
    border-color: #a0a0a0;
}

.combo-multiselect-wrapper .multiselect-inline:focus-within {
    border-color: #0067b8;
    box-shadow: 0 0 0 2px rgba(0, 103, 184, 0.1);
}

.combo-multiselect-wrapper .multiselect-inline .selected-options {
    flex: 0 1 auto;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.combo-multiselect-wrapper .multiselect-inline .selected-options li {
    margin-bottom: 0;
}

.combo-multiselect-wrapper .multiselect-inline .combo-input {
    border: none;
    flex: 1 1 auto;
    min-height: 28px;
    padding: 0;
    background: transparent;
    font-size: 14px;
}

/* Dropdown arrow indicator - small chevron like BHV Podo */
.combo-multiselect-wrapper .multiselect-inline::after {
    content: '˅';
    font-size: 12px;
    color: #666;
    margin-left: auto;
    flex-shrink: 0;
    pointer-events: none;
}

/* +1 overflow indicator (placeholder for future JS implementation) */
.combo-multiselect-wrapper .overflow-indicator {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    padding: 0 4px;
}

.combo-multiselect-wrapper .multiselect-inline .combo-input:focus {
    box-shadow: none;
    outline: none;
}


/* additional own styles to multiselecte element */
.combo-multiselect-wrapper .multiselect-inline .spinner-wrap {
    position: relative;
    width: 20px;
    height: 20px;
    align-self: center;
}

/* Therapist Avatar Chip */
.therapist-avatar-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
}

/* PDF Download Chip Button */
.pdf-download-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.3em 0.7em;
    background-color: #7c3aed;
    color: #fff;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}

.pdf-download-chip:hover {
    background-color: #6d28d9;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.pdf-download-chip .pdf-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pdf-download-chip .pdf-label {
    line-height: 1;
}
