/* ============================================================
 * message-context-chips.css
 * עיצוב "תגית מידע מצורף" שמחליפה בתצוגת ההיסטוריה את בלוקי-ההקשר המוזרקים
 * (UPLOADED_SITE_FILES / SITE_ELEMENT_CONTEXT), וחלון הפרטים שנפתח בלחיצה.
 * בצבעי המותג, תואם dark mode, בסגנון שאר הדיאלוגים.
 * ============================================================ */

/* ===== שורת התגית בתוך ה-clone ===== */
.msg-ctx-chip-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 8px !important;
}

/* ===== התגית עצמה ===== */
.msg-ctx-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 11px !important;
  border: 1px solid rgba(37, 64, 143, 0.28) !important;
  border-radius: 999px !important;
  background: rgba(37, 64, 143, 0.08) !important;
  color: var(--brand-medium, #25408f) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.msg-ctx-chip:hover {
  background: rgba(125, 210, 239, 0.18) !important;
  border-color: var(--brand-medium, #25408f) !important;
  transform: translateY(-1px) !important;
}

.msg-ctx-chip svg {
  flex: 0 0 14px !important;
  width: 14px !important;
  height: 14px !important;
}

/* ===== Overlay + Panel ===== */
.msg-ctx-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10001 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  direction: rtl !important;
  animation: msg-ctx-fade 0.15s ease !important;
}

@keyframes msg-ctx-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.msg-ctx-modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(22, 33, 63, 0.45) !important;
  backdrop-filter: blur(2px) !important;
}

.msg-ctx-modal-panel {
  position: relative !important;
  width: min(560px, 92vw) !important;
  max-height: 82vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
  border: 2px solid var(--brand-medium, #25408f) !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 48px rgba(37, 64, 143, 0.25) !important;
  overflow: hidden !important;
  animation: msg-ctx-pop 0.18s ease !important;
}

@keyframes msg-ctx-pop {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-ctx-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(37, 64, 143, 0.18) !important;
  flex: 0 0 auto !important;
}

.msg-ctx-modal-title {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: var(--brand-dark, #16213f) !important;
}

.msg-ctx-modal-close {
  appearance: none !important;
  border: none !important;
  background: transparent !important;
  font-size: 1.5rem !important;
  line-height: 1 !important;
  color: var(--brand-dark, #16213f) !important;
  cursor: pointer !important;
  padding: 0 6px !important;
  opacity: 0.6 !important;
  transition: opacity 0.15s ease !important;
}

.msg-ctx-modal-close:hover {
  opacity: 1 !important;
}

.msg-ctx-modal-body {
  padding: 14px 16px !important;
  overflow-y: auto !important;
}

/* ===== מקטעים בתוך החלון ===== */
.msg-ctx-section {
  margin-bottom: 16px !important;
}

.msg-ctx-section:last-child {
  margin-bottom: 0 !important;
}

.msg-ctx-section h4 {
  margin: 0 0 8px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: var(--brand-dark, #16213f) !important;
}

.msg-ctx-note {
  margin: 0 0 10px !important;
  padding: 9px 11px !important;
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
  color: var(--brand-dark, #16213f) !important;
  background: rgba(37, 64, 143, 0.06) !important;
  border-radius: 9px !important;
}

/* רשימת קבצים */
.msg-ctx-file-list,
.msg-ctx-el-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.msg-ctx-file {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px 10px !important;
  padding: 8px 10px !important;
  border: 1px solid rgba(37, 64, 143, 0.16) !important;
  border-radius: 9px !important;
  background: rgba(37, 64, 143, 0.03) !important;
}

.msg-ctx-file-name {
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  color: var(--brand-dark, #16213f) !important;
}

.msg-ctx-file-name bdi {
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

.msg-ctx-file-path {
  flex: 1 1 100% !important;
  font-size: 0.76rem !important;
  text-align: left !important;
  color: var(--brand-medium, #25408f) !important;
  background: rgba(37, 64, 143, 0.07) !important;
  padding: 4px 7px !important;
  border-radius: 6px !important;
  word-break: break-all !important;
}

.msg-ctx-file-size {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: var(--brand-medium, #25408f) !important;
  opacity: 0.8 !important;
  white-space: nowrap !important;
}

/* רשימת אלמנטים */
.msg-ctx-el {
  padding: 8px 10px !important;
  border: 1px solid rgba(37, 64, 143, 0.16) !important;
  border-radius: 9px !important;
  background: rgba(37, 64, 143, 0.03) !important;
  font-size: 0.8rem !important;
  color: var(--brand-dark, #16213f) !important;
}

.msg-ctx-el-role {
  font-weight: 700 !important;
  margin-bottom: 4px !important;
}

.msg-ctx-el-line {
  margin: 2px 0 !important;
  word-break: break-word !important;
}

.msg-ctx-el-line code {
  font-size: 0.74rem !important;
  background: rgba(37, 64, 143, 0.08) !important;
  padding: 1px 5px !important;
  border-radius: 5px !important;
}

.msg-ctx-el-line a {
  color: var(--brand-medium, #25408f) !important;
  text-decoration: underline !important;
}

.msg-ctx-el-text {
  margin-top: 5px !important;
  font-size: 0.78rem !important;
  opacity: 0.85 !important;
  white-space: pre-wrap !important;
}

/* טקסט מלא (raw) */
.msg-ctx-raw {
  margin-top: 8px !important;
}

.msg-ctx-raw summary {
  cursor: pointer !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: var(--brand-medium, #25408f) !important;
  user-select: none !important;
}

.msg-ctx-raw pre {
  margin: 8px 0 0 !important;
  padding: 10px !important;
  max-height: 280px !important;
  overflow: auto !important;
  font-size: 0.74rem !important;
  line-height: 1.45 !important;
  text-align: left !important;
  background: rgba(37, 64, 143, 0.06) !important;
  border-radius: 8px !important;
  color: var(--brand-dark, #16213f) !important;
  white-space: pre !important;
}

/* ===== Dark mode ===== */
html[data-theme="dark"] .msg-ctx-chip {
  border-color: rgba(125, 210, 239, 0.34) !important;
  background: rgba(30, 64, 175, 0.22) !important;
  color: var(--brand-light, #7dd2ef) !important;
}

html[data-theme="dark"] .msg-ctx-chip:hover {
  background: rgba(125, 210, 239, 0.18) !important;
  border-color: var(--brand-light, #7dd2ef) !important;
}

html[data-theme="dark"] .msg-ctx-modal-panel {
  background: #1a1a2e !important;
  border-color: var(--brand-light, #7dd2ef) !important;
  box-shadow: 0 16px 48px rgba(125, 210, 239, 0.22) !important;
}

html[data-theme="dark"] .msg-ctx-modal-header {
  border-bottom-color: rgba(125, 210, 239, 0.22) !important;
}

html[data-theme="dark"] .msg-ctx-modal-title,
html[data-theme="dark"] .msg-ctx-modal-close,
html[data-theme="dark"] .msg-ctx-section h4,
html[data-theme="dark"] .msg-ctx-note,
html[data-theme="dark"] .msg-ctx-file-name,
html[data-theme="dark"] .msg-ctx-el,
html[data-theme="dark"] .msg-ctx-raw pre {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .msg-ctx-note,
html[data-theme="dark"] .msg-ctx-file,
html[data-theme="dark"] .msg-ctx-el,
html[data-theme="dark"] .msg-ctx-raw pre {
  background: rgba(125, 210, 239, 0.08) !important;
}

html[data-theme="dark"] .msg-ctx-file,
html[data-theme="dark"] .msg-ctx-el {
  border-color: rgba(125, 210, 239, 0.2) !important;
}

html[data-theme="dark"] .msg-ctx-file-path,
html[data-theme="dark"] .msg-ctx-file-size,
html[data-theme="dark"] .msg-ctx-raw summary,
html[data-theme="dark"] .msg-ctx-el-line a {
  color: var(--brand-light, #7dd2ef) !important;
}

html[data-theme="dark"] .msg-ctx-file-path,
html[data-theme="dark"] .msg-ctx-el-line code {
  background: rgba(125, 210, 239, 0.12) !important;
}
