/* ============================================================
   BLUNK — Professional Custom Context Menu System
   Anthracite Glassmorphism & Adaptive Context Awareness
   ============================================================ */

.blunk-ctx-menu {
  position: fixed;
  z-index: 2147483647;
  min-width: 214px;
  max-width: 290px;
  background: rgba(13, 17, 23, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 6px;
  color: rgba(255, 255, 255, 0.9);
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.12s cubic-bezier(0.16, 1, 0.3, 1), transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.blunk-ctx-menu.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.blunk-ctx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.42);
}

.blunk-ctx-header-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blunk-ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  box-sizing: border-box;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.blunk-ctx-item:hover,
.blunk-ctx-item:focus-visible,
.blunk-ctx-item.is-focused {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.blunk-ctx-item:hover .blunk-ctx-icon,
.blunk-ctx-item:focus-visible .blunk-ctx-icon,
.blunk-ctx-item.is-focused .blunk-ctx-icon {
  opacity: 1;
  color: var(--accent, #5865f2);
}

.blunk-ctx-item-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.blunk-ctx-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.72;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.blunk-ctx-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  display: block;
}

.blunk-ctx-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blunk-ctx-shortcut {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  margin-left: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.blunk-ctx-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 6px;
}

/* Danger items */
.blunk-ctx-item.danger {
  color: rgba(248, 113, 113, 0.9);
}

.blunk-ctx-item.danger .blunk-ctx-icon {
  color: rgba(248, 113, 113, 0.9);
}

.blunk-ctx-item.danger:hover,
.blunk-ctx-item.danger:focus-visible,
.blunk-ctx-item.danger.is-focused {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.blunk-ctx-item.danger:hover .blunk-ctx-icon,
.blunk-ctx-item.danger:focus-visible .blunk-ctx-icon,
.blunk-ctx-item.danger.is-focused .blunk-ctx-icon {
  color: #ef4444;
}

/* Light Mode Adaptations */
[data-theme="light"] .blunk-ctx-menu {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #1a1a1e;
}

[data-theme="light"] .blunk-ctx-header {
  color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .blunk-ctx-item {
  color: rgba(0, 0, 0, 0.82);
}

[data-theme="light"] .blunk-ctx-item:hover,
[data-theme="light"] .blunk-ctx-item:focus-visible,
[data-theme="light"] .blunk-ctx-item.is-focused {
  background: rgba(0, 0, 0, 0.05);
  color: #000000;
}

[data-theme="light"] .blunk-ctx-shortcut {
  color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .blunk-ctx-divider {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .blunk-ctx-item.danger {
  color: #dc2626;
}

[data-theme="light"] .blunk-ctx-item.danger:hover,
[data-theme="light"] .blunk-ctx-item.danger:focus-visible,
[data-theme="light"] .blunk-ctx-item.danger.is-focused {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}
