/*
 * The signed-in user's menu of the header (functions/account.php): the same look as the user menu in the top bar of the customer panel
 * (my/admin-ui/src/components/Topbar.vue) - a round 40px circle with the first letter of the name, and a card with the name, the mobile
 * number, the panel's entries, «حساب من» and a red «خروج». Plain CSS (the theme's Tailwind file is a purged build, so new utilities are not in it).
 * Opens on hover, on keyboard focus and on a tap (the focus the button gets stays inside the wrapper) - no script.
 * Colours = the panel's tokens: brand-50 #f3efff, brand-100 #e8e1ff, brand-700 #341d7c, gray-100/200/500/700/800, error-50/600.
 */
.av-account { position: relative; display: block; }

.av-account__btn {
	display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9999px;
	background: #f3efff; color: #341d7c;
	font: inherit; font-size: var(--av-fs-small, 14px); font-weight: var(--av-fw-semibold, 600); line-height: 1; cursor: pointer;
	transition: background-color .15s;
}
.av-account:hover .av-account__btn,
.av-account:focus-within .av-account__btn { background: #e8e1ff; }
.av-account__btn:focus-visible { outline: 2px solid #4a2aad; outline-offset: 2px; }

/* the padding on top is part of the hover area, so the pointer can travel from the circle to the card */
.av-account__menu {
	position: absolute; inset-inline-end: 0; top: 100%; z-index: 1000; width: 256px; padding-top: 8px;
	opacity: 0; visibility: hidden; transform: translateY(6px); pointer-events: none;
	transition: opacity .15s, transform .15s, visibility .15s;
}
.av-account:hover .av-account__menu,
.av-account:focus-within .av-account__menu { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }

.av-account__card {
	padding: 8px; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff;
	box-shadow: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);
	text-align: start;
}
.av-account__head { padding: 8px 12px 12px; border-bottom: 1px solid #f2f4f7; }
.av-account__name { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--av-fs-small, 14px); font-weight: var(--av-fw-medium, 500); line-height: 20px; color: #1d2939; }
.av-account__detail { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--av-fs-caption, 13px); line-height: 18px; color: #667085; text-align: end; }
.av-account__list { margin: 4px 0 0; padding: 0; list-style: none; }
.av-account__list li { margin: 0; padding: 0; }

.av-account__item {
	display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: 0; padding: 8px 12px;
	border: 0; border-radius: 8px; background: none; color: #344054;
	font: inherit; font-size: var(--av-fs-small, 14px); font-weight: var(--av-fw-regular, 400); line-height: 20px; text-decoration: none; text-align: start; white-space: nowrap; cursor: pointer;
}
.av-account__item:hover,
.av-account__item:focus-visible { background: #f2f4f7; color: #344054; }
.av-account__item svg { flex-shrink: 0; width: 20px; height: 20px; }
.av-account__sep { margin: 4px 0 0 !important; padding: 4px 0 0 !important; border-top: 1px solid #f2f4f7; }
.av-account__item.is-danger { color: #d92d20; }
.av-account__item.is-danger:hover,
.av-account__item.is-danger:focus-visible { background: #fef3f2; color: #d92d20; }

/* the sign-out is a form button (the Laravel front's template): the same row as the links */
.av-account__list form { margin: 0; }

/* the number of unread notices: on top of the circle and in the «اعلان‌ها» entry (js/account.js fills them in; hidden while there are none) */
.av-account__btn { position: relative; }
.av-account__badge {
	position: absolute; top: -4px; right: -4px; box-sizing: border-box; min-width: 18px; height: 18px; padding: 0 5px;
	border: 2px solid #fff; border-radius: 9999px; background: #d92d20; color: #fff;
	font-size: 10px; font-weight: var(--av-fw-semibold, 600); line-height: 14px; text-align: center; pointer-events: none;
}
.av-account__count {
	margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
	border-radius: 9999px; background: #fef3f2; color: #d92d20; font-size: var(--av-fs-caption, 13px); font-weight: var(--av-fw-semibold, 600); line-height: 20px; text-align: center;
}
.av-account__badge[hidden], .av-account__count[hidden] { display: none; }

/* the toast for a new notice (bottom corner, over the page) */
.av-toasts { position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 100000; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.av-toast {
	position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border: 1px solid #e4e7ec; border-inline-start: 4px solid #4a2aad; border-radius: 12px; background: #fff;
	box-shadow: 0 12px 16px -4px rgba(16, 24, 40, .12), 0 4px 6px -2px rgba(16, 24, 40, .05);
	animation: av-toast-in .2s ease-out; transition: opacity .2s, transform .2s;
}
.av-toast.is-leaving { opacity: 0; transform: translateY(8px); }
.av-toast__body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; color: #344054; text-decoration: none; }
.av-toast__label { font-size: var(--av-fs-caption, 13px); font-weight: var(--av-fw-semibold, 600); line-height: 20px; color: #341d7c; }
.av-toast__text { font-size: var(--av-fs-caption, 13px); line-height: 22px; color: #344054; }
.av-toast__close { flex-shrink: 0; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 9999px; background: none; color: #667085; font-size: var(--av-fs-h4, 17px); line-height: 24px; cursor: pointer; }
.av-toast__close:hover { background: #f2f4f7; color: #344054; }
@keyframes av-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
