/* ========================================
 * Entity Action Menu
 * ========================================
 * Contextual action popup for clickable entities in narrative.
 * Shows when clicking wiki-links (NPCs, locations, items, etc.)
 */

.entity-action-menu {
  position: fixed !important;
  z-index: 10000 !important;
  min-width: 180px;
  max-width: 280px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 215, 0, 0.1);
  overflow: hidden;
  animation: entityMenuFadeIn 0.15s ease-out;
}

@keyframes entityMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header with entity name */
.entity-action-menu__header {
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  color: #ffd700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Divider between action groups */
.entity-action-menu__divider {
  height: 1px;
  margin: 4px 12px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Action button */
.entity-action-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #e0e0e0;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.entity-action-menu__item:hover {
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}

.entity-action-menu__item:active {
  background: rgba(255, 215, 0, 0.2);
  transform: scale(0.98);
}

/* Icon in action item */
.entity-action-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 14px;
}

/* Type-specific styling for attack action */
.entity-action-menu__item[data-action="attack"] {
  color: #f87171;
}

.entity-action-menu__item[data-action="attack"]:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* Type-specific styling for skill checks */
.entity-action-menu__item[data-action="skill_check"] {
  color: #fcd34d;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.entity-action-menu__item[data-action="skill_check"]:hover {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
}

/* View details action (secondary) */
.entity-action-menu__item[data-action="inspect"] {
  color: #9ca3af;
  font-size: 12px;
}

.entity-action-menu__item[data-action="inspect"]:hover {
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.05);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .entity-action-menu {
    min-width: 200px;
    max-width: calc(100vw - 40px);
  }

  .entity-action-menu__item {
    padding: 12px 14px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .entity-action-menu {
    animation: none;
  }
}
