/* delete colon from CKAN base styles */

label::after,
label:after {
	content: none !important;
}

/* custom date picker styles */

input[type="date"] {
	display: flex;
	align-items: end;
	gap: 4px;
}

input[type="date"]::before {
	content: attr(data-placeholder);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
	letter-spacing: 0.07px;
}

/* custom checkbox styles */

input[type="checkbox"] {
	flex-shrink: 0;
	position: relative;
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	width: 20px;
	height: 20px;
	border-radius: 6px;
	border: 1px solid var(--button-primary-primary, #0350a5);
	background: var(--bg-content, #fff);
	cursor: pointer;
}

input[type="checkbox"]::before {
	content: "";
	position: absolute;
	top: -1px;
	right: 0;
	bottom: 0;
	left: -1px;
	width: 20px;
	height: 20px;
	display: none;
	background-color: var(--button-primary-primary, #0350a5);
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10" fill="none"><path d="M1 4.5L5 8.5L13 1" stroke="white" stroke-width="1.5"/></svg>');
	background-position: center;
	background-repeat: no-repeat;
	border: 1px solid var(--button-primary-primary, #0350a5);
	border-radius: 6px;
}

input[type="checkbox"]:disabled:before {
	background-color: var(--input-border-def, #cbd5e1);
	border: 1px solid var(--input-border-def, #cbd5e1);
}

input[type="checkbox"]:checked:before {
	display: block;
}

input[type="checkbox"]:disabled {
	border: 1px solid var(--input-border-def, #cbd5e1);
}

input[type="radio"] {
	cursor: pointer;
}

input[type="file"] {
	cursor: pointer;
}

input[type="radio"]:focus {
	box-shadow: none;
}

input[type="radio"]:checked {
	background-color: var(--button-primary-primary, #0350a5);
	border-color: var(--button-primary-primary, #0350a5);
}

input[type="file"] {
	overflow: hidden;
}

input[type="file"].ua-control-input {
	padding: 0;
}

input[type="file"]:hover.ua-control-input {
	background: transparent;
	border: 1px solid var(--border-color-defoult, #cbd5e1);
}

input[type="file"].ua-control-input::file-selector-button {
	background: var(--core-colors-neutral-100, #f1f5f9);
	border: none;
	padding: 10px 15px;
	margin-right: 14px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.input-radio-label {
	color: var(--text-primary, #000);
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
}

/* Base style for filter form */

.ua-control-item {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: max-content;
	min-width: 150px;

	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
}

.ua-control-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--border-color-defoult, #cbd5e1);
	border-radius: 8px;

	color: var(--text-primary, #000);
	font-family: Daikon;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
}

.ua-control-input:hover:not(:disabled) {
	background: var(--bg-hover, rgba(32, 101, 242, 0.1));
	border-color: transparent;
}

.ua-control-input:focus:not(:disabled) {
	background: var(--bg-hover, rgba(32, 101, 242, 0.1));
	outline: 2px solid var(--core-colors-primary-accent-500, #2065f2);
}

.ua-control-input:disabled {
	background: var(--input-bginput-disabled, rgba(217, 222, 231, 0.4));
	color: var(--input-placeholder, #758da6);
}

.ua-input-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 14px;
}

.ua-input-component {
	flex: 1 0 0;
}

.ua-input-component--checkbox .ua-input-component {
	flex: none;
	display: flex;
	flex-direction: row-reverse;
	gap: 8px;
}

.ua-input-component--checkbox .ua-control-input {
	padding: 0;
}

/* Custom dropdown filter */
.ua-control-dropdown-wrapper {
	position: relative;
}

.ua-control-dropdown-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid var(--border-color-defoult, #cbd5e1);
	border-radius: 8px;
	cursor: pointer;
}

.ua-control-dropdown-trigger:hover {
	background: var(--bg-hover, rgba(32, 101, 242, 0.1));
	border-color: transparent;
}

.ua-control-dropdown-trigger:focus {
	background: var(--bg-hover, rgba(32, 101, 242, 0.1));
	outline: 2px solid var(--core-colors-primary-accent-500, #2065f2);
}

.ua-control-dropdown-label {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;

	color: var(--text-primary, #000);
	font-family: Daikon;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
	letter-spacing: 0.07px;
}

.ua-control-dropdown-placeholder {
	color: var(--text-secondary, #475569);
}

.ua-control-dropdown-chosen {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--text-accent, #0350a5);

	color: var(--text-ondark, #fff);
	font-family: Daikon;
	font-size: 12px;
	font-style: normal;
	font-weight: 600;
	line-height: 16px;
}

.ua-control-dropdown-menu {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
	padding: 16px;
	border-radius: 12px;
	border: 1px solid var(--border-color-defoult, #cbd5e1);
	background: var(--bg-content, #fff);
	box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
	max-height: 400px;
	max-width: 400px;
	overflow: hidden;
	min-width: 250px;
}

.ua-control-dropdown-search {
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid var(--input-border-def, #cbd5e1);
}

.ua-control-dropdown-search:hover {
	border: 1px solid var(--core-colors-primary-accent-500, #2065f2);
}

.ua-control-dropdown-search:focus {
	border: 1px solid var(--button-primary-primary, #0350a5);
	outline: none;
}

.ua-control-dropdown-options {
	max-height: 450px;
	overflow-y: auto;
}

.ua-control-dropdown-options-title {
	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 12px;
	font-style: normal;
	font-weight: 400;
	line-height: 16px;
}

.ua-control-dropdown-option {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 8px 0;
	cursor: pointer;

	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
	letter-spacing: 0.07px;
}

.ua-control-dropdown-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ua-control-dropdown-actions button {
	flex-shrink: 0;
	width: 50%;
	padding: 10px;
	border-radius: var(--border-radius-button, 999px);
	background: transparent;
	border: none;

	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
	letter-spacing: 0.07px;
}

.ua-control-dropdown-actions button:hover {
	color: var(--text-ondark, #fff);
	background: var(--button-primary-primary, #0350a5);
}

.ua-control-dropdown-clear {
	color: #dc2626;
}

.ua-control-dropdown-close {
	color: #475569;
}

/* custom date range filter */

.ua-control-date-range {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* custom textarea */
.ua-textarea {
	padding: 9px 14px;
	border: none;
	border-radius: 8px;
	outline: 1px solid var(--input-border-def, #cbd5e1);
	color: var(--text-primary, #000);
	font-family: Daikon;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
	width: 100%;
}

.ua-textarea:hover {
	outline: 1px solid var(--core-colors-primary-accent-500, #2065f2);
}

.ua-textarea:focus {
	outline: 1px solid var(--button-primary-primary, #0350a5);
}

.ua-textarea::placeholder {
	color: var(--input-placeholder, #758da6);
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
}

.ua-form-group.is-required > .ua-label::after {
	content: " *" !important;
	color: var(--text-danger, #dd3636);
}

.ua-label {
	margin-bottom: 4px;
	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
}

.ua-required {
	color: var(--text-danger, #dd3636);
}

.ua-hint {
	margin-top: 8px;
	margin-bottom: 0;
	color: var(--text-secondary, #475569);
	font-family: Daikon;
	font-size: 14px;
	font-weight: 400;
	line-height: 140%;
	letter-spacing: 0.07px;
}

.ua-fields-wrapper {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* -------- start ------ custom select control */
.ua-select-control {
	position: relative;
	width: 100%;
}

.ua-select-control__field {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid var(--input-border-def, #cbd5e1);
	cursor: pointer;
	background: var(--bg-content, #fff);
	color: var(--text-primary, #000);
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
}

.ua-select-control__field::placeholder {
	color: var(--input-placeholder, #758da6);
	text-overflow: ellipsis;
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
}

.ua-select-control__options {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	border-radius: 0 0 8px 8px;
	border-right: 1px solid var(--neutral-border, #d9dee7);
	border-bottom: 1px solid var(--neutral-border, #d9dee7);
	border-left: 1px solid var(--neutral-border, #d9dee7);
	background: var(--bg-content, #fff);
	max-height: 200px;
	overflow-y: auto;
	z-index: 10;
	list-style: none;
	padding: 0;
	margin: 0;
}

.ua-select-control.open .ua-select-control__options {
	display: block;
}

.ua-select-control.open svg path {
	fill: var(--core-colors-primary-accent-500, #2065f2);
}

.ua-select-control__option {
	padding: 10px 14px;
	cursor: pointer;
	color: var(--text-primary, #000);
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
	border-bottom: 1px solid var(--neutral-border, #d9dee7);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.ua-select-control.open .ua-select-control__field {
	border-radius: 8px 8px 0 0;
	border: 1px solid var(--input-border-def, #cbd5e1);
}

.ua-select-control__option:hover {
	background: var(--hover, rgba(84, 164, 255, 0.1));
}

.ua-select-control[aria-disabled="True"] .ua-select-control__field {
	background-color: #f0f0f0;
	cursor: not-allowed;
	background: var(--input-bginput-disabled, rgba(217, 222, 231, 0.4));
	overflow: hidden;
	color: var(--input-placeholder, #758da6);
	font-family: Daikon;
	font-size: 16px;
	font-weight: 400;
	line-height: 140%;
}

.ua-select-control__selected-text {
	padding-right: 20px;
}

.ua-select-control__selected-text.is-placeholder {
	color: var(--text-secondary, #475569);
}

.ua-select-control__option.is-disabled {
    color: var(--text-secondary, #475569);
    pointer-events: none;
    opacity: 0.6;
}

/* -------- end -------- custom select control */

.ua-upload-files-area {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ua-upload-files-container {
	position: relative;
	border-radius: 8px;
	border: 1px dashed var(--border-color-defoult, #cbd5e1);
	background: var(--bg-main, #f1f5f9);
	min-height: 160px;
	padding: 16px;
	transition: all 0.2s ease-in-out;
	display: flex;
	justify-content: center;
}

.ua-upload-files-container.error {
    border: 1px dashed var(--text-danger, #dd3636);;
    background: rgba(221, 54, 54, 0.10);
}

.ua-upload-error-text {
    color: var(--text-danger, #dd3636);;
    font-family: Daikon;
    font-size: 14px;
    font-weight: 400;
    line-height: 140%;
    letter-spacing: 0.07px;
}

.ua-upload-error-text[hidden],
.ua-hint[hidden] {
    display: none;
}

.ua-upload-files-area:hover .ua-upload-files-container {
	border: 1px dashed var(--core-colors-primary-accent-500, #2065f2);
	background: linear-gradient(
			0deg,
			var(--bg-hover, rgba(32, 101, 242, 0.1)) 0%,
			var(--bg-hover, rgba(32, 101, 242, 0.1)) 100%
		),
		var(--bg-content, #fff);
	box-shadow: -7px 11px 12px 0 rgba(136, 159, 205, 0.07),
		-1px 2px 5px 0 rgba(136, 159, 205, 0.24);
}

.ua-upload-files-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #475569;
	text-align: center;
	pointer-events: none;
}

.ua-upload-files-area > input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.ua-uploaded-files {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 12px;
}

.ua-preview-file-item {
	position: relative;
	width: 160px;
	height: 160px;
	border-radius: 8px;
	border: 1px solid var(--border-color-defoult, #cbd5e1);
	overflow: hidden;
	background: var(--bg-content, #fff);
	display: flex;
	justify-content: center;
	align-items: center;
}

.ua-preview-file-attachment {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
    padding-bottom: 30px;
}

.ua-preview-file-icon {
	width: 96px;
	height: 96px;
	object-fit: contain;
}

.ua-preview-file-name {
	position: absolute;
	bottom: 0;
	width: 100%;
	background: var(--bg-main, #f1f5f9);
	padding: 6px 8px;
	font-size: 13px;
	text-align: center;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

.delete-attached-file-btn {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 24px;
	height: 24px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	color: white;
	cursor: pointer;
	z-index: 3;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease-in-out;
}

.delete-attached-file-btn:hover {
	background: rgba(255, 0, 0, 0.7);
}

.ua-upload-files {
	padding: 24px;
	border-radius: 8px;
	border: 1px dashed var(--border-color-defoult, #cbd5e1);
	background: var(--bg-main, #f1f5f9);
	position: relative;
}

.ua-upload-files .ua-control-input {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	opacity: 0;
}

.ua-upload-files-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	align-self: stretch;
}

.ua-form-group.is-error .js-control-input {
    border: 1.2px solid var(--input-border-error, #DD3636);
    outline: none;
}

.ua-form-group.is-error .ua-textarea {
    border: 1.2px solid var(--input-border-error, #DD3636);
    outline: none;
}

.ua-select-control.is-error .ua-select-control__field {
    border: 1.2px solid var(--input-border-error, #DD3636);
}

.ua-form-group.is-error .ua-hint {
  position: relative;
  color: #DD3636 !important;
  border-radius: 6px;
  background: rgba(221, 54, 54, 0.10);
  padding: 8px 8px 8px 28px;
}

.ua-form-group.is-error .ua-hint::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("/ua_portal_design/images/warning.svg") no-repeat center/contain;
}

.ua-input-component {
    position: relative;
    display: flex;
    flex-direction: column;
}

.ua-control-input[type="password"] {
    padding-right: 45px;
}

.ua-toggle-password {
    position: absolute;
    right: 1px;
    bottom: 9px;
    width: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

.ua-toggle-password img {
    width: 20px;
    height: 20px;
    display: block;
}

.ua-select-control.open.is-error .ua-hint {
    display: none !important;
}
