/**
 * Shared dropdown / select language for VibeCrew.
 * Use on header menus, account panel, and form <select>s.
 */

:root {
	--vc-dd-bg: #34373a;
	--vc-dd-fg: #e9eaec;
	--vc-dd-muted: #969ca1;
	--vc-dd-border: rgba(255, 255, 255, 0.1);
	--vc-dd-hover: rgba(255, 255, 255, 0.07);
	--vc-dd-radius: 12px;
	--vc-dd-item-radius: 8px;
	--vc-dd-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
	--vc-dd-pad: 10px;
	--vc-dd-width: 288px;
	--vc-dd-field-bg: #1d1e20;
	--vc-dd-field-border: #52575b;
	--vc-dd-danger: var(--vc-accent, #c9a227);

	--vc-select-bg: #ffffff;
	--vc-select-fg: #101011;
	--vc-select-border: #c3c6c9;
	--vc-select-hover-border: #8e9398;
	--vc-select-muted: #61676c;
	--vc-select-radius: 7px;
	--vc-select-h: 40px;
	--vc-select-panel-bg: #ffffff;
	--vc-select-panel-fg: #202124;
	--vc-select-panel-muted: #70757a;
	--vc-select-panel-border: #d9dcdf;
	--vc-select-panel-hover: #f1f3f4;
	--vc-select-panel-active: #e9ecef;
	--vc-select-panel-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

body.color_scheme_dark {
	--vc-select-bg: #1f2123;
	--vc-select-fg: #e9eaec;
	--vc-select-border: #464a4e;
	--vc-select-hover-border: #71777c;
	--vc-select-muted: #969ca1;
	--vc-select-panel-bg: #292b2e;
	--vc-select-panel-fg: #e8eaed;
	--vc-select-panel-muted: #9aa0a6;
	--vc-select-panel-border: #44474b;
	--vc-select-panel-hover: #35383b;
	--vc-select-panel-active: #3b3e41;
	--vc-select-panel-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

/* Rhymix member/document popup menu — match the shared floating dropdown. */
#rhymix_popup_menu,
#popup_menu_area {
	z-index: 9999;
	min-width: 152px;
	max-width: min(260px, calc(100vw - 24px));
	margin: 6px 0 !important;
	padding: 6px !important;
	border: 1px solid var(--vc-select-panel-border) !important;
	border-radius: 9px !important;
	background: var(--vc-select-panel-bg) !important;
	color: var(--vc-select-panel-fg) !important;
	box-shadow: var(--vc-select-panel-shadow) !important;
	box-sizing: border-box;
	font-family: SpoqaHanSansNeo, "Malgun Gothic", system-ui, sans-serif;
	font-size: 13px;
	animation: vc-select-panel-in 0.16s ease;
}

#rhymix_popup_menu ul,
#popup_menu_area ul {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

#rhymix_popup_menu li,
#popup_menu_area li {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	line-height: 1.35;
}

#rhymix_popup_menu a,
#popup_menu_area a {
	display: block;
	padding: 8px 10px !important;
	border: 0;
	border-radius: 6px;
	background: transparent !important;
	color: var(--vc-select-panel-fg) !important;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none !important;
	white-space: nowrap;
}

#rhymix_popup_menu a:hover,
#rhymix_popup_menu a:active,
#rhymix_popup_menu a:focus-visible,
#popup_menu_area a:hover,
#popup_menu_area a:active,
#popup_menu_area a:focus-visible {
	background: var(--vc-select-panel-hover) !important;
	color: var(--vc-select-panel-fg) !important;
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	#rhymix_popup_menu,
	#popup_menu_area {
		animation: none;
	}
}

/* ---- Popover panel ---- */
.vc-dd {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 40;
	display: none;
	flex-direction: column;
	gap: 2px;
	width: var(--vc-dd-width);
	max-width: min(var(--vc-dd-width), calc(100vw - 24px));
	min-width: 180px;
	padding: var(--vc-dd-pad);
	background: var(--vc-dd-bg);
	color: var(--vc-dd-fg);
	border: 1px solid var(--vc-dd-border);
	border-radius: var(--vc-dd-radius);
	box-shadow: var(--vc-dd-shadow);
}

.vc-dd.is-open,
[data-vc-dd].is-open > .vc-dd:not([hidden]),
[data-vc-dd].open > .vc-dd:not([hidden]) {
	display: flex;
}

[data-vc-dd].is-drop-up > .vc-dd,
.vc-dd.is-drop-up {
	top: auto;
	bottom: calc(100% + 6px);
}

.vc-dd[hidden] {
	display: none !important;
}

.vc-dd--end {
	left: auto;
	right: 0;
}

/* Attached under dark header chrome */
.vc-dd--flush {
	border-top: 0;
	border-radius: 0 0 var(--vc-dd-radius) var(--vc-dd-radius);
}

.vc-dd-head {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 2px 6px 12px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--vc-dd-border);
}

.vc-dd-head strong {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--vc-dd-fg);
}

.vc-dd-head span {
	font-size: 12px;
	line-height: 1.4;
	color: var(--vc-dd-muted);
}

.vc-dd-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-radius: var(--vc-dd-item-radius);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--vc-dd-fg);
	text-decoration: none;
	white-space: nowrap;
	background: transparent;
	border: 0;
	width: 100%;
	text-align: left;
	cursor: pointer;
	font-family: inherit;
}

.vc-logout-form {
	margin: 0;
	padding: 0;
}

.vc-dd-item i {
	font-size: 18px;
	color: #b7babe;
	flex: 0 0 auto;
}

.vc-dd-item:hover,
.vc-dd-item:focus-visible,
.vc-dd-item.active {
	background: var(--vc-dd-hover);
	outline: 0;
}

.vc-dd-item.active {
	color: var(--vc-accent, #c9a227);
}

.vc-dd-item.active i,
.vc-dd-item.is-danger,
.vc-dd-item.is-danger i {
	color: var(--vc-dd-danger);
}

.vc-dd-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 2px;
}

.vc-dd-form input[type="text"],
.vc-dd-form input[type="email"],
.vc-dd-form input[type="password"] {
	width: 100%;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--vc-dd-field-border);
	border-radius: var(--vc-dd-item-radius);
	background: var(--vc-dd-field-bg);
	color: var(--vc-dd-fg);
	font-size: 14px;
	font-family: inherit;
}

.vc-dd-form input::placeholder {
	color: var(--vc-dd-muted);
}

.vc-dd-form input:focus {
	outline: 0;
	border-color: #969ca1;
}

.vc-dd-check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--vc-dd-muted);
	cursor: pointer;
}

.vc-dd-form button[type="submit"],
.vc-dd-submit {
	height: 42px;
	margin-top: 2px;
	border: 0;
	border-radius: var(--vc-dd-item-radius);
	background: var(--vc-cta, #c9a227);
	color: var(--vc-on-cta, #111111);
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}

.vc-dd-form button[type="submit"]:hover,
.vc-dd-submit:hover {
	background: var(--vc-cta-hover, #d5b13a);
}

.vc-dd-links {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding-top: 4px;
}

.vc-dd-links a {
	font-size: 12px;
	font-weight: 600;
	color: #b7babe;
}

.vc-dd-links a:hover {
	color: var(--vc-dd-fg);
}

/* ---- Native select (same radius / density as dd fields) ---- */
.vc-select,
.vc-shell select,
.vc-board select {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	height: var(--vc-select-h);
	padding: 0 36px 0 12px;
	border: 1px solid var(--vc-select-border);
	border-radius: var(--vc-select-radius);
	background-color: var(--vc-select-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23969ca1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	background-size: 14px;
	color: var(--vc-select-fg);
	font-size: 14px;
	font-weight: 400;
	font-family: inherit;
	line-height: var(--vc-select-h);
	cursor: pointer;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.vc-select:hover,
.vc-shell select:hover,
.vc-board select:hover {
	border-color: var(--vc-select-hover-border);
}

.vc-select:focus,
.vc-shell select:focus,
.vc-board select:focus {
	outline: 0;
	border-color: var(--vc-brand, #c9a227);
	box-shadow: 0 0 0 3px var(--vc-brand-soft, rgba(201, 162, 39, 0.12));
}

.vc-select:disabled,
.vc-shell select:disabled,
.vc-board select:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.vc-shell select option,
.vc-shell select optgroup,
.vc-board select option,
.vc-board select optgroup {
	background-color: var(--vc-select-bg);
	color: var(--vc-select-fg);
}

.vc-shell select option:checked,
.vc-board select option:checked {
	background: color-mix(in srgb, var(--vc-brand, #c9a227) 16%, var(--vc-select-bg)) linear-gradient(0deg, color-mix(in srgb, var(--vc-brand, #c9a227) 16%, var(--vc-select-bg)), color-mix(in srgb, var(--vc-brand, #c9a227) 16%, var(--vc-select-bg)));
	color: var(--vc-accent, #9a7800);
	font-weight: 600;
}

body.color_scheme_dark .vc-shell select,
body.color_scheme_dark .vc-board select {
	color-scheme: dark;
}

/* Keep native choice controls inside the same restrained brand palette. */
.vc-shell input[type="checkbox"],
.vc-shell input[type="radio"] {
	accent-color: var(--vc-brand, #c9a227);
}

.vc-select--compact {
	height: 30px;
	line-height: 30px;
	padding-left: 10px;
	font-size: 13px;
}

/* ---- Progressive custom select UI (keeps native <select> as source of truth) ---- */
.vc-select-ui {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	width: auto;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	z-index: 1;
}

.vc-shell .vc-select-ui,
.vc-board .vc-select-ui {
	font-family: SpoqaHanSansNeo, "Malgun Gothic", system-ui, sans-serif;
}

.vc-select-ui.is-open {
	z-index: 60;
}

.vc-select-ui > select.vc-select-native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	min-height: 0 !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
	white-space: nowrap !important;
	background: none !important;
	box-shadow: none !important;
}

.vc-select-toggle {
	display: inline-flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100% !important;
	min-width: 0;
	min-height: var(--vc-select-h) !important;
	height: var(--vc-select-h) !important;
	margin: 0 !important;
	padding: 0 36px 0 12px !important;
	border: 1px solid var(--vc-select-border) !important;
	border-radius: var(--vc-select-radius) !important;
	background-color: var(--vc-select-bg) !important;
	background-image: none !important;
	color: var(--vc-select-fg) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	font-family: inherit !important;
	line-height: 1.3 !important;
	text-align: left !important;
	text-shadow: none !important;
	box-shadow: none !important;
	cursor: pointer;
	box-sizing: border-box !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, border-radius 0.15s ease;
}

.vc-select-value {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vc-select-ui.is-empty .vc-select-value {
	color: var(--vc-select-muted);
}

.vc-select-caret {
	position: absolute;
	right: 11px;
	top: 50%;
	width: 14px;
	height: 14px;
	margin-top: -7px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23969ca1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 14px no-repeat;
	transition: transform 0.18s ease;
	pointer-events: none;
}

.vc-select-toggle {
	position: relative;
}

.vc-select-ui:hover .vc-select-toggle:not(:disabled) {
	border-color: var(--vc-select-hover-border) !important;
}

.vc-select-ui.is-open .vc-select-toggle,
.vc-select-toggle:focus-visible {
	outline: 0;
	border-color: var(--vc-select-hover-border) !important;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--vc-select-hover-border) 22%, transparent) !important;
}

.vc-select-ui.is-open .vc-select-caret {
	transform: rotate(180deg);
}

.vc-select-ui.is-disabled .vc-select-toggle,
.vc-select-toggle:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.vc-select-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 70;
	display: flex;
	flex-direction: column;
	gap: 1px;
	max-height: min(420px, 60vh);
	margin: 0;
	padding: 6px;
	overflow: auto;
	border: 1px solid var(--vc-select-panel-border);
	border-radius: 9px;
	background: var(--vc-select-panel-bg);
	color: var(--vc-select-panel-fg);
	box-shadow: var(--vc-select-panel-shadow);
	box-sizing: border-box;
	transform-origin: top center;
	animation: vc-select-panel-in 0.16s ease;
}

.vc-select-panel.is-fixed {
	right: auto;
	/* left/top/width/max-height are set by JS against the viewport */
}

.vc-select-ui.is-drop-up .vc-select-panel:not(.is-fixed) {
	top: auto;
	bottom: calc(100% + 6px);
	transform-origin: bottom center;
	animation-name: vc-select-panel-in-up;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
}

.vc-select-ui.is-drop-up .vc-select-panel.is-fixed {
	transform-origin: bottom center;
	animation-name: vc-select-panel-in-up;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
}

body.color_scheme_dark .vc-select-ui.is-drop-up .vc-select-panel {
	box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.34);
}

.vc-select-panel[hidden] {
	display: none !important;
	animation: none;
}

@keyframes vc-select-panel-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes vc-select-panel-in-up {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.vc-select-panel {
		animation: none;
	}
	.vc-select-caret {
		transition: none;
	}
}

.vc-select-group {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.vc-select-group + .vc-select-group,
.vc-select-group + .vc-select-option,
.vc-select-option + .vc-select-group {
	margin-top: 4px;
}

.vc-select-group-label {
	padding: 6px 10px 4px;
	color: var(--vc-select-panel-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.vc-select-option {
	position: relative;
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 8px 34px 8px 10px !important;
	border: 0 !important;
	border-radius: 6px !important;
	background: transparent !important;
	color: var(--vc-select-panel-fg) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	font-family: inherit !important;
	line-height: 1.35 !important;
	text-align: left !important;
	white-space: normal;
	cursor: pointer;
	box-shadow: none !important;
	text-shadow: none !important;
}

.vc-select-option:hover,
.vc-select-option:focus-visible,
.vc-select-option.is-focus {
	background: var(--vc-select-panel-hover) !important;
	outline: 0;
}

.vc-select-option.is-active {
	color: var(--vc-select-panel-fg) !important;
	background: var(--vc-select-panel-active) !important;
	font-weight: 600 !important;
}

.vc-select-option.is-active::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 11px;
	width: 12px;
	height: 7px;
	border-left: 1.8px solid currentColor;
	border-bottom: 1.8px solid currentColor;
	transform: translateY(-65%) rotate(-45deg);
}

.vc-select-option[data-disabled],
.vc-select-option[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Full-width form contexts */
.vc-shell .vc-member-search .vc-select-ui,
.vc-shell .vc-member-toolbar .vc-select-ui,
.vc-shell .vc-friend-toolbar .vc-select-ui,
.vc-shell .vc-write-field .vc-select-ui,
.vc-board .vc-write-field .vc-select-ui,
.vc-board .write_header .vc-select-ui,
#fo_component.vc-declare .vc-select-ui {
	display: block;
	width: 100%;
}

.vc-shell .vc-member-area {
	--vc-select-h: 40px;
	--vc-select-radius: 7px;
}

.vc-shell .vc-message-toolbar .vc-select-ui {
	display: inline-flex;
	width: auto;
	min-width: 118px;
	flex: 1 1 auto;
}

/* Compact variant (opt-in via .vc-select--compact only) */
.vc-select-ui--compact {
	--vc-select-h: 32px;
}

.vc-select-ui--compact .vc-select-toggle {
	padding: 0 30px 0 10px !important;
	font-size: 13px !important;
}

.vc-select-ui--compact .vc-select-caret {
	right: 8px;
}

#fo_component.vc-declare {
	--vc-select-h: 42px;
	--vc-select-radius: 7px;
	--vc-select-bg: #1d1e20;
	--vc-select-fg: #eef0f2;
	--vc-select-border: #44474b;
	--vc-select-hover-border: #71777c;
	--vc-select-panel-bg: #292b2e;
	--vc-select-panel-fg: #e8eaed;
	--vc-select-panel-muted: #9aa0a6;
	--vc-select-panel-border: #44474b;
	--vc-select-panel-hover: #35383b;
	--vc-select-panel-active: #3b3e41;
	--vc-select-panel-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

#fo_component.vc-declare .vc-select-ui {
	margin: 0 0 16px;
}
