/**
 * Classic time picker — paired with assets/js/classic-time-picker.js.
 * The picker dropdown is appended inside .dg-time-wrap (a positioning
 * span the JS adds around the input), so it scrolls together with any
 * modal / drawer body the field lives in.
 *
 * Two columns (hours / minutes), each a vertical scrollable list with
 * the active value highlighted. Tokens come from main.css / wishes-v2.css.
 */

.dg-time-wrap {
	position: relative;
	display: block;
	width: 100%;
}

/* Subtle visual lock while the dropdown is open. */
.dg-time-input--active {
	border-color: var(--color-primary, #6050b0) !important;
	box-shadow: 0 0 0 3px rgba(96, 80, 176, 0.18);
}

.dg-time-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 1000200;
	display: flex;
	gap: 0.25rem;
	padding: 0.45rem;
	background: #fff;
	border: 1px solid rgba(96, 80, 176, 0.2);
	border-radius: 12px;
	box-shadow: 0 18px 48px rgba(49, 51, 48, 0.18);
	font: inherit;
	font-size: 0.95rem;
}
.dg-time-dropdown[hidden] { display: none; }

/* Keep the popup inside its modal/viewport on narrow screens. The wrap
   shrinks with its grid cell, so percentage max-width is enough. */
@media (max-width: 480px) {
	.dg-time-dropdown {
		left: 0;
		right: auto;
		max-width: calc(100vw - 1.5rem);
	}
}

.dg-time-list {
	list-style: none;
	margin: 0;
	padding: 0.25rem;
	min-width: 64px;
	max-height: 200px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(96, 80, 176, 0.4) transparent;
}
.dg-time-list::-webkit-scrollbar          { width: 6px; }
.dg-time-list::-webkit-scrollbar-track    { background: transparent; }
.dg-time-list::-webkit-scrollbar-thumb    { background: rgba(96, 80, 176, 0.3); border-radius: 999px; }
.dg-time-list::-webkit-scrollbar-thumb:hover { background: rgba(96, 80, 176, 0.55); }

.dg-time-item {
	padding: 0.45rem 0.7rem;
	border-radius: 8px;
	font-variant-numeric: tabular-nums;
	color: var(--color-text-dark, #313330);
	cursor: pointer;
	user-select: none;
	text-align: center;
	transition: background 0.12s, color 0.12s;
}
.dg-time-item:hover {
	background: rgba(96, 80, 176, 0.1);
	color: var(--color-primary, #6050b0);
}
.dg-time-item.is-active {
	background: var(--color-primary, #6050b0);
	color: #fff;
	font-weight: 600;
}

.dg-time-sep {
	display: inline-flex;
	align-items: center;
	padding: 0 0.1rem;
	color: var(--color-text-muted, #5e5f5c);
	font-weight: 600;
}

/* Modal mode — paired with `modal: true` option in classic-time-picker.js.
   Mirrors the air-datepicker `isMobile: true` layout: dimmed backdrop +
   centered dialog, layered above any drawer/modal the input lives in. */
.dg-time-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000101;
	background: rgba(0, 0, 0, 0.45);
}
.dg-time-overlay[hidden] { display: none; }

.dg-time-dropdown--modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000102;
	width: min(280px, calc(100vw - 2rem));
	padding: 0.85rem;
	gap: 0.5rem;
	background: #fff;
	border: 1px solid rgba(96, 80, 176, 0.2);
	border-radius: 14px;
	box-shadow: 0 24px 64px rgba(49, 51, 48, 0.28);
}
.dg-time-dropdown--modal .dg-time-list {
	flex: 1;
	min-width: 0;
	max-height: 240px;
	font-size: 1rem;
}
.dg-time-dropdown--modal .dg-time-item {
	padding: 0.55rem 0.6rem;
}
