/* Copyright (c) 2026 Trubits Innovations Pvt. Ltd.
   Account menu styles. Colours come from the existing trubits.io palette. */
.profile-menu {
  position: relative;
  margin: 0;
  color: #1d1d1f;
  font-family: inherit;
  z-index: 10;
}
.profile-menu .profile-trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 4px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  list-style: none;
}
.profile-menu .profile-trigger::-webkit-details-marker {
  display: none;
}
.profile-menu .profile-trigger::before,
.profile-menu .profile-trigger::after {
  content: none;
}
.profile-menu .profile-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: #f5f5f7;
  color: #0071e3;
  font-size: 13px;
  font-weight: 500;
}
.profile-menu .profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.profile-menu [hidden] {
  display: none !important;
}
.profile-menu .profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(280px, calc(100vw - 96px));
  box-sizing: border-box;
  padding: 20px 12px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform-origin: top right;
}
.profile-menu[open] > .profile-dropdown {
  animation: trubits-account-reveal 180ms ease-out both;
}
.profile-menu .profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 8px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #d2d2d7;
  text-align: center;
  overflow-wrap: anywhere;
}
.profile-menu .profile-identity .profile-avatar {
  width: 80px;
  height: 80px;
  margin-bottom: 4px;
  font-size: 28px;
}
.profile-menu .profile-identity > strong {
  max-width: 100%;
  font-size: 16px;
  font-weight: 500;
}
.profile-menu .profile-email {
  max-width: 100%;
  color: #6e6e73;
  font-size: 13px;
}
.profile-menu .profile-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 12px 16px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #1d1d1f;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.profile-menu .profile-action:hover,
.profile-menu .profile-action:focus-visible {
  background: #f5f5f7;
  color: #0071e3;
}
.profile-menu .profile-trigger:focus-visible,
.profile-menu .profile-action:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}
.profile-menu .profile-action:disabled {
  cursor: wait;
}
.profile-menu .profile-menu-error {
  padding: 8px 16px;
  margin: 0;
  color: inherit;
  font-size: 13px;
}
@keyframes trubits-account-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .profile-menu[open] > .profile-dropdown {
    animation: none;
  }
  .profile-menu .profile-action {
    transition: none;
  }
}
