/* 🔥 HEATMAP PRO — v3.5 (Stylesheet)
 * Premium dark theme with gradients, glows, and subtle animations.
 */

/* Hide legacy heatmap result containers when Pro renderer is active */
.hmp-legacy-hidden { display: none !important; }

/* Root */
.hmp-root {
  width: 100%;
  font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
  direction: rtl;
  color: #e2e8f0;
}
.hmp-root.hmp-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #060912;
  padding: 16px;
  overflow: auto;
}

/* ============== STATS BAR ============== */
.hmp-top { margin-bottom: 12px; }
.hmp-statsbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.hmp-statpill {
  background: linear-gradient(135deg, rgba(30,41,59,0.7), rgba(15,23,42,0.6));
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 12px;
  padding: 10px 14px;
  position: relative;
  overflow: hidden;
}
.hmp-statpill::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(251,191,36,0.05), transparent 60%);
  pointer-events: none;
}
.hmp-statpill-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.hmp-statpill-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-statpill-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ============== MAIN LAYOUT ============== */
.hmp-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .hmp-main { grid-template-columns: 1fr; }
}

/* ============== CHART CARD ============== */
.hmp-chart-wrap {
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(7,11,22,0.95));
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
.hmp-chart-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.05), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.04), transparent 60%);
  pointer-events: none;
}
.hmp-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
  background: rgba(7,11,22,0.5);
  position: relative;
  z-index: 1;
}
.hmp-chart-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}
.hmp-chart-title i { font-size: 18px; }
.hmp-chart-actions {
  display: flex;
  gap: 8px;
}
.hmp-btn {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 8px;
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #cbd5e1;
  transition: all 0.2s;
}
.hmp-btn:hover {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.5);
  color: #fbbf24;
  transform: translateY(-1px);
}
.hmp-canvas-host {
  position: relative;
  padding: 8px;
  z-index: 1;
}
.hmp-canvas {
  display: block;
  width: 100%;
  height: 560px;
  cursor: crosshair;
  border-radius: 8px;
}
.hmp-tooltip {
  position: fixed;
  display: none;
  background: rgba(7,11,22,0.95);
  border: 1px solid rgba(251,191,36,0.4);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #e2e8f0;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(251,191,36,0.15);
  backdrop-filter: blur(8px);
  min-width: 160px;
}
.hmp-loading {
  position: absolute;
  inset: 50% 0 0 0;
  transform: translateY(-50%);
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}
.hmp-error {
  padding: 24px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 12px;
  color: #fca5a5;
  text-align: center;
}

/* ============== SIDE PANELS ============== */
.hmp-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-left: 6px;
}
.hmp-side::-webkit-scrollbar { width: 6px; }
.hmp-side::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 3px; }
.hmp-side::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.4); }

.hmp-panel {
  background: linear-gradient(135deg, rgba(15,23,42,0.9), rgba(7,11,22,0.9));
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 14px;
  overflow: hidden;
  animation: hmp-fadein 0.4s ease;
}
@keyframes hmp-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hmp-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(148,163,184,0.12);
  font-size: 13px;
  font-weight: 800;
  background: rgba(7,11,22,0.5);
}
.hmp-panel-head i { font-size: 14px; }
.hmp-panel-body { padding: 12px 14px; }
.hmp-primary-badge {
  margin-right: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}

/* ============== MARKET INTEL ============== */
.hmp-stat {
  background: rgba(7,11,22,0.6);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 8px;
  padding: 8px 10px;
}
.hmp-stat-label {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.hmp-stat-value {
  font-size: 14px;
  font-weight: 800;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-bar {
  height: 4px;
  background: rgba(148,163,184,0.15);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.hmp-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.hmp-ai-summary {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(59,130,246,0.05));
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 10px;
}
.hmp-ai-icon {
  flex: 0 0 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
}
.hmp-ai-text {
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
}

/* ============== TRADE SETUP CARDS ============== */
.hmp-setup-card {
  background: rgba(7,11,22,0.7);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.hmp-setup-card[data-kind="long"]::before,
.hmp-setup-card[data-kind="short"]::before,
.hmp-setup-card[data-kind="wait"]::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}
.hmp-setup-card[data-kind="long"]::before {
  background: radial-gradient(circle at 20% 0%, rgba(34,197,94,0.08), transparent 50%);
}
.hmp-setup-card[data-kind="short"]::before {
  background: radial-gradient(circle at 20% 0%, rgba(239,68,68,0.08), transparent 50%);
}
.hmp-setup-card[data-kind="wait"]::before {
  background: radial-gradient(circle at 20% 0%, rgba(148,163,184,0.06), transparent 50%);
}
.hmp-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.hmp-setup-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}
.hmp-setup-emoji { font-size: 14px; }
.hmp-grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid;
  border-radius: 8px;
  font-weight: 800;
}
.hmp-grade-letter {
  font-size: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-grade-label { font-size: 10px; opacity: 0.9; }

.hmp-confidence-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.hmp-conf-label { font-size: 11px; color: #94a3b8; }
.hmp-conf-bar {
  height: 6px;
  background: rgba(148,163,184,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.hmp-conf-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.hmp-conf-pct {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.hmp-trigger {
  font-size: 11px;
  padding: 6px 10px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 8px;
  margin-bottom: 10px;
  color: #fde68a;
  position: relative;
  z-index: 1;
}

.hmp-levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.hmp-level {
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}
.hmp-lvl-name { font-size: 9px; color: #94a3b8; margin-bottom: 2px; }
.hmp-lvl-val {
  font-size: 12px;
  font-weight: 800;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.hmp-reasons { position: relative; z-index: 1; }
.hmp-reason {
  font-size: 11px;
  color: #cbd5e1;
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.hmp-reason i { margin-top: 3px; font-size: 9px; }

.hmp-invalidation {
  margin-top: 8px;
  font-size: 10px;
  padding: 6px 8px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  color: #fca5a5;
  position: relative;
  z-index: 1;
}

/* ============== MAGNETS ============== */
.hmp-magnet-section { margin-bottom: 8px; }
.hmp-magnet-section:last-child { margin-bottom: 0; }
.hmp-magnet-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hmp-magnet-row {
  display: grid;
  grid-template-columns: 90px auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 3px;
}
.hmp-magnet-row:hover { background: rgba(148,163,184,0.06); }
.hmp-magnet-price {
  font-weight: 800;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-magnet-dist {
  font-size: 10px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-magnet-score {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hmp-score-bar {
  flex: 1;
  height: 5px;
  background: rgba(148,163,184,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.hmp-score-fill {
  height: 100%;
  border-radius: 2px;
}
.hmp-score-num {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-magnet-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.hmp-tag {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(148,163,184,0.1);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 4px;
  color: #cbd5e1;
}
.hmp-tag-cluster {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.4);
  color: #fbbf24;
  font-weight: 700;
}
.hmp-empty {
  font-size: 11px;
  color: #64748b;
  padding: 8px 0;
  text-align: center;
}

.hmp-row-flash {
  animation: hmp-flash 0.6s ease;
}
@keyframes hmp-flash {
  0%, 100% { background: transparent; }
  50% { background: rgba(251,191,36,0.2); }
}

/* ============== SMC ============== */
.hmp-smc-section { margin-bottom: 10px; }
.hmp-smc-title {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #cbd5e1;
}
.hmp-smc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(15,23,42,0.5);
  border-radius: 6px;
  margin-bottom: 3px;
  font-size: 11px;
}
.hmp-smc-type { font-weight: 700; flex: 0 0 auto; min-width: 80px; }
.hmp-smc-price {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  flex: 1;
}
.hmp-smc-strength {
  font-size: 10px;
  color: #94a3b8;
}
.hmp-smc-tag {
  font-size: 9px;
  padding: 1px 6px;
  background: rgba(100,116,139,0.2);
  border-radius: 4px;
  color: #94a3b8;
}
.hmp-smc-tag.fresh {
  background: rgba(34,197,94,0.15);
  color: #86efac;
}

/* ============== CONFLUENCE ============== */
.hmp-conf-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.hmp-conf-name {
  font-size: 11px;
  color: #cbd5e1;
}
.hmp-conf-meter {
  height: 6px;
  background: rgba(148,163,184,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.hmp-conf-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.hmp-conf-val {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-align: left;
}

/* ============== KEY LEVELS ============== */
.hmp-keylvl-table { display: flex; flex-direction: column; gap: 2px; }
.hmp-keylvl-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.hmp-keylvl-row:hover { background: rgba(148,163,184,0.06); }
.hmp-keylvl-icon { font-size: 10px; }
.hmp-keylvl-name { font-size: 11px; color: #cbd5e1; }
.hmp-keylvl-price {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hmp-keylvl-dist {
  font-size: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ============== RISK CALC ============== */
.hmp-risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.hmp-risk-input label {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 3px;
}
.hmp-risk-input input {
  width: 100%;
  background: rgba(7,11,22,0.7);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 6px;
  padding: 6px 8px;
  color: #e2e8f0;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s;
}
.hmp-risk-input input:focus {
  border-color: rgba(251,191,36,0.5);
}
.hmp-risk-output {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(148,163,184,0.12);
}
.hmp-risk-stat {
  background: rgba(15,23,42,0.6);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.hmp-risk-label {
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 3px;
}
.hmp-risk-value {
  font-size: 13px;
  font-weight: 800;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ============== FOOTER ============== */
.hmp-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  color: #64748b;
  padding: 6px 4px;
}
.hmp-footer .hmp-meta-version {
  margin-right: auto;
  margin-left: 0;
  color: #475569;
}

/* ============== UTILITY CLASSES ============== */
.hmp-root .text-amber-400 { color: #fbbf24; }
.hmp-root .text-red-400 { color: #f87171; }
.hmp-root .text-green-400 { color: #4ade80; }
.hmp-root .text-cyan-400 { color: #22d3ee; }
.hmp-root .text-purple-400 { color: #c084fc; }
.hmp-root .text-rose-400 { color: #fb7185; }
.hmp-root .text-orange-400 { color: #fb923c; }
.hmp-root .text-emerald-400 { color: #34d399; }
.hmp-root .text-slate-500 { color: #64748b; }
.hmp-root .text-green-500 { color: #22c55e; }

/* Container reset */
.hmp-container { width: 100%; }
