/**
 * Learner account menu: floating (auto-inject) or inline (shortcode / theme header).
 */

.rc-ras-user-menu {
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
}

/* Fixed top-right (Royal Academy “floating” menu when enabled in settings). */
.rc-ras-user-menu--floating {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 999998;
}

body.admin-bar .rc-ras-user-menu--floating {
	top: 48px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .rc-ras-user-menu--floating {
		top: 60px;
	}
}

/* Inline placement (e.g. [ra_user_header_menu] in Elementor / block header). */
.rc-ras-user-menu--inline {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	vertical-align: middle;
	z-index: 100;
}

.rc-ras-user-menu__details {
	position: relative;
	margin: 0;
}

.rc-ras-user-menu__summary {
	list-style: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: min( 280px, calc( 100vw - 24px ) );
	padding: 8px 14px;
	margin: 0;
	border-radius: 999px;
	background: rgba( 15, 23, 42, 0.92 );
	color: #f8fafc;
	border: 1px solid rgba( 255, 255, 255, 0.12 );
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.2 );
}

.rc-ras-user-menu__summary::-webkit-details-marker {
	display: none;
}

.rc-ras-user-menu__summary:hover,
.rc-ras-user-menu__summary:focus {
	outline: 2px solid #c9a227;
	outline-offset: 2px;
}

.rc-ras-user-menu__name {
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rc-ras-user-menu__caret {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #cbd5e1;
	flex-shrink: 0;
}

.rc-ras-user-menu__panel {
	position: absolute;
	right: 0;
	top: calc( 100% + 8px );
	min-width: 220px;
	max-width: min( 320px, calc( 100vw - 24px ) );
	padding: 8px 0;
	margin: 0;
	background: #fff;
	color: #0f172a;
	border: 1px solid rgba( 15, 23, 42, 0.12 );
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba( 0, 0, 0, 0.18 );
}

.rc-ras-user-menu__link {
	display: block;
	padding: 10px 16px;
	color: #0f172a;
	text-decoration: none;
	font-weight: 500;
}

.rc-ras-user-menu__link:hover,
.rc-ras-user-menu__link:focus {
	background: #f1f5f9;
	color: #0f172a;
}

.rc-ras-user-menu__link--logout {
	margin-top: 4px;
	border-top: 1px solid #e2e8f0;
	font-weight: 600;
	color: #b91c1c;
}

.rc-ras-user-menu__link--logout:hover,
.rc-ras-user-menu__link--logout:focus {
	background: #fef2f2;
	color: #991b1b;
}

/* Logged-out “Log in” control (shortcode). */
.rc-ras-user-menu__login-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	margin: 0;
	border-radius: 999px;
	background: rgba( 15, 23, 42, 0.92 );
	color: #f8fafc;
	border: 1px solid rgba( 255, 255, 255, 0.12 );
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.15 );
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
}

.rc-ras-user-menu__login-btn:hover,
.rc-ras-user-menu__login-btn:focus {
	color: #fff;
	outline: 2px solid #c9a227;
	outline-offset: 2px;
}

.rc-ras-user-menu--floating[dir="rtl"] {
	right: auto;
	left: 12px;
}

.rc-ras-user-menu--floating[dir="rtl"] .rc-ras-user-menu__panel {
	right: auto;
	left: 0;
}
