/* =====================
   زر جانبي
===================== */
#sitemapBtn {
  display: none; /* اجعله مخفيًا بشكل افتراضي */
  position: fixed;
  top: 40%;
  right: 0;
  background-color: #2563eb;
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px 0 0 12px;
  font-size: 14px;
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transition: background-color 0.3s ease;
  z-index: 1000;
}

#sitemapBtn:hover {
  background-color: #1d4ed8;
}

/* =====================
   اللوحة الجانبية
===================== */
#sitemapPanel {
  position: fixed;
  top: 0;
  right: -350px; /* خارج الشاشة */
  width: 350px;
  height: 100%;
  background-color: #f9fafb;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
  padding: 20px;
  transition: right 0.3s ease-in-out;
  z-index: 999;
  overflow-y: auto;
}

#sitemapPanel.open {
  right: 0;
}

/* =====================
   العقد
===================== */
.node {
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 6px 12px;
  border-radius: 12px;
  margin: 8px 0;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  display: inline-block;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease; /* إضافة تأثير بسيط عند التفاعل */
}

.node:hover {
  transform: translateY(-2px); /* تأثير رفع عند المرور */
}

.main {
  font-weight: bold;
  background-color: #e0e7ff;
  border-color: #c7d2fe;
}

.children {
  margin-left: 50px;
}

/* =====================
   SVG للخطوط بين العقد
===================== */
#connectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

path.curve {
  stroke: #3b82f6;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -12; }
}

/* =====================
   تحسين عام: متغيرات CSS
===================== */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --panel-bg: #f9fafb;
  --node-bg: #fff;
  --node-shadow: rgba(0, 0, 0, 0.05);
  --main-node-bg: #e0e7ff;
  --main-node-border: #c7d2fe;
}