/**
 * AID2 CSS definitions
 * @author Bruno Babic
 * @copyright maxcom
 */

/* AID2 variables */
:root {
	/* font */
	--aid-font-size: 13px;
	--aid-line-height: 1.2;

	/* general */
	--aid-padding-small: .25rem;
	--aid-padding-medium: .5rem;
	--aid-padding-large: 1rem;

	--aid-body-header-color: white;
	--aid-body-header-background-color: #135C5D;
	--aid-body-content-color: black;
	--aid-body-content-background-color: #F5F9FA;
	--aid-body-footer-color: gray;
	--aid-body-footer-background-color: #CAD8D8;

	/* containers */
	--aid-container-header-background-color: var(--aid-body-content-background-color);
	--aid-container-content-background-color: var(--aid-body-content-background-color);
	--aid-container-footer-background-color: var(--aid-body-content-background-color);

	/* panels */
	--aid-panel-border: solid 1px var(--bs-border-color);
	--aid-panel-border-radius: 0;

	--aid-panel-header-background-color: #d0d0d0;
	--aid-panel-header-padding: .5rem;

	--aid-panel-footer-background-color: #e0e0e0;
	--aid-panel-footer-padding: .5rem;

	--aid-panel-header-icon-width: 25px;
	--aid-panel-header-icon-height: 25px;

	/* accordions */
	--aid-accordion-toggler-color-hover: red;

	/* inputs */
	--aid-input-height: 30px;

	/* tables */
	--aid-table-dense-padding: 6px;
}

/* AID2 page definitions */
body {
	font-size: var(--aid-font-size);
	line-height: var(--aid-line-height);
}

body > header {
	color: var(--aid-body-header-color);
	background-color: var(--aid-body-header-background-color);
}

body > main {
	color: var(--aid-body-content-color);
	background-color: var(--aid-body-content-background-color);
}

body > footer {
	color: var(--aid-body-footer-color);
	background-color: var(--aid-body-footer-background-color);
	font-weight: 600;
}

body > footer a {
	color: var(--aid-body-footer-color);
	text-decoration: none;
	font-weight: 800;
}

/* AID2 container definitions */
div.aid2-container {
	display: flex !important;
	flex-direction: column !important;
	height: 100% !important;
	/*overflow: auto !important;*/
	min-height: 0;
	min-width: 0;
}

div.aid2-container > div.header {
	background-color: var(--aid-container-header-background-color);
}

div.aid2-container > div.content {
	background-color: var(--aid-container-content-background-color);
	flex-grow: 1;
	overflow: auto;
}

div.aid2-container > div.footer {
	background-color: var(--aid-container-footer-background-color);
}

div.aid2-container > div.content.p-2 {
	padding: var(--aid-padding-medium);
	gap: var(--aid-padding-medium);
}

/* row-oriented container wrapper */
div.aid2-container > div.content div.rows {
	display: flex;
	flex-direction: column;
	gap: var(--aid-padding-medium);
	height: 100% !important;
}

/* column-oriented container wrapper */
div.aid2-container > div.content > div.columns, div.aid2-container > div.content > form > div.columns {
	display: flex;
	flex-direction: row;
	gap: var(--aid-padding-medium);
	height: 100% !important;
}

/* AID2 panel definitions */
div.aid2-panel {
	display: flex !important;
	flex-direction: column !important;
	min-height: 0;
	min-width: 0;
}

/* AID2 panel height limitations */
div.aid2-panel.min-height-auto {
	min-height: auto;
}

div.aid2-panel.min-height-25 {
	min-height: 25%;
}

div.aid2-panel.min-height-33 {
	min-height: 33.333333%;
}

div.aid2-panel.min-height-50 {
	min-height: 50%;
}

div.aid2-panel.min-height-66 {
	min-height: 66.666666%;
}

div.aid2-panel.min-height-75 {
	min-height: 75%;
}

div.aid2-panel.max-height-25 {
	max-height: 25%;
}

div.aid2-panel.max-height-33 {
	max-height: 33.333333%;
}

div.aid2-panel.max-height-50 {
	max-height: 50%;
}

div.aid2-panel.max-height-66 {
	max-height: 66.666666%;
}

div.aid2-panel.max-height-75 {
	max-height: 75%;
}

div.aid2-panel > div.header {
	background-color: var(--aid-panel-header-background-color);
	padding: var(--aid-panel-header-padding);
}

div.aid2-panel > div.content {
	flex-grow: 1;
	overflow: auto;
}

div.aid2-panel > div.footer {
	background-color: var(--aid-panel-footer-background-color);
	padding: var(--aid-panel-footer-padding);
}

/* adds padding to header, footer and content */
div.aid2-panel > div.header.p-2 {
	padding: var(--aid-panel-header-padding);
}

div.aid2-panel > div.content.p-2 {
	padding: var(--aid-padding-medium);
	gap: var(--aid-padding-medium);
}

div.aid2-panel > div.footer.p-2 {
	padding: var(--aid-panel-footer-padding);
}

/* adds a frame around panel */
div.aid2-panel.framed {
	border: var(--aid-panel-border);
	border-radius: var(--aid-panel-border-radius);
}

/* adds borders around panel and between header, content and footer */
div.aid2-panel.bordered {
	border: var(--aid-panel-border);
}

div.aid2-panel.bordered > div.header {
	border-bottom: var(--aid-panel-border);
}

div.aid2-panel.bordered > div.footer {
	border-top: var(--aid-panel-border);
}

/* panel header icons */
div.aid2-panel > div.header > span.icon {
	display: inline-block;
}

div.aid2-panel > div.header > span.icon > i {
	display: inline-block;
}

/* row-oriented panel wrapper */
div.aid2-panel > div.content > div.rows {
	display: flex;
	flex-direction: column;
	gap: var(--aid-padding-medium);
	height: 100% !important;
}

/* column-oriented panel wrapper */
div.aid2-panel > div.content > div.columns {
	display: flex;
	flex-direction: row;
	gap: var(--aid-padding-medium);
	height: 100% !important;
}

/* adds accordion-like behavior, collapsable panels */
div.rows.accordion {
	display: flex;
	flex-direction: column;
	gap: var(--aid-padding-medium);
	height: 100% !important;
}

div.aid2-panel.accordion {
	display: block;
}

div.aid2-panel.collapsable {
	display: block;
}

div.aid2-panel.collapsable.collapsed > div.header:hover {
	cursor: pointer;
}

div.aid2-panel.collapsable.collapsed > div.header span.toggle > i:hover {
	cursor: pointer;
	color: var(--aid-accordion-toggler-color-hover);
}

div.aid2-panel.collapsed {
	flex-grow: 0;
	flex-shrink: 1;
	flex-basis: auto;
}

div.aid2-panel.expanded {
	flex-grow: 1;
	flex-shrink: 1;
	flex-basis: 0%;
}

div.aid2-panel div.hidden {
	display: none;
}

.min-width-0 {
	min-width: 0 !important;
}

.align-content-center {
	align-content: center !important;
}

form {
	width: 100% !important;
	height: 100% !important;
}

p {
	margin: 0;
}

.cursor-pointer {
	cursor: pointer;
}

.small-description {
	overflow-y: scroll;
	min-height: 70px;
	max-height: 70px;
	padding: 0 0.5em;
}

#table-disease tbody tr:first-of-type td {
	background: #cdcdcd;
	font-weight: 600;
}

.canton-logo {
	width: 57px;
	height: auto;
}

/** required fields label */
.control-label.required:after, .required .control-label:after {
	content: "*";
	color: #c77;
	padding-left: var(--aid-padding-small);
}

/** CASE CONTACT IMPORT TABLE **/

table.contact-import td:not(:first-of-type):not(:last-of-type),
table.contact-import th:not(:first-of-type):not(:last-of-type) {
	overflow: hidden;
	text-overflow: ellipsis;
	width: 130px;
	max-width: 130px;
	min-width: 130px;
	white-space: nowrap;
}

table.contact-import th:first-of-type,
table.contact-import td:first-of-type {
	width: 30px;
	text-align: center;
	color: #555;
}

table.contact-import button {
	min-width: auto !important;
}

table.contact-import button.error {
	background: #c00;
}

table.contact-import button.error:hover {
	background: #a00;
}

table.contact-import input[type=text] {
	width: 130px;
	min-width: 130px;
	max-width: 130px;
	border: none;
}

table.contact-import tbody tr:hover td {
	background: #eee;
}

table.contact-import tbody tr td.warning {
	color: #fd7e14;
	font-weight: 600;
}

table.contact-import tbody tr td.warning::after {
	content: '<empty>';
	font-weight: 600;
	margin-right: -20px;
}

table.contact-import tbody tr td.error {
	color: #dc3545;
	font-weight: 600;
}

table.contact-import tbody tr[data-status=INVALID] td {
	background: #ffdf98 !important;
}

table.contact-import tbody tr[data-status=INVALID] button.status {
	background: #fd7e14;
}

table.contact-import tbody tr[data-status=INVALID_IGNORE] button.status {
	background: #0d6efd;
}

table.contact-import tbody tr[data-status=ERROR] td {
	background: #ffc7c7 !important;
}

table.contact-import tbody tr[data-status=ERROR] button.status {
	background: #dc3545;
}

table.contact-import tbody tr[data-status=DELETED] button.status {
	background: #212529;
}

table.contact-import tbody tr[data-status=INVALID_IGNORE] td {
	background: #ccddff !important;
}

table.contact-import tbody tr[data-status=INVALID_IGNORE] td.warn {
	text-decoration: line-through;
}

table.contact-import tbody tr[data-status=INVALID_IGNORE] button.ignore {
	text-decoration: line-through;
}

table.contact-import tbody tr[data-status=DELETED] td {
	text-decoration: line-through;
	background: #ccc !important;
}

table.contact-import tbody tr[data-status=DELETED] button.delete {
	text-decoration: line-through;
}

table.contact-import tfoot td {
	text-align: center;
	color: #dc3545;
	font-weight: 600;
	font-size: 15px;
	display: none;
	padding-top: 1em !important;
}

.legend {
	padding: .25em 0;
}

.legend > * {
	border: 2px white solid;
	padding: .3em 1.15em;
	color: white;
	opacity: .8;
	text-decoration: none;
	border-radius: 4px;
}

.legend > * span {
	font-weight: 600;
	margin-left: .5em;
	font-size: 14px;
}

.legend > *:hover {
	opacity: 1;
}

.legend > .active {
	border-color: purple;
}

.legend .all {
	background: gray;
}

.legend .deleted {
	background: black;
}

.legend .error {
	background: #dc3545;
}

.legend .ignore {
	background: #0d6efd;
}

.legend .warning {
	background: #fd7e14;
}

.legend .valid {
	background: green;
}

.import-save-info {
	color: #dc3545;
	font-size: 14px;
	margin-left: 1em;
	vertical-align: -2px;
}

/** hide message after 1 min **/
.import-delay {
	opacity: 1;
	animation: importDelay 0.1s forwards;
	animation-delay: 60s;
}

@keyframes importDelay {
	from { opacity: 1 }
	to { opacity: 0 }
}

.ajax-loading {
	opacity: 0;
	transition: .75s;
}

/** TRIAGE USERS/GROUPS **/

.table-users-groups b {
	font-weight: 600;
}

.table-users-groups th {
	text-align: center;
	max-width: 120px !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.table-users-groups td {
	text-align: center;
	height: 40px !important;
	vertical-align: middle;
	padding: auto !important;
}

.table-users-groups tr td:first-child {
	text-align: left;
	width: 120px;
	max-width: 150px !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding-left: 3px !important;
}

.table-users-groups tr td:nth-child(2) {
	text-align: center;
	width: 50px;
	max-width: 50px;
}

.table-users-groups tr td:nth-child(3) {
	text-align: center;
	width: 100px;
	max-width: 100px;
}

.table-users-groups tr:hover td:first-child {
	font-weight: 600;
}

.table-users-groups td select {
	width: 90px;
}

.table-users-groups *[data-value='LOW'],
#table-case-triage-agents *[data-value='LOW'],
#table-case-triage-groups *[data-value='LOW'] {
	color: #dc3545;
}

.table-users-groups *[data-value='NORMAL'],
#table-case-triage-agents *[data-value='NORMAL'],
#table-case-triage-groups *[data-value='NORMAL'] {
	color: green;
}

.table-users-groups *[data-value='HIGH'],
#table-case-triage-agents *[data-value='HIGH'],
#table-case-triage-groups *[data-value='HIGH'] {
	color: #fd7e14;
}

.table-users-groups tr.border td {
	border-bottom-width: 2px;
}

.table-users-groups tr td.border {
	border-right-width: 2.5px !important;
}

.table-users-groups > :not(caption) > tr > td {
	padding: 0 !important;
}


/** Increase the size of info/error/warn/success icon in notifier **/
.notifier-icon {
	font-size: 30px;
}

/** Add right padding if icons in panel title followed by panel toggle icons **/
.toggle + .panel-title-icons {
	margin-right: 1em;
}

/** Increase FA icons size in panel title **/
.panel-title-icons i.fa {
	font-size: 15px;
}

/** Decrease CSV icons size in panel title **/
.panel-title-icons img {
	width: 16px;
	height: 16px;
	margin-left: .5em;
}

a:not(.btn), a:hover {
	text-decoration: none;
}

.bolder {
	font-weight: 600;
}

.clickable-ref-num {
	cursor: pointer;
}

.selected-row {
	font-weight: bold;
}

table tr.selected-row td:nth-child(1),
table tr.selected-row td:nth-child(2),
table tr.selected-row td:nth-child(3),
table tr.selected-row td:nth-child(4),
table tr.selected-row td:nth-child(5),
table tr.selected-row td:nth-child(6),
table tr.selected-row td:nth-child(7),
table tr.selected-row td:nth-child(8) {
	background: #FDEDBB !important;
}

.selected-row td:nth-child(1),
.selected-row td:nth-child(2),
.selected-row td:nth-child(3),
.selected-row td:nth-child(4),
.selected-row td:nth-child(5),
.selected-row td:nth-child(6) {
	background: #FDEDBB !important;
}

.overflow-ellipsis {
	display: block;
	text-overflow: ellipsis;
	overflow: hidden;
	height: 3em;
	max-width: 70vw;
}

input[readonly] {
	pointer-events: none;
	background-color: #eee;
}

/*
TODO this does not work, fix this or delete
select.readonly {
	background: #eee !important
}
*/

/*Select2 ReadOnly Start*/

/*
TODO this does not work, fix this or delete
select[readonly].select2-hidden-accessible + .select2-container {
	pointer-events: none;
	touch-action: none;
}

select[readonly].select2-hidden-accessible + .select2-container .select2-selection {
	background: #eee;
	box-shadow: none;
}

select[readonly].select2-hidden-accessible + .select2-container .select2-selection__arrow, select[readonly].select2-hidden-accessible + .select2-container .select2-selection__clear {
	display: none;
}
*/
