/* WeReTrade User Profile Widget - Coop Style */

.wt-user-widget {
  position: relative;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  z-index: 9999;
}

.wt-user-widget__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border, #1f2a3a);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text, #e9f2ff);
  transition: all 0.2s ease;
  padding: 0;
}

.wt-user-widget__trigger:hover {
  background: rgba(62, 166, 255, 0.12);
  border-color: var(--accent, #3ea6ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(62, 166, 255, 0.2);
}

.wt-user-widget__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #3ea6ff), var(--accent-2, #06d6a0));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f14;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.wt-user-widget__icon svg {
  width: 16px;
  height: 16px;
}

.wt-user-widget__name {
  display: none;
}

.wt-user-widget__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--card, #0e1520);
  border: 1px solid var(--border, #1f2a3a);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  overflow: hidden;
}

.wt-user-widget__dropdown.wt-user-widget__dropdown--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wt-user-widget__dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--border, #1f2a3a);
  background: linear-gradient(135deg, rgba(62, 166, 255, 0.12), rgba(6, 214, 160, 0.08));
}

.wt-user-widget__dropdown-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #e9f2ff);
}

.wt-user-widget__dropdown-email {
  font-size: 12px;
  color: var(--muted, #9db1c9);
  margin-top: 4px;
}

.wt-user-widget__dropdown-role {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  background: rgba(62, 166, 255, 0.16);
  color: var(--accent, #3ea6ff);
  border-radius: 999px;
  margin-top: 8px;
  font-weight: 600;
}

.wt-user-widget__dropdown-menu {
  padding: 8px;
}

.wt-user-widget__menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text, #e9f2ff);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s ease;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.wt-user-widget__menu-item:hover {
  background: rgba(62, 166, 255, 0.12);
  color: var(--accent, #3ea6ff);
  transform: translateX(2px);
}

.wt-user-widget__menu-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.wt-user-widget__menu-item:hover .wt-user-widget__menu-icon {
  opacity: 1;
}

.wt-user-widget__menu-separator {
  height: 1px;
  background: var(--border, #1f2a3a);
  margin: 8px 0;
}

.wt-user-widget__menu-item--danger {
  color: var(--danger, #ef476f);
}

.wt-user-widget__menu-item--danger:hover {
  background: rgba(239, 71, 111, 0.12);
  color: var(--danger, #ef476f);
}

/* Loading state */
.wt-user-widget--loading .wt-user-widget__trigger {
  opacity: 0.6;
  cursor: wait;
}

/* Light theme support */
[data-theme="light"] .wt-user-widget__trigger {
  background: #f0f4f8;
  border-color: rgba(31, 42, 58, 0.2);
}

[data-theme="light"] .wt-user-widget__trigger:hover {
  background: rgba(62, 166, 255, 0.08);
}

[data-theme="light"] .wt-user-widget__dropdown {
  background: #ffffff;
  border-color: rgba(31, 42, 58, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .wt-user-widget__dropdown-header {
  border-color: rgba(31, 42, 58, 0.15);
  background: linear-gradient(135deg, rgba(62, 166, 255, 0.08), rgba(6, 214, 160, 0.06));
}

[data-theme="light"] .wt-user-widget__dropdown-name {
  color: #0b0f14;
}

[data-theme="light"] .wt-user-widget__dropdown-email {
  color: #5a6c7d;
}

[data-theme="light"] .wt-user-widget__menu-item {
  color: #0b0f14;
}

[data-theme="light"] .wt-user-widget__menu-item:hover {
  background: rgba(62, 166, 255, 0.08);
}

[data-theme="light"] .wt-user-widget__menu-separator {
  background: rgba(31, 42, 58, 0.15);
}
