/* Eldalil — message → order field mapping */

.message-bubble-container {
  position: relative;
}

.eldalil-msg-map-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 11;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(232, 184, 118, 0.45);
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.98);
  color: #b45309;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  transition: opacity 0.12s, transform 0.12s, background 0.12s;
}

.message-bubble-container:hover .eldalil-msg-map-btn,
.message-bubble-container:focus-within .eldalil-msg-map-btn {
  opacity: 1;
  pointer-events: auto;
}

.eldalil-msg-map-btn:hover {
  background: #fef3c7;
  border-color: #d97706;
}

.message-bubble-container:not(.justify-end) .eldalil-msg-map-btn {
  right: 38px;
}

.message-bubble-container.justify-end .eldalil-msg-map-btn {
  left: 38px;
}

.eldalil-order-field-menu {
  position: fixed;
  z-index: 10050;
  min-width: 210px;
  max-width: 280px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

.eldalil-order-field-menu-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
}

.eldalil-order-field-item,
.eldalil-order-field-trigger {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: right;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.eldalil-order-field-item:hover,
.eldalil-order-field-trigger:hover {
  background: #fff7ed;
  color: #b45309;
}

/* Chatwoot 4.x context menu submenu — custom classes (no Tailwind purge issues) */
.eldalil-order-field-submenu-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

.eldalil-order-field-submenu-row:hover {
  background: rgba(59, 130, 246, 0.08);
}

.eldalil-order-field-submenu-label {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eldalil-order-field-submenu-label p {
  margin: 0;
}

.eldalil-order-field-submenu .eldalil-order-field-sub {
  display: none;
  position: fixed;
  z-index: 10060;
  min-width: 210px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(15rem, calc(100vh - 16px));
  padding: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.eldalil-order-field-submenu-row.is-open .eldalil-order-field-sub {
  display: block;
}

.eldalil-order-field-context-item {
  text-align: right;
}

.eldalil-order-field-chevron {
  font-size: 12px;
  opacity: 0.65;
  margin-inline-start: 6px;
  flex-shrink: 0;
}

body.dark .eldalil-order-field-submenu-label {
  color: #e2e8f0;
}

body.dark .eldalil-order-field-submenu-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.dark .eldalil-msg-map-btn {
  background: rgba(40, 32, 20, 0.96);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

body.dark .eldalil-order-field-menu,
body.dark .eldalil-order-field-submenu .eldalil-order-field-sub {
  background: #1e1f22;
  border-color: #78350f;
}

body.dark .eldalil-order-field-item,
body.dark .eldalil-order-field-trigger {
  color: #e2e8f0;
}

body.dark .eldalil-order-field-item:hover,
body.dark .eldalil-order-field-trigger:hover {
  background: #292524;
  color: #fcd34d;
}
