/* Interactive Tree Visualizer Styling */

.tree-viewport {
  position: relative;
  width: 100%;
  min-height: 640px;
  background: radial-gradient(circle at center, rgba(16, 24, 43, 0.95) 0%, rgba(10, 15, 29, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  cursor: grab;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tree-viewport:active {
  cursor: grabbing;
}

/* Background Grid Lines */
.tree-grid-bg {
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  pointer-events: none;
}

/* Canvas Transform Wrapper */
.tree-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
  transform-origin: center top;
  transition: transform 0.08s ease-out;
  padding: 60px 40px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  width: max-content;
  min-width: 100%;
}

/* Generation Rows (Horizontal) */
.tree-generation-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 48px;
  width: 100%;
  position: relative;
}

/* Couple Clusters (Husband + Connector + Wife side by side) */
.couple-cluster {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.015);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(212, 175, 55, 0.15);
  position: relative;
}

/* Spouse Connector */
.spouse-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.spouse-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold-primary);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

/* Member Node Card */
.member-card {
  width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-primary);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.2);
}

.member-card.root-node {
  border: 2px solid var(--gold-primary);
  background: linear-gradient(180deg, rgba(28, 42, 70, 0.95) 0%, rgba(18, 28, 48, 0.95) 100%);
  width: 225px;
}

.member-card.male {
  border-top: 3px solid var(--male-color);
}

.member-card.female {
  border-top: 3px solid var(--female-color);
}

.gen-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--gold-primary);
}

.member-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 8px;
  overflow: hidden;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.member-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.member-gam {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  margin-top: 4px;
}

.member-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  width: 100%;
  justify-content: center;
}

.member-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.member-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

/* Floating Zoom & Pan Controls */
.tree-floating-tools {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.tree-tool-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.tree-tool-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-primary);
}
