/* ============ Context Menu — Right-click / Long-press ============ */

/* ── Menu Container ── */
.ctx-menu {
  position: fixed;
  z-index: 500;
  min-width: 210px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(31, 31, 30, 0.2);
  border-radius: 12px;
  box-shadow: rgba(0, 0, 0, 0.08) 0px 2px 8px 0px;
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transform-origin: top left;
  transition: opacity 120ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ctx-menu.ctx-menu--visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* ── Menu Items ── */
.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: rgb(55, 55, 52);
  font-size: 14px;
  font-weight: 430;
  font-family: var(--font-family, inherit);
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background 75ms ease;
  white-space: nowrap;
}

.ctx-menu-item:hover,
.ctx-menu-item:focus-visible {
  background: var(--color-bg);
  outline: none;
}

.ctx-menu-item:active {
  background: var(--color-border, rgba(0, 0, 0, 0.08));
}

/* Danger item (Slet) */
.ctx-menu-item--danger {
  color: #ff3e1d;
}

.ctx-menu-item--danger:hover,
.ctx-menu-item--danger:focus-visible {
  background: rgba(255, 62, 29, 0.08);
  color: #ff3e1d;
}

/* ── Item Icon ── */
.ctx-menu-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ctx-menu-item--danger .ctx-menu-icon {
  color: #ff3e1d;
}

.ctx-menu-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.ctx-menu-item--danger .ctx-menu-icon svg {
  opacity: 1;
}

/* Google Docs icon — filled, not stroked */
.ctx-menu-item[data-action="gdocs"] .ctx-menu-icon svg {
  fill: initial;
  stroke: none;
  opacity: 1;
}

.ctx-menu-item[data-action="gdocs"]:hover {
  background: rgba(66, 133, 244, 0.08);
}

/* ── Divider / Separator ── */
.ctx-menu-sep {
  height: 0.5px;
  margin: 4px 6px;
  background: rgba(0, 0, 0, 0.08);
}

/* ── Keyboard focus ring ── */
.ctx-menu-item:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: -2px;
}

/* ── Long-press visual feedback ── */
.doc-card.ctx-longpress {
  transform: scale(0.97);
  transition: transform 200ms ease;
}

/* ── Mobile adjustments ── */
@media (max-width: 767px) {
  .ctx-menu {
    min-width: 220px;
    padding: 6px;
    border-radius: 14px;
  }

  .ctx-menu-item {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 44px;
  }

  .ctx-menu-sep {
    margin: 4px 10px;
  }
}
