/* All rules are scoped under .wit-profile so they never touch
   other elements/components already on the page. No body/html/*
   selectors are used. */

.wit-profile-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 2px;
}

.wit-profile-trigger {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.wit-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.wit-profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10005;
  filter: drop-shadow(0 15px 35px rgba(124, 58, 237, 0.18));
  animation: witProfileFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes witProfileFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wit-profile {
  --wp-bg: #ffffff;
  --wp-card-bg: #ffffff;
  --wp-purple-primary: #7c3aed;
  --wp-purple-hover: #6d28d9;
  --wp-purple-light: #f5f3ff;
  --wp-purple-border: #e9d5ff;
  --wp-border: #e2e8f0;
  --wp-text: #0f172a;
  --wp-text-muted: #475569;
  --wp-danger: #ef4444;
  --wp-input-bg: #f8fafc;

  all: initial;
  display: block;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--wp-text);
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(88vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--wp-card-bg);
  border: 1px solid var(--wp-purple-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px -15px rgba(124, 58, 237, 0.22), 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  text-align: left;
}

.wit-profile::-webkit-scrollbar {
  width: 6px;
}
.wit-profile::-webkit-scrollbar-track {
  background: #f5f3ff;
  border-radius: 4px;
}
.wit-profile::-webkit-scrollbar-thumb {
  background: #c4b5fd;
  border-radius: 4px;
}
.wit-profile::-webkit-scrollbar-thumb:hover {
  background: #a78bfa;
}

.wit-profile *,
.wit-profile *::before,
.wit-profile *::after {
  box-sizing: border-box;
  font-family: inherit;
}

/* Ensure Material Icons font family is preserved inside widget */
.wit-profile .material-icons,
.wit-profile i.material-icons,
.wit-profile span.material-icons {
  font-family: 'Material Icons' !important;
  font-style: normal;
  font-weight: normal;
  text-transform: none;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

.wit-profile__header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 4px;
}

.wit-profile__edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  background: var(--wp-purple-light);
  color: var(--wp-purple-hover);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.wit-profile__edit-btn:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.wit-profile__avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  margin-bottom: 6px;
}

.wit-profile__name {
  margin: 8px 0 2px;
  font-size: 18px;
  font-weight: 700;
  color: var(--wp-text);
}

.wit-profile__role {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--wp-text-muted);
}

.wit-profile__divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 18px 0;
}

.wit-profile__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 14px;
}

.wit-profile__table tr {
  background: var(--wp-input-bg);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.wit-profile__table tr:hover {
  background: #f1f5f9;
}

.wit-profile__table td {
  padding: 12px 14px;
  vertical-align: middle;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.wit-profile__table td:first-child {
  border-left: 1px solid #e2e8f0;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  width: 90px;
}

.wit-profile__table td:last-child {
  border-right: 1px solid #e2e8f0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.wit-profile__label-td {
  color: var(--wp-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  height: 100%;
}

.wit-profile__label-td .material-icons {
  font-size: 18px;
  color: var(--wp-purple-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wit-profile__value {
  text-align: right;
  font-weight: 600;
  color: var(--wp-text);
  font-size: 13px;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 295px;
}

.wit-profile__form {
  display: flex;
  flex-direction: column;
}

.wit-profile__form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--wp-text-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  text-align: left;
}

.wit-profile__form label:first-child {
  margin-top: 0;
}

.wit-profile__form input {
  font-size: 14px;
  height: 38px;
  line-height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--wp-input-bg);
  color: var(--wp-text);
  outline: none;
  transition: all 0.2s ease;
}

.wit-profile__form input:focus {
  border-color: var(--wp-purple-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.wit-profile__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.wit-profile__input-wrapper input {
  width: 100%;
  padding-right: 36px !important;
}

.wit-profile__eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px !important;
  color: var(--wp-text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.wit-profile__eye:hover {
  color: var(--wp-purple-primary);
}

.wit-profile__error {
  color: var(--wp-danger);
  font-size: 12px;
  font-weight: 500;
  margin: 8px 0 0;
}

.wit-profile__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 4px;
}

.wit-profile__btn {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  height: 38px;
  line-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.wit-profile__btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.wit-profile__btn--primary {
  background: var(--wp-purple-primary);
  border-color: var(--wp-purple-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.wit-profile__btn--primary:hover {
  background: var(--wp-purple-hover);
  border-color: var(--wp-purple-hover);
}

.wit-profile__btn--block {
  width: 100%;
  background: var(--wp-purple-light);
  border: 1px solid #ddd6fe;
  color: var(--wp-purple-hover);
}

.wit-profile__btn--block:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

/* Avatar Context Actions Menu Styles */
.wit-profile__avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.wit-profile__avatar-menu {
  position: absolute;
  top: calc(100% + 5px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  z-index: 10010;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  animation: witProfileFadeIn 0.15s ease;
}

.wit-profile__avatar-menu button {
  background: none;
  border: none;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  font-size: 13px;
  font-family: 'Roboto', Arial, sans-serif;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.wit-profile__avatar-menu button:hover {
  background: #f1f5f9;
}

.wit-profile__avatar-menu button.danger {
  color: #ef4444;
}

.wit-profile__avatar-menu button.danger:hover {
  background: #fef2f2;
}

.wit-profile__avatar-menu button i {
  font-size: 16px;
}
