/* Popup Container */
.mh-popup {
  position: absolute;
  z-index: 9999; /* Ensure it's on top */
  width: 300px;
  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  pointer-events: none;
  
  /* No Animation */
  display: none;
  
  overflow: hidden;
  flex-direction: column;
}

.mh-popup.visible {
  display: flex;
  pointer-events: auto;
}

/* Popup Image */
.mh-popup-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background-color: var(--md-default-bg-color--lighter);
  display: none; /* Hidden by default until image found */
  margin: 0;
}

.mh-popup-image.portrait {
  object-fit: contain;
}

.mh-popup-image.profile-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 12px auto 0;
  display: block;
  object-fit: cover;
  border: 2px solid var(--md-default-fg-color--lightest);
}

/* Popup Content */
.mh-popup-content {
  padding: 12px;
}

/* Popup Header */
.mh-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* Popup Icon */
.mh-popup-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 2px;
}

.mh-popup-icon-span {
  width: 20px;
  height: 20px;
  display: inline-block;
  font-size: 20px;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
}

/* Popup Title */
.mh-popup-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--md-primary-fg-color);
  line-height: 1.2;
}

.mh-popup-title a {
  color: inherit;
  text-decoration: none;
}

.mh-popup-title a:hover {
  text-decoration: underline;
  color: var(--md-primary-fg-color);
}

/* Popup Description */
.mh-popup-desc {
  color: var(--md-default-fg-color--light);
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: break-word;
  scrollbar-width: thin;
}

.mh-popup-desc::-webkit-scrollbar {
  width: 6px;
}

.mh-popup-desc::-webkit-scrollbar-thumb {
  background-color: var(--md-default-fg-color--lightest);
  border-radius: 3px;
}

/* Link Icons */
.link-icon {
  width: 1em;
  height: 1em;
  margin-right: 4px;
  vertical-align: middle;
  display: inline-block;
  border-radius: 2px;
  transform: translateY(-2px);
}
