/* Genealogy visualization specific styles */
.genealogy-visualization {
  touch-action: pan-x pan-y;  /* Allow panning but prevent pinch zoom */
  min-height: 600px;
  width: 100%;
  position: relative;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 0;  /* Square corners */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);  /* Drop shadow like timeline */
  background: white;
}

.genealogy-visualization svg {
  width: 100%;
  height: 100%;
  touch-action: pan-x pan-y;  /* Allow panning but prevent pinch zoom */
  cursor: grab;
  border-radius: 0;  /* Square corners for SVG */
}

.genealogy-visualization svg:active {
  cursor: grabbing;
}

/* Grid styling */
.genealogy-visualization .grid line {
  stroke: #f0f0f0;
  stroke-width: 1px;
  shape-rendering: crispEdges;
  pointer-events: none;
}

/* Ensure grid stays behind other elements */
.genealogy-visualization .grid {
  pointer-events: none;
}

/* Style for grid labels */
.genealogy-visualization .grid-label {
  font-size: 10px;
  fill: #999;
  text-anchor: start;
  pointer-events: none;
}

/* Container that should not interfere with page scrolling */
.genealogy-container {
  position: relative;
  isolation: isolate;  /* Create new stacking context */
  border-radius: 0;  /* Square corners */
}

/* Remove unwanted red line at the top of the genealogy page */
.genealogy-page hr,
.genealogy-page > div > hr,
.genealogy-visualization hr,
.genealogy-container hr {
  display: none !important;
}

/* Tooltip styling */
.genealogy-tooltip {
  position: absolute;
  visibility: hidden;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
}

/* Since we removed the outer container, these styles are no longer needed */

/* Controls styling to match timeline */
.genealogy-controls {
  display: flex;
  flex-direction: column;
  width: 40px;
  gap: 12px;
  position: relative;
}

.genealogy-control-button {
  position: relative;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.375rem;  /* Rounded corners for buttons */
  padding: 8px;
  font-weight: bold;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

.genealogy-control-button:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.genealogy-control-button:active {
  transform: translateY(0);
}

.genealogy-control-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Person boxes styling */
.person-box {
  border-radius: 0;  /* Square corners for person boxes */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Connection line styling */
.connection.marriage {
  stroke: #e74c3c !important;
  stroke-width: 3px !important;
  opacity: 0.8 !important;
}

.connection.parent-child {
  stroke: #666 !important;
  stroke-width: 1.5px !important;
  opacity: 0.7 !important;
}

.connection.parent-child-main {
  stroke: #666 !important;
  stroke-width: 2px !important;
  opacity: 0.8 !important;
}

.connection.child-distribution {
  stroke: #666 !important;
  stroke-width: 2px !important;
  opacity: 0.8 !important;
}

.connection.child-branch {
  stroke: #666 !important;
  stroke-width: 1px !important;
  opacity: 0.7 !important;
}

.connection.marriage:hover {
  stroke: #c0392b !important;
  stroke-width: 4px !important;
  opacity: 1 !important;
}

.connection.parent-child:hover,
.connection.parent-child-main:hover,
.connection.child-distribution:hover {
  stroke: #333 !important;
  stroke-width: 2.5px !important;
  opacity: 0.9 !important;
}

.connection.child-branch:hover {
  stroke: #333 !important;
  stroke-width: 1.5px !important;
  opacity: 0.9 !important;
}

/* Timeline-like header styling */
.genealogy-header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem;
}

/* Square off any remaining rounded elements */
.genealogy-section {
  border-radius: 0;
}

.genealogy-section select,
.genealogy-section input {
  border-radius: 0;
}
