/* Copyright 2026 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

/* #css_wrapper_metadata_start
 * #type=style-lit
 * #scheme=relative
 * #css_wrapper_metadata_end */

:host {
  display: inline-block;
  pointer-events: none;
  position: absolute;
  right: 16px;
  top: var(--omnibox-everywhere-top-actions-top, 12px);
  z-index: 100;
}

#profileIcon {
  border-radius: 50%;
  height: 36px;
  pointer-events: none;
  width: 36px;
  -webkit-user-drag: none;
}

#profileIcon.clickable {
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 150ms ease-in-out;
}

#profileIcon.clickable:hover {
  opacity: 0.85;
}

#profileMenu {
  --cr-menu-background-color: var(--color-sys-surface-container-high, #eef4fc);
  --cr-menu-border-radius: 20px;
  --cr-menu-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --cr-action-menu-padding: 0;
  min-width: 330px;
  max-width: 360px;
  pointer-events: auto;
}

#profileMenu::part(dialog) {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  margin-top: 8px;
  overflow: hidden;
}

.profile-card {
  background-color: var(--color-sys-surface-container-high, #eef4fc);
  border-radius: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 6px;
}

.profile-card-header {
  align-items: center;
  display: flex;
  gap: 14px;
  padding: 12px 14px 10px 14px;
}

.profile-card-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  height: 44px;
  object-fit: cover;
  width: 44px;
}

.profile-card-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.profile-card-name {
  color: var(--color-sys-on-surface, #1f1f1f);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-email {
  color: var(--color-sys-on-surface-variant, #444746);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-divider {
  background-color: var(--color-sys-outline-variant, #d3dbe5);
  height: 1px;
  margin: 4px 10px 6px 10px;
}

.profile-card-switch-button {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  padding: 10px 14px;
  text-align: left;
  transition: background-color 150ms ease;
  width: 100%;
}

.profile-card-switch-button:hover {
  background-color: var(--color-sys-state-hover-on-subtle, rgba(0, 0, 0, 0.05));
}

.profile-card-switch-button:active {
  background-color: var(--color-sys-state-ripple-neutral-on-subtle, rgba(0, 0, 0, 0.08));
}

.profile-card-switch-icon {
  background-color: var(--color-sys-on-surface, #1f1f1f);
  flex-shrink: 0;
  height: 24px;
  margin-inline-end: 12px;
  width: 24px;
  -webkit-mask-image: url(//resources/cr_components/searchbox/icons/account_circle_old.svg);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px;
}

.profile-card-switch-label {
  color: var(--color-sys-on-surface, #1f1f1f);
  font-size: 14px;
  font-weight: 500;
}

:host-context([webui-rounded-icons]) {
  .profile-card-switch-icon {
    -webkit-mask-image: url(//resources/cr_components/searchbox/icons/account_circle.svg);
  }
}
