/* User Profile Button in Header */
.user-auth-area {
  position: relative;
  display: inline-block;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.user-profile-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background-color: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Profile Dropdown Menu */
.profile-dropdown {
  position: absolute;
  top: 115%;
  right: 0;
  width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInDown var(--transition-fast);
  transform-origin: top right;
}

.profile-dropdown hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-greet {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.dropdown-username {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  width: 100%;
}

.dropdown-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent-primary);
}

.dropdown-item.danger {
  color: var(--color-danger);
}

.dropdown-item.danger:hover {
  background-color: var(--color-danger-glass);
}

/* Keyframe dropdown animation */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Relocated Theme Selector in Profile Dropdown */
.profile-dropdown .theme-mood-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}

.profile-dropdown .theme-mood-selector:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.profile-dropdown .mood-select {
  flex-grow: 1;
  text-align: right;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.profile-dropdown .mood-icon-svg {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

.profile-dropdown .mood-icon-svg svg {
  width: 14px;
  height: 14px;
}

/* Auth Modal Adjustments */
#login-error-msg {
  transition: all var(--transition-fast);
}

#login-toggle-prompt a:hover {
  text-decoration: underline;
}
