/**
 * CLP Wellbeing Index Manager Plugin - Front End Stylesheet
 *
 * @since      1.0.0
 * @package    WELIDX
 * @subpackage WELIDX/includes
 * @author     m:gnu <freelance@mgnu.net>
 */

.clp-noaria {
    margin: 0 0 0 -18px;
    padding: 0;
}

.clp-gray {
    color: #575756;
}

.clp-blue {
    color: #e0c99d;
}

.bg-primary .dropdown-menu .dropdown-item.active,
.bg-primary .dropdown-menu .dropdown-item:hover,
.bg-primary .dropdown-menu .dropdown-item:focus {
    color: #222 !important;
}

.welidx-start-data-collection {}

#qrcode-container {
    text-align: center;
    padding: 4% 0 0 50%;
    margin-left: -207px;
}
#qrcode-url {
    font-size: xx-small;
    margin-top: 2%;
}
#starting-btn-container {
    padding: 4%;
}

.ecrf-filter-element {
    display: block;
    width: 100%;
    margin: 0 0 4px 0;
    padding: 0 4px;
}
.ecrf-filter-label {
    width: 30%;
    font-size: medium;
    border-bottom: 1px dashed var(--form_border_color);
}
.ecrf-filter-input {
    width: 64% !important;
}

.ecrf-filters-patients {
    margin: 0 0 2rem 0;
}

.ecrf-form-wrapper {
    margin: 40px auto;
    padding: 0;
    text-align: center;
}

.ecrf-patient-sheet {
    margin: 0;
    padding: 0;
    width: 100%;
}

.ecrf-table {
    margin: 0;
    padding: 0;
    width: 100%;
    border: none;
}

.ecrf-table td input {
    width: 100%;
}

.ecrf-form-button {
    text-transform: uppercase;
    font-weight: bold;
}

.ecrf-notice {
    font-size: small;
    font-style: italic;
}

.ecrf-success-mgs {
    font-weight: bold;
    color: #0075be;
}

.ecrf-warning-mgs {
    font-weight: bold;
    color: #ef7900;
}

label.error.fail-alert {
    border: 1px solid #ff0000;
    border-radius: 4px;
    padding: 0;
    background: #ffe6eb;
}

input.valid.success-alert {
    border: 2px solid #4CAF50;
    color: green;
}

.card-deck {
    margin-bottom: 1.25rem;
}

.card-title {
    margin: 0;
}

.card-title.title-dashboard,
.card-title.title-list {
    font-size: 1.0rem;
}
.card-title.title-dashboard-1 {
    font-size: 1.1rem;
}
.card-title.title-dashboard-2 {
    font-size: 0.9rem;
}
.card-title.title-dashboard-3 {
    font-size: 0.7rem;
}
.card-title.title-dashboard-4 {
    font-size: 0.6rem;
}
.card-title.title-dashboard-6 {
    font-size: 0.4rem;
}

a.clp-modal-link {
    text-decoration: none;
}
a.clp-modal-link:hover {
    height: 100%;
    color: #394b53;
    background-color: #eee;
    transition: all .2s ease;
}

.clp-card-header {
    transition: all .2s ease;
}

.clp-card-form-edit {
    margin-top: -30px;
    margin-bottom: 10px;
    text-align: right;
}

@media only screen and (max-width: 1024px) {
    .clp-card-header {
	min-height: 118px;
    }
}

.clp-card-body {

}
.clp-card-body p {
    color: #394b53;
}

.modal-body p {
    margin: 20px 0 0 0 !important;
}

/* ==========================================================================
   Gravity Forms
   ========================================================================== */

.gfield_required,
.gform_required_legend {
    display: none !important;
}

.hide_this {
    display: none !important;
}

legend.gfield_label.gform-field-label {
    font-size: var(--body_typography-font-size);
}
label.gfield_label.gform-field-label {
    font-size: var(--body_typography-font-size);
}
.gform-field-label.gform-field-label--type-inline {
    font-size: var(--body_typography-font-size);
}

.gform_footer input[type="submit"],
.gform_page_footer input[type="submit"] {
    color: #fff !important;
    padding: 4px 10px;
    border: 1px solid #28a745;
    border-radius: 6px;
    box-shadow: 0 1px 0px rgba(114,114,114,0.3);
    background-color: #28a745 !important;
    text-transform: uppercase;
}
.gform_footer input[type="submit"]:hover,
.gform_page_footer input[type="submit"]:hover {
    color: #fff !important;
    border: 1px solid #1e7e34 !important;
    background-color: #218838 !important;
}
.gform_next_button {
    color: #fff !important;
    padding: 4px 10px;
    border: 1px solid #17a2b8;
    border-radius: 6px;
    box-shadow: 0 1px 0px rgba(114,114,114,0.3);
    background-color: #17a2b8 !important;
    text-transform: uppercase;
}
.gform_next_button:hover {
    color: #ccc !important;
    border: 1px solid #117a8b !important;
    background-color: #138496 !important;
}
.gform_previous_button {
    color: #212529 !important;
    padding: 4px 10px;
    border: 1px solid #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 0px rgba(114,114,114,0.3);
    background-color: #f8f9fa !important;
    text-transform: uppercase;
}
.gform_previous_button:hover {
    color: #212529 !important;
    border: 1px solid #dae0e5 !important;
    background-color: #e2e6ea !important;
}

form .gform_body fieldset.gfield {
    margin: 0 0 10px 0 !important;
    padding: 10px 0 20px 0 !important;
    border-bottom: 1px solid #eee;
}

/* ==========================================================================
   Toggle
   ========================================================================== */

.ecrf-toggle {
    padding: 10px 0 0 10px;
    border-radius: 0.4rem;
}

.ecrf-toggle-white {
    background-color: #FFF;
}
.ecrf-toggle-gray {
    background-color: #F5F5F5;
}
.ecrf-toggle-dark {
    background-color: #383838;
}
.ecrf-toggle-dark a {
    color: #fff;
}
.ecrf-toggle_container {
    overflow: hidden;
    padding: 20px 40px;
}
.ecrf-toggler {
    padding: 0;
    text-transform: uppercase;
}

/* ==========================================================================
   logged-in menu greetings
   ========================================================================== */

#greetings span {
    font-weight: bold;
}

/* ==========================================================================
   Wellbeing Index
   ========================================================================== */

.index-line {
    position: relative;
    padding: 0;
}
.index-line::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 5px;
    background: #363128;
}

.protocol-description {
    margin-bottom: -20px !important;
}

/* Gauges - Therapist Page */

.indexes-container {
    position: relative;
}

.graphs-container {}

/* Gauges - Client Page */

.GaugeMeter span,
.GaugeMeter b {
    margin: -38px 0 0 7px;
    width: 100%;
    position: absolute;
    display: inline-block;
    font-family: var(--button_typography-font-family);
    font-weight: var(--button_typography-font-weight);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    text-align: center;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    white-space: normal;
}
.GaugeMeter[data-style="Full"] b {
    margin: 0;
    width: 100%;
    text-wrap: nowrap;
}

.GaugeMeter s,
.GaugeMeter u {
    text-decoration: none;
    font-size: 0.5em;
    opacity: 0.5;
}

.GaugeMeter b {
    margin-top: -38px !important;
    font-weight: 300;
    font-size: 0.52em;
    opacity: 1;
}

.wellindex-cell {
    background: transparent url('/wp-content/plugins/clp-welidx-manager/assets/imgs/spiral.png') center center no-repeat;
    background-size: contain;
}
.wellindex-cell.icon-200 {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.wellindex-cell.icon-150 {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cl-indexes-container {
    position: relative;
    margin-top: 4%;
}

.cl-graphs-container {}

.cl-spiral {
    min-height: 800px;
    background-color: transparent;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: visible;
}

@media only screen and (max-width: 1024px) {

    .cl-spiral {
	min-height: 600px;
    }

}

#label-cl-metabolic {
    position: absolute;
    top: 78%;
    left: 62%;
    width: 140px;
    font-size: 0.7em;
    font-weight: var(--button_typography-font-weight);
    font-family: var(--button_typography-font-family);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    text-align: center;
    text-decoration: none;
    color: #fff;
    overflow: visible;
    white-space: pre-wrap;
}
#label-cl-wellbeing {
    position: absolute;
    top: 29%;
    left: 25%;
    width: 140px;
    font-size: 0.7em;
    font-weight: var(--button_typography-font-weight);
    font-family: var(--button_typography-font-family);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    text-align: center;
    text-decoration: none;
    color: #fff;
    overflow: visible;
    white-space: pre-wrap;
}
#label-cl-cellular {
    position: absolute;
    top: 29%;
    left: 62%;
    width: 140px;
    font-size: 0.7em;
    font-weight: var(--button_typography-font-weight);
    font-family: var(--button_typography-font-family);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    text-align: center;
    text-decoration: none;
    color: #fff;
    overflow: visible;
    white-space: pre-wrap;
}
#label-cl-detox {
    position: absolute;
    top: 78%;
    left: 25%;
    width: 140px;
    font-size: 0.7em;
    font-weight: var(--button_typography-font-weight);
    font-family: var(--button_typography-font-family);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    text-align: center;
    text-decoration: none;
    color: #fff;
    overflow: visible;
    white-space: pre-wrap;
}
#label-cl-index {
    position: absolute;
    top: 52%;
    left: 44%;
    width: 140px;
    font-size: 0.7em;
    font-weight: var(--button_typography-font-weight);
    font-family: var(--button_typography-font-family);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    text-align: center;
    text-decoration: none;
    color: #fff;
    overflow: visible;
    white-space: pre-wrap;
}

@media only screen and (max-width: 1024px) {

    #label-cl-metabolic {
	position: absolute;
	top: 74%;
	left: 66%;
	width: 140px;
	font-size: 0.7em;
	font-weight: var(--button_typography-font-weight);
	font-family: var(--button_typography-font-family);
	font-style: var(--button_typography-font-style,normal);
	letter-spacing: var(--button_typography-letter-spacing);
	text-transform: var(--button_text_transform);
	text-align: center;
	text-decoration: none;
	color: #fff;
	overflow: visible;
	white-space: pre-wrap;
    }
    #label-cl-wellbeing {
	position: absolute;
	top: 28%;
	left: 14%;
	width: 140px;
	font-size: 0.7em;
	font-weight: var(--button_typography-font-weight);
	font-family: var(--button_typography-font-family);
	font-style: var(--button_typography-font-style,normal);
	letter-spacing: var(--button_typography-letter-spacing);
	text-transform: var(--button_text_transform);
	text-align: center;
	text-decoration: none;
	color: #fff;
	overflow: visible;
	white-space: pre-wrap;
    }
    #label-cl-cellular {
	position: absolute;
	top: 28%;
	left: 66%;
	width: 140px;
	font-size: 0.7em;
	font-weight: var(--button_typography-font-weight);
	font-family: var(--button_typography-font-family);
	font-style: var(--button_typography-font-style,normal);
	letter-spacing: var(--button_typography-letter-spacing);
	text-transform: var(--button_text_transform);
	text-align: center;
	text-decoration: none;
	color: #fff;
	overflow: visible;
	white-space: pre-wrap;
    }
    #label-cl-detox {
	position: absolute;
	top: 74%;
	left: 14%;
	width: 140px;
	font-size: 0.7em;
	font-weight: var(--button_typography-font-weight);
	font-family: var(--button_typography-font-family);
	font-style: var(--button_typography-font-style,normal);
	letter-spacing: var(--button_typography-letter-spacing);
	text-transform: var(--button_text_transform);
	text-align: center;
	text-decoration: none;
	color: #fff;
	overflow: visible;
	white-space: pre-wrap;
    }
    #label-cl-index {
	position: absolute;
	top: 52%;
	left: 40%;
	width: 140px;
	font-size: 0.7em;
	font-weight: var(--button_typography-font-weight);
	font-family: var(--button_typography-font-family);
	font-style: var(--button_typography-font-style,normal);
	letter-spacing: var(--button_typography-letter-spacing);
	text-transform: var(--button_text_transform);
	text-align: center;
	text-decoration: none;
	color: #fff;
	overflow: visible;
	white-space: pre-wrap;
    }

}

/* end of client version */

.GaugeMeter {
    text-align: center;
    overflow: hidden;
    cursor: default;
}

.welidx-debug-info {
    background-color: #fdfad3;
    width: 100%;
    margin: 0;
    padding: 20px;
    border: 1px solid #e0c99d;
    border-radius: 5px;
}

.bd-highlight {
    display: inline-flex !important;
    width: 80%;
    margin: 0 0 4px 0;
    flex-wrap: nowrap;
    align-content: stretch;
    justify-content: flex-start;
    align-items: center;
}
.bd-highlight > label {
    display: inline-flex;
    align-content: center;
    flex-wrap: wrap;
    padding-top: 4px;
}
.bd-highlight-trashcan{
    display: inline-flex;
}

/* Counters version */

.highlighted-idx {
    border: 1px solid var(--awb-color4) !important;
    background-color: var(--awb-color5) !important;
}

.counter-box {
    display: inline-flex;
    width: 100%;
    min-width: 248px;
    background-color: #fff;
    margin: 4px 0 0 0;
    padding: 10px 0 10px 5px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    border: 1px solid var(--awb-color4);
    border-radius: 10px !important;
}

.counter-box p {
    display: inline-flex;
    margin: -6px 0 0 12px !important;
    padding: 5px 0 0 0;
    color: #909090;
    font-family: var(--button_typography-font-family);
    font-weight: var(--button_typography-font-weight);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    font-size: 24px;
}

.counter-box-patient {
    background-color: #fff;
    margin: 4px 0 0 0;
    padding: 10px 0 10px 5px;
    border-radius: 10px !important;
}

.counter {
    display: inline-flex;
    font-size: 32px;
    font-weight: 700;
    color: #666;
    line-height: 32px
}

.big {
    font-size: 64px;
}

.counter-box.colored p,
.counter-box.colored i,
.counter-box.colored .counter {
    color: #fff
}

.cl-counter {
    font-family: var(--button_typography-font-family);
    font-weight: var(--button_typography-font-weight);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    font-size: 24px;
    line-height: 24px
}

.cl-counter-box p {
    padding: 5px 0 0 0;
    font-family: var(--button_typography-font-family);
    font-weight: var(--button_typography-font-weight);
    font-style: var(--button_typography-font-style,normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    font-size: 18px;
}

.icon {
    display: inline-flex;
    width: 64px;
    height: 64px;
}

.icon-16 {
    width: 16px;
    height: auto;
    vertical-align: baseline;
}

.icon-24 {
    width: 24px;
    height: auto;
    vertical-align: baseline;
}

.icon-32 {
    width: 32px;
    height: auto;
    vertical-align: middle;
}

.icon-200 {
    width: 200px;
    height: auto;
    vertical-align: middle;
}

.icon-grayscale {
    filter: grayscale(100%);
}

.clp-protocols-container {
    padding: 0;
}

div#dd-container {
    padding: 0;
    margin: 0;
    min-width: 484px;
}

div#scrollable {
    max-height: 500px;
    overflow-y: scroll;
    overflow-x: visible;
    margin: 0;
    padding: 5px 20px 5px 5px;
}

div#concierge-comments {
    max-height: 217px;
    overflow-x: visible;
    overflow-y: scroll;
}

td.cell-separator {
    width: 50px;
}

/* Available Supplements */

.trtmt {
    margin: 4px 2px;
    padding: 2px 4px !important;
}
.trtmt-title {
    text-transform: uppercase;
}
.trtmt-counter {
    display: inline-flex;
    justify-content: flex-end;
    text-transform: uppercase;
}
.trtmt-count {
    text-align: center;
    text-transform: uppercase;
}
.trtmt-text {
    /*margin-top: -20px !important;*/
}

input.trtmt-spin {
    min-width: 52px;
    text-align: right;
    margin: 2px auto;
    display: inline-flex;
    align-content: center;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   Wellbeing Protocols - Therapist Page
   ========================================================================== */

.clp-proposed-protocols {
    margin-top: 1rem;
}

/* Container of the protocols list */
#proposed-protocols {
    margin: 0;
    padding: 0;
}

/* Single protocol row */
.protocol-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background-color: #fff;
    border: 1px solid var(--awb-color4);
    border-radius: 8px;
}

/* Icon on the left (spiral 32x32) */
.protocol-item .protocol-icon {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
}

/* Label (protocol title) */
.protocol-item label {
    display: inline-flex;
    margin: 0;
    padding: 0;
    cursor: default;
    font-family: var(--button_typography-font-family);
    font-weight: var(--button_typography-font-weight);
    font-style: var(--button_typography-font-style, normal);
    letter-spacing: var(--button_typography-letter-spacing);
    text-transform: var(--button_text_transform);
    color: #394b53;
}

/* Right side: hidden value + trash button */
.protocol-item .trtmt-spin {
    display: none; /* quantity kept in data but not shown */
}

/* Trash button on the right */
.protocol-item .btn.trash {
    border: none;
    background: transparent;
    padding: 0 4px;
    line-height: 1;
    color: #909090;
    box-shadow: none;
}

.protocol-item .btn.trash:hover,
.protocol-item .btn.trash:focus {
    color: #c0392b;
    background: transparent;
}

/* Avoid icon catching clicks separately */
.protocol-item .btn.trash i {
    pointer-events: none;
}

/* Hide protocol rows that are logically removed (Bootstrap-like helper) */
.protocol-item.d-none {
    display: none !important;
}

/* Small screens: full width and a bit more spacing */
@media only screen and (max-width: 768px) {
    .protocol-item {
        flex-wrap: nowrap;
        padding: 8px 10px;
    }
}

/* Works on Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #fff #e0c99d;
}

/* Works on Chrome, Edge, and Safari */
*::-webkit-scrollbar {
    width: 12px;
}

*::-webkit-scrollbar-track {
    background: e0c99d;
}

*::-webkit-scrollbar-thumb {
    background-color: #fff;
    border-radius: 20px;
    border: 3px solid #e0c99d;
}

/* Print-o-matic */

.welidx-printer {
    margin: 0 5px;
    padding: 0.25rem 0.3rem;
    height: 100%;
    vertical-align: bottom;
}

/* Protocols table */

.welidx-protocols-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.welidx-protocols-table thead th {
    font-weight: 600;
    padding: 0.35rem 0.45rem;
    border-bottom: 1px solid #ddd;
    white-space: normal;
    word-break: break-word;
}

.welidx-protocols-table tbody td {
    padding: 0.3rem 0.45rem;
    border-bottom: 1px solid #eee;
}

.welidx-protocols-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* For patient progression charts */

/* General container for charts: first bars, then line charts */
.welidx-progression-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Istogramma Global Score, full width */
.welidx-progression-bars-wrapper {
    width: 100%;
}

.welidx-progression-bars {
    width: 100% !important;
    max-width: 100%;
    height: 260px !important;
}

/* Line chart + legend side by side */
.welidx-progression-line-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.welidx-progression-line {
    width: 100% !important;
    max-width: 100%;
    height: 260px !important;
}

/* HTML legend next to the line chart */
.welidx-progression-legend {
    list-style: decimal;
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.85rem;
}

.welidx-progression-legend li {
    margin-bottom: 0.3rem;
    position: relative;
    padding-left: 1.2rem;
}

.welidx-progression-legend li::before {
    content: '';
    position: absolute;
    left: 0.1rem;
    top: 0.4rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background-color: var(--welidx-color, #999);
}

/* More "stacked" version below a certain width (vertical tablet) */
@media (max-width: 768px) {
    .welidx-progression-line-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .welidx-progression-legend {
        padding-left: 1rem;
        margin-top: 0.5rem;
    }
}

/* Wrapper to avoid table overflowing the card */
.welidx-progression-details,
.welidx-progression-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* Table styling */
.welidx-progression-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    table-layout: fixed;
}

.welidx-progression-table thead th {
    font-weight: 600;
    padding: 0.35rem 0.45rem;
    border-bottom: 1px solid #ddd;
    white-space: normal;
    word-break: break-word;
}

.welidx-progression-table tbody td {
    padding: 0.3rem 0.45rem;
    border-bottom: 1px solid #eee;
}

.welidx-progression-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}
