/* ═══════════════════════════════════════════════
   Mix Shortcodes – Forex Heatmap
   v2.0.0 | البانلات تحت بعض + بنر السوق واقف
═══════════════════════════════════════════════ */

.mix-fxhm {
  --mix-bg:       #ffffff;
  --mix-card:     #ffffff;
  --mix-border:   #e5e7eb;
  --mix-text:     #0f172a;
  --mix-muted:    #64748b;
  --mix-soft:     #f8fafc;
  --mix-green:    #10b981;
  --mix-red:      #ef4444;
  --mix-shadow:   0 10px 30px rgba(15,23,42,.06);

  direction: ltr;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--mix-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--mix-shadow);
  overflow: hidden;
}

.mix-fxhm * {
  box-sizing: border-box;
}

/* ── الهيدر ── */
.mix-fxhm__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  direction: rtl;
}

.mix-fxhm__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mix-fxhm__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--mix-text);
  font-weight: 800;
}

.mix-fxhm__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  border: 1px solid #bae6fd;
  font-size: 12px;
  font-weight: 700;
}

.mix-fxhm__status {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mix-muted);
  font-size: 13px;
}

.mix-fxhm__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 4px rgba(203,213,225,.25);
  flex: 0 0 10px;
  transition: background .3s, box-shadow .3s;
}

.mix-fxhm__status-dot.is-live {
  background: var(--mix-green);
  box-shadow: 0 0 0 4px rgba(16,185,129,.18);
}

.mix-fxhm__status-dot.is-waiting {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245,158,11,.18);
}

.mix-fxhm__status-dot.is-offline {
  background: var(--mix-red);
  box-shadow: 0 0 0 4px rgba(239,68,68,.18);
}

/* ── كروت الملخص ── */
.mix-fxhm__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  min-width: min(100%, 400px);
  flex: 1;
}

.mix-fxhm__summary-card {
  background: var(--mix-soft);
  border: 1px solid var(--mix-border);
  border-radius: 16px;
  padding: 12px 14px;
}

.mix-fxhm__summary-label {
  display: block;
  color: var(--mix-muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.mix-fxhm__summary-value {
  color: var(--mix-text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  word-break: break-word;
}

/* ══════════════════════════════════════════
   بنر السوق واقف
══════════════════════════════════════════ */
.mix-fxhm__market-closed {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  animation: mixFxhmFadeIn .35s ease;
  direction: rtl;
}

.mix-fxhm__market-closed[hidden] {
  display: none !important;
}

.mix-fxhm__mc-icon {
  font-size: 22px;
  flex: 0 0 auto;
  line-height: 1;
  margin-top: 2px;
}

.mix-fxhm__mc-body {
  flex: 1;
}

.mix-fxhm__mc-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 4px;
}

.mix-fxhm__mc-sub {
  margin: 0;
  font-size: 13px;
  color: #b45309;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   البانلات – تحت بعض (stacked)
══════════════════════════════════════════ */
.mix-fxhm__panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mix-fxhm__panel {
  background: var(--mix-card);
  border: 1px solid var(--mix-border);
  border-radius: 18px;
  overflow: hidden;
}

.mix-fxhm__panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--mix-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  direction: rtl;
}

.mix-fxhm__panel-head h4 {
  margin: 0;
  font-size: 15px;
  color: var(--mix-text);
  font-weight: 800;
}

/* ── قوة العملات – شبكة أفقية ── */
.mix-fxhm__strength-list {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.mix-fxhm__strength-item {
  border: 1px solid var(--mix-border);
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  transition: box-shadow .2s;
}

.mix-fxhm__strength-item:hover {
  box-shadow: 0 4px 14px rgba(15,23,42,.07);
}

.mix-fxhm__strength-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mix-fxhm__strength-code {
  font-size: 14px;
  font-weight: 800;
  color: var(--mix-text);
}

.mix-fxhm__strength-value {
  font-size: 13px;
  font-weight: 800;
}

.mix-fxhm__strength-item.is-positive .mix-fxhm__strength-value { color: #047857; }
.mix-fxhm__strength-item.is-negative .mix-fxhm__strength-value { color: #b91c1c; }
.mix-fxhm__strength-item.is-neutral  .mix-fxhm__strength-value { color: #475569; }

.mix-fxhm__strength-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.mix-fxhm__strength-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
  transition: width .4s ease;
}

.mix-fxhm__strength-item.is-positive .mix-fxhm__strength-bar span {
  background: linear-gradient(90deg, #6ee7b7 0%, #10b981 100%);
}

.mix-fxhm__strength-item.is-negative .mix-fxhm__strength-bar span {
  background: linear-gradient(90deg, #fca5a5 0%, #ef4444 100%);
}

/* ── المصفوفة ── */
.mix-fxhm__matrix-wrap {
  padding: 14px;
  overflow: auto;
}

.mix-fxhm__matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 6px;
}

.mix-fxhm__matrix th,
.mix-fxhm__matrix td {
  text-align: center;
  vertical-align: middle;
  border-radius: 12px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mix-fxhm__matrix thead th {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--mix-border);
}

.mix-fxhm__matrix tbody th {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--mix-border);
}

.mix-fxhm__matrix td {
  color: #0f172a;
  border: 1px solid rgba(255,255,255,.45);
  transition: .2s ease;
}

.mix-fxhm__matrix td.is-positive { color: #064e3b; }
.mix-fxhm__matrix td.is-negative { color: #7f1d1d; }
.mix-fxhm__matrix td.is-neutral  { color: #334155; }

.mix-fxhm__matrix td.is-diagonal {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
}

.mix-fxhm__matrix td:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
}

/* ── Legend ── */
.mix-fxhm__legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px;
}

.mix-fxhm__legend-label {
  font-size: 12px;
  color: var(--mix-muted);
  font-weight: 700;
}

.mix-fxhm__legend-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(239,68,68,.95)   0%,
    rgba(248,113,113,.7) 20%,
    rgba(226,232,240,.6) 50%,
    rgba(110,231,183,.7) 80%,
    rgba(16,185,129,.95) 100%
  );
  border: 1px solid var(--mix-border);
}

/* ── Empty ── */
.mix-fxhm__empty {
  color: var(--mix-muted);
  font-size: 13px;
  padding: 16px;
  text-align: center;
}

/* ── Animation ── */
@keyframes mixFxhmFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   Responsive
══════════════════════════════════════════ */
@media (max-width: 640px) {
  .mix-fxhm {
    padding: 14px;
    border-radius: 16px;
  }

  .mix-fxhm__title {
    font-size: 18px;
  }

  .mix-fxhm__summary {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .mix-fxhm__strength-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .mix-fxhm__matrix th,
  .mix-fxhm__matrix td {
    font-size: 12px;
    padding: 10px 8px;
    border-radius: 10px;
  }

  .mix-fxhm__matrix {
    min-width: 680px;
    border-spacing: 5px;
  }
}

@media (max-width: 400px) {
  .mix-fxhm__strength-list {
    grid-template-columns: 1fr;
  }
}