.person-img {
  fill: #f0f0f0;
  stroke: black;
  stroke-width: 1;
}

.person-info {
  fill: white;
  stroke: black;
  stroke-width: 1;
}

.person-clickable {
  transition: stroke 0.2s ease, stroke-width 0.2s ease, fill 0.2s ease;
}

a.family-tree-link {
  text-decoration: none;
  cursor: pointer;
}

a.family-tree-link:hover .person-img {
  stroke: #ff6600;
  stroke-width: 2;
}

a.family-tree-link:hover .person-info {
  stroke: #ff6600;
  stroke-width: 2;
  fill: #fffacd;
}

a.family-tree-link .person-info {
  fill: #e8e8e8;
}

.person-info-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  word-break: break-word;
  text-align: center;
  box-sizing: border-box;
}

.person-name {
  font-weight: bold;
  margin-bottom: 2px;
  font-size: 12px;
}

.unknown-person {
  fill: none;
  stroke: #cccccc;
  stroke-width: 1;
  stroke-dasharray: 5, 5;
}

/*новое*/


* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	height: 100%;
	width: 100%;
	overflow: hidden;
}

#header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background-color: #fff;
	border-bottom: 2px solid #ccc;
	padding: 20px;
	z-index: 1000;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	gap: 20px;
}

#header h1 {
	font-size: 24px;
	color: #333;
	margin: 0;
}

/* ========== ГАМБУРГЕР КНОПКА (РОВНЫЙ КРЕСТИК) ========== */
.menu-toggle {
	background: none;
	border: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	gap: 6px;
	flex-shrink: 0;
	position: relative;
}

.menu-toggle span {
	display: block;
	width: 28px;
	height: 3px;
	background-color: #333;
	border-radius: 2px;
	transition: all 0.3s ease;
	position: absolute;
}

.menu-toggle span:nth-child(1) {
	top: 8px;
}

.menu-toggle span:nth-child(2) {
	top: 18px;
}

.menu-toggle span:nth-child(3) {
	top: 28px;
}

/* Анимация: превращение в ровный крестик */
.menu-toggle.active span:nth-child(1) {
	transform: rotate(45deg);
	top: 18px;
}

.menu-toggle.active span:nth-child(2) {
	opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
	transform: rotate(-45deg);
	top: 18px;
}

/* ========== БОКОВАЯ ПАНЕЛЬ ========== */
.sidebar {
	position: fixed;
	left: 0;
	top: 0;
	width: 50%;
	max-width: 900px;
	height: 100vh;
	background-color: #f5f5f5;
	border-right: 1px solid #ddd;
	z-index: 999;
	padding-top: 80px;
	padding-left: 20px;
	padding-right: 20px;
	overflow-y: auto;
	
	/* Анимация выезжания */
	transform: translateX(-100%);
	transition: transform 0.3s ease;
}

.sidebar.active {
	transform: translateX(0);
}

#sidebar-content {
	padding: 20px 0;
}

/* ========== ТАБЛИЦА В БОКОВОЙ ПАНЕЛИ ========== */
.sidebar-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	line-height: 1.4;
}

.sidebar-table thead {
	background-color: #e0e0e0;
	position: sticky;
	top: 0;
	z-index: 100;
}

.sidebar-table th {
	padding: 10px 5px;
	text-align: left;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #999;
	white-space: nowrap;
	font-size: 12px;
}

.sidebar-table td {
	padding: 8px 5px;
	border-bottom: 1px solid #ddd;
	color: #333;
	word-break: break-word;
}

.sidebar-table tbody tr:hover {
	background-color: #e8f5e9;
}

.sidebar-table a {
	color: #0066cc;
	text-decoration: none;
}

.sidebar-table a:hover {
	text-decoration: underline;
}

/* ========== ПОЛУПРОЗРАЧНЫЙ ОВЕРЛЕЙ ========== */
.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 998;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.overlay.active {
	opacity: 1;
	pointer-events: auto;
}

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */
#families-container {
	position: absolute;
	top: 80px;
	left: 0;
	right: 0;
	bottom: 0;
	overflow: auto;
	padding: 20px;
	background-color: #f9f9f9;
	transition: margin-left 0.3s ease;
}

#families-container.sidebar-open {
	margin-left: 50%;
	max-width: calc(100% - 50%);
}

#families-container svg {
	display: block;
	background-color: white;
}

/* ========== МОБИЛЬНЫЕ УСТРОЙСТВА ========== */
@media (max-width: 768px) {
	#header {
		padding: 15px;
	}

	#header h1 {
		font-size: 18px;
	}

	.sidebar {
		width: 100%;
		max-width: 100%;
		padding-left: 15px;
		padding-right: 15px;
	}

	#families-container.sidebar-open {
		margin-left: 100%;
		max-width: calc(100% - 100%);
	}

	.sidebar-table {
		font-size: 12px;
	}

	.sidebar-table th,
	.sidebar-table td {
		padding: 6px 3px;
	}
	#families-container {
		top: 333px;
		zoom: 0.3;
		transform-origin: top left;
	}

}
