/******************************************************************************
 *
 * Date / Time Picker
 *
 * Shared date and time picker component used throughout CRDM.
 *
 ******************************************************************************/

/* ==========================================================================
   Layout
   ========================================================================== */

.datePicker {
	display: flex !important;
	align-items: center;
	gap: 0.2rem;
}

.datePicker input {
	width: 10ch;
	min-width: 80px;
}

.date-with-icon {
	display: flex;
	gap: 5px;
}

@media (max-width: 810px) {
	.datePicker input {
		width: 100%;
	}
}

/* ==========================================================================
   jQuery UI Datepicker
   ========================================================================== */

.ui-datepicker:not(.ui-timepicker-div) {
	background: #fff;
	border: none;
	border-radius: 4px;
	box-shadow: 0 3px 10px rgba(0,0,0,0.1);
	font-family: inherit;
	padding: 10px;
	width: 250px !important;
	z-index: 9999 !important;
}

.ui-datepicker .ui-widget-header {
	border: none;
}

.ui-datepicker-header {
	background: #fff;
	border-bottom: 1px solid #e5e5e5;
	position: relative;
}

.ui-datepicker .ui-datepicker-title {
	font-weight: 600;
	color: #111827;
	font-size: 15px;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
	position: absolute;
	top: 45% !important;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: rgba(0,0,0,0.9);
}

.ui-datepicker .ui-datepicker-prev {
	left: 8px;
}

.ui-datepicker .ui-datepicker-next {
	right: 8px;
}

.ui-datepicker .ui-datepicker-prev span.ui-icon,
.ui-datepicker .ui-datepicker-next span.ui-icon {
	display: none;
}

.ui-datepicker .ui-datepicker-prev::before {
	content: '‹';
	font-size: 30px;
	line-height: 1;
	font-weight: 300;
}

.ui-datepicker .ui-datepicker-next::after {
	content: '›';
	font-size: 30px;
	line-height: 1;
	font-weight: 300;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
	color: #f64747;
	background: transparent !important;
	border: none;
}

.ui-datepicker th {
	font-family: Arial, Verdana, sans-serif;
	background: inherit;
	font-weight: 400;
}

.ui-datepicker th span {
	color: #333;
	font-size: 13px;
}

.ui-datepicker td .ui-state-default,
.ui-datepicker .ui-datepicker-calendar .ui-state-default {
	background: transparent;
	border: none;
	text-align: center;
	color: #333;
	border-radius: 4px;
}

.ui-datepicker td .ui-state-hover {
	background: #e6e6e6 !important;
}

.ui-datepicker td .ui-state-active,
.ui-datepicker .ui-datepicker-calendar .ui-state-active {
	background: #569ff7 !important;
	color: #fff !important;
}

.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
	width: 45%;
	border: none;
	background: inherit;
	text-align: center;
}

/* ==========================================================================
   jQuery UI Timepicker
   ========================================================================== */

.ui-timepicker-div {
	background: #fff;
	border-top: 1px solid #e5e5e5;
	padding: 0 6px 1px;
	border-radius: 0 0 6px 6px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
	font-family: inherit;
}

.ui-timepicker-div .ui-datepicker-title {
	color: #475569;
}

.ui_tpicker_time_label {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 4px;
}

.ui_tpicker_time {
	font-size: 16px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 12px;
	letter-spacing: 0.5px;
}

.ui-timepicker-div dt {
	font-size: 13px;
	font-weight: 500;
	color: #475569;
	margin: 12px 0 6px;
}

.ui-timepicker-div .ui-slider {
	height: 6px;
	background: #e2e8f0;
	border-radius: 9999px;
	margin: 8px 4px 16px;
}

.ui-timepicker-div .ui-slider .ui-slider-handle {
	width: 14px;
	height: 20px;
	background: #3b82f6;
	border: 1px solid #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
	top: -9px;
	border-radius: 4px;
	cursor: pointer;
}

.ui-timepicker-div .ui-slider .ui-slider-handle:hover {
	background: #2563eb;
	box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}

.ui-tpicker-grid-label td {
	font-size: 12px;
	color: #64748b;
	padding: 4px 2px;
}

.ui-timepicker-div select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	font-size: 14px;
	color: #1e2937;
}

.ui-timepicker-div select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.ui-timepicker-div dl {
	margin: 0;
}

.ui-timepicker-div dd {
	margin: 0 0 14px;
}

.ui-timepicker-select {
	padding: 6px 10px;
	border-radius: 6px;
}

.ui-timepicker-div .ui-datepicker .ui-datepicker-title {
	font-size: 16px;
}

.ui-timepicker-div .ui-widget-header {
	border-bottom: 1px solid #aaa;
	border-radius: 0;
	background: none;
}

/* ==========================================================================
   Calendar Icon
   ========================================================================== */

.calIcon {
	width: 28px;
	height: 28px;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
	font-family: Arial, sans-serif;
	box-shadow: 0 1px 2px #0003;
	flex-shrink: 0;
	cursor: pointer;
}

.calIconMonth {
	height: 12px;
	background: #1e88e5;
	color: #fff;
	font-size: 9px;
	font-weight: bold;
	text-align: center;
	line-height: 11px;
}

.calIconDay {
	position: absolute;
	inset: 12px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
	color: #000;
}

/* ==========================================================================
   Clock Icon
   ========================================================================== */

.clockIcon {
	width: 28px;
	height: 28px;
	background: transparent;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
	font-family: Arial, sans-serif;
	box-shadow: 0 1px 3px rgba(0,0,0,.3);
	flex-shrink: 0;
	cursor: pointer;
}

.clockFace {
	position: absolute;
	inset: 0;
	background: radial-gradient(
		circle at center,
		#f8fbff 0%,
		#e6f0ff 40%,
		#d0e0ff 70%,
		#b8d0f5 100%
	);
	border: 1px solid #555;
	border-radius: 50%;
	box-shadow:
		inset 0 0 3px rgba(255,255,255,.8),
		inset 0 1px 2px rgba(0,0,0,.15);
}

.clockNumber {
	position: absolute;
	font-family: Arial, sans-serif;
	font-size: 7px;
	font-weight: bold;
	color: #222;
	text-shadow: 0 0 1px rgba(255,255,255,.8);
	user-select: none;
	pointer-events: none;
}

#num12 { bottom: 7px; left: 50%; transform: translateX(-50%); }
#num3  { top: 50%; right: 3px; transform: translateY(-50%); }
#num6  { top: 7px; left: 50%; transform: translateX(-50%); }
#num9  { top: 50%; left: 3px; transform: translateY(-50%); }

.clockHand {
	position: absolute;
	left: 50%;
	top: 50%;
	transform-origin: 50% 100%;
	background: #1c1c1c;
	border-radius: 1px;
	box-shadow: 0 1px 1px rgba(0,0,0,.4);
}

.clockHour {
	width: 1.5px;
	height: 6px;
	margin-left: -1.1px;
	margin-top: -6px;
}

.clockMinute {
	width: 1px;
	height: 9px;
	margin-left: -.7px;
	margin-top: -9px;
}

.clockCenter {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 2px;
	height: 2px;
	background: #c00;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	z-index: 10;
	box-shadow: 0 0 1px rgba(0,0,0,.6);
}

.clockDigital {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 8.5px;
	font-weight: bold;
	color: #222;
	letter-spacing: -.5px;
	background: #fff;
}

.clockIcon.digital .clockFace,
.clockIcon.digital .clockNumber,
.clockIcon.digital .clockHand,
.clockIcon.digital .clockCenter {
	display: none;
}

.clockIcon.digital .clockDigital {
	display: flex;
}
