/**
 * Silsilah Chart Styles
 * Stylesheet untuk visualisasi pohon silsilah
 */

body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  margin: 0;
  padding: 20px;
}

/* Container untuk chart dengan overflow untuk scroll */
.chart-container {
  width: 100%;
  min-height: 700px;
  max-height: 90vh;
  height: auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: visible;
  position: relative;
}

/* Wrapper untuk SVG agar bisa scroll jika perlu */
.chart-container > div {
  overflow: auto;
}

/* Pastikan SVG tidak terpotong */
.chart-container svg {
  width: 100%;
  height: auto;
  min-height: 700px;
  display: block;
}

/* Tombol kontrol zoom */
.zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.zoom-btn {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s;
}

.zoom-btn:hover {
  background-color: #f0f0f0;
}

/* --- Kustomisasi Tampilan Node (mirip mockup Anda) --- */

/* Box utama node */
.node-box {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #eee;
  overflow: visible;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Judul (Relasi) */
.node-title {
  background-color: #008000; /* Hijau */
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  flex-shrink: 0; /* Tidak menyusut */
  line-height: 1.2;
  border-radius: 8px 8px 0 0;
}

/* Konten (Nama) */
.node-content {
  padding: 6px 8px;
  font-size: 12px;
  color: #333;
  text-align: center;
  flex: 1; /* Mengambil sisa ruang */
  display: flex;
  align-items: center;
  justify-content: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  min-height: 25px; /* Minimum height untuk teks */
}

/* Styling untuk gambar (jika ada) */
.node-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 8px auto 5px auto; /* Posisikan di tengah */
  display: block;
  object-fit: cover;
  border: 2px solid #f0f0f0;
  flex-shrink: 0; /* Tidak menyusut */
}

/* Styling untuk expand/collapse button dari library */
.node-button-g {
  cursor: pointer;
  pointer-events: all;
}

.node-button-g foreignObject {
  overflow: visible;
}

.node-button-g:hover {
  opacity: 0.9;
}

/* Garis konektor */
.chart-container .link {
  stroke: #bbb;
  stroke-width: 2px;
}

/* Styling untuk tombol tipe silsilah */
.type-selector {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.type-btn {
  background-color: #ffffff;
  border: 2px solid #008000;
  color: #008000;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.type-btn:hover {
  background-color: #f0f9f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.type-btn.active {
  background-color: #008000;
  color: white;
}

.type-btn:active {
  transform: translateY(0);
}

.text-center {
  text-align: center;
}
