/**
 * Events lobby – "סוג אירוע" select (select2).
 * Scoped by data-select2-class="events-type-select2" (selection + dropdown),
 * so other select2 fields on the site are not affected.
 * Matches the sibling inputs: 45px pill, white bg, same arrow + padding as the datepicker fields.
 */

/* ---------- Closed field ---------- */
.events-top-form .select2-container--default .select2-selection--single.events-type-select2 {
	display: flex;
	align-items: center;
	height: 45px;
	background: #fff;
	border: 1px solid rgba(20, 10, 97, .3);
	border-radius: 50px;
	overflow: hidden;
	-webkit-transition: border-color .2s ease;
	transition: border-color .2s ease;
}

.events-top-form .select2-container--default .select2-selection--single.events-type-select2 .select2-selection__rendered {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0 18px 0 50px; /* right: like the other inputs, left: room for the arrow */
	line-height: 1.4;
	font-size: 16px;
	color: #140a61;
	text-align: right;
}

/* Arrow: same svg + position as the datepicker fields (18px from the left edge), inside the field */
.events-top-form .select2-container--default .select2-selection--single.events-type-select2 .select2-selection__arrow,
.events-top-form .select2-container--default[dir="rtl"] .select2-selection--single.events-type-select2 .select2-selection__arrow {
	top: 0;
	right: auto;
	left: 0;
	width: 50px;
	height: 100%;
	background: url(../../images/arrow_bottom_blue.svg) center / 14px 9px no-repeat;
	-webkit-transition: transform .2s ease;
	transition: transform .2s ease;
	pointer-events: none;
}

.events-top-form .select2-container--default .select2-selection--single.events-type-select2 .select2-selection__arrow b {
	display: none;
}

/* Hover / keyboard focus */
.events-top-form .select2-container--default .select2-selection--single.events-type-select2:hover,
.events-top-form .select2-container--default.select2-container--focus .select2-selection--single.events-type-select2 {
	border-color: rgba(20, 10, 97, .6);
}

.events-top-form .select2-container--default .select2-selection--single.events-type-select2:focus-visible {
	outline: 2px solid #337dff;
	outline-offset: 2px;
}

/* ---------- Open state: keep the pill intact (select2 default flattens + removes the bottom border) ---------- */
.events-top-form .select2-container--default.select2-container--open .select2-selection--single.events-type-select2,
.events-top-form .select2-container--default.select2-container--open.select2-container--below .select2-selection--single.events-type-select2,
.events-top-form .select2-container--default.select2-container--open.select2-container--above .select2-selection--single.events-type-select2 {
	border: 1px solid #1830ff;
	border-radius: 50px;
}

.events-top-form .select2-container--open .select2-selection--single.events-type-select2 .select2-selection__arrow {
	-webkit-transform: rotate(180deg);
	transform: rotate(180deg);
}

/* ---------- Dropdown (appended to <body>) – floating card under the field ---------- */
.select2-container--open .select2-dropdown.events-type-select2,
.select2-container--open .select2-dropdown--below.events-type-select2,
.select2-container--open .select2-dropdown--above.events-type-select2 {
	background: #fff;
	border: 1px solid rgba(20, 10, 97, .15);
	border-radius: 20px;
	-webkit-box-shadow: 0 8px 24px rgba(24, 48, 255, .15);
	box-shadow: 0 8px 24px rgba(24, 48, 255, .15);
	overflow: hidden;
}

.select2-container--open .select2-dropdown--below.events-type-select2 {
	margin-top: 6px;
}

.select2-container--open .select2-dropdown--above.events-type-select2 {
	margin-top: -6px;
}

.select2-dropdown.events-type-select2 .select2-results > .select2-results__options {
	max-height: 280px;
	padding: 6px 0;
	overscroll-behavior: contain;
}

.select2-dropdown.events-type-select2 .select2-results__option {
	padding: 11px 20px;
	font-size: 16px;
	line-height: 22px;
	color: #140a61;
	text-align: right;
}

.select2-container--default .select2-dropdown.events-type-select2 .select2-results__option--selected,
.select2-container--default .select2-dropdown.events-type-select2 .select2-results__option[aria-selected="true"] {
	background: #f3f5ff;
	font-weight: 700;
}

.select2-container--default .select2-dropdown.events-type-select2 .select2-results__option--highlighted.select2-results__option--selectable {
	background: #e3e7ff;
	color: #140a61;
}

/* ---------- High-contrast mode (site accessibility toolbar) ---------- */
.show-contrast .events-top-form .select2-container--default .select2-selection--single.events-type-select2,
.show-contrast .select2-dropdown.events-type-select2 {
	background: #000;
	border-color: #ff0;
}

.show-contrast .events-top-form .select2-container--default .select2-selection--single.events-type-select2 .select2-selection__rendered,
.show-contrast .select2-dropdown.events-type-select2 .select2-results__option {
	color: #ff0;
}

.show-contrast .events-top-form .select2-container--default .select2-selection--single.events-type-select2 .select2-selection__arrow {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M12.9961 1.40625L7.33597 7.59375L1.67584 1.40625' stroke='%23ff0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
	.events-top-form .select2-selection--single.events-type-select2 .select2-selection__arrow {
		-webkit-transition: none;
		transition: none;
	}
}
