/* ==========================================================================
   Aile İsim Uyumu & 3B Ruhsal Rezonans Uzayı Stilleri (family-3d.css)
   ========================================================================== */

/* 1. 3B Evren Görselleştirici & Viewport */
.space-canvas-card {
  position: relative;
  background: radial-gradient(circle at 50% 40%, #111827 0%, #080c14 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  margin-bottom: 2rem;
}

.space-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 540px;
  min-height: 420px;
  overflow: hidden;
  cursor: grab;
}

.space-canvas-wrapper:active {
  cursor: grabbing;
}

.space-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 2. Floating Canvas HUD Kontrolleri & Odak Paneli */
.space-hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
}

.space-axis-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  width: fit-content;
}

/* Canlı Odak & Çekim HUD Kartı */
.space-focus-hud {
  background: rgba(8, 14, 26, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  min-width: 230px;
  max-width: 290px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.15);
  pointer-events: auto;
  animation: fadeIn 0.3s ease;
}

.focus-hud-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.2);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  margin-bottom: 4px;
}

.focus-hud-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.focus-hud-main-pole {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.focus-pole-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.focus-pole-details {
  display: flex;
  flex-direction: column;
}

.focus-pole-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  font-weight: 600;
}

.focus-pole-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f59e0b;
}

.focus-pole-metric {
  font-size: 0.74rem;
  color: #cbd5e1;
}

.focus-hud-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.space-hud-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.hud-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hud-btn:hover {
  background: rgba(99, 102, 241, 0.9);
  border-color: #818cf8;
  transform: translateY(-2px);
  color: #ffffff;
}

.hud-btn.active {
  background: #6366f1;
  border-color: #a5b4fc;
}

.space-hud-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #f1f5f9;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.legend-dot-power    { background-color: #ef4444; color: #ef4444; }
.legend-dot-wisdom   { background-color: #3b82f6; color: #3b82f6; }
.legend-dot-politics { background-color: #8b5cf6; color: #8b5cf6; }
.legend-dot-grace    { background-color: #ec4899; color: #ec4899; }
.legend-dot-optimism { background-color: #f59e0b; color: #f59e0b; }
.legend-dot-balance  { background-color: #10b981; color: #10b981; }

.legend-dot-mother   { background-color: #ec4899; color: #ec4899; }
.legend-dot-father   { background-color: #3b82f6; color: #3b82f6; }
.legend-dot-baby     { background-color: #f59e0b; color: #f59e0b; }
.legend-dot-sibling  { background-color: #10b981; color: #10b981; }
.legend-dot-grand    { background-color: #a855f7; color: #a855f7; }

/* 3. Node Tooltip Kartı */
.space-node-tooltip {
  position: absolute;
  display: none;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.2);
  z-index: 20;
  pointer-events: none;
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease;
}

.space-node-tooltip.show {
  display: block;
}

.tooltip-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-role {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

.tooltip-dominant {
  font-weight: 600;
  color: #f59e0b;
  margin-bottom: 3px;
}

.tooltip-coords {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  font-family: monospace;
  color: #38bdf8;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
}

/* 4. Form Alanı Stilleri */
.family-form-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
}

.family-form-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  padding-bottom: 1rem;
}

.family-form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading, #0f172a);
  margin-bottom: 0.25rem;
}

.family-form-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}

.form-member-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.form-member-card:focus-within {
  border-color: #6366f1;
  background: #faf5ff;
}

.form-member-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-member-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.badge-mother { background: #fce7f3; color: #db2777; }
.badge-father { background: #dbeafe; color: #2563eb; }
.badge-baby   { background: #fef3c7; color: #d97706; }
.badge-sibling{ background: #d1fae5; color: #059669; }
.badge-grand  { background: #f3e8ff; color: #7e22ce; }

/* 5. Sonuçlar & Rezonans Paneli */
.results-dashboard {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.results-dashboard.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.harmony-hero-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(67, 56, 202, 0.35);
  position: relative;
  overflow: hidden;
}

.harmony-score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
}

.harmony-score-num {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
}

.harmony-score-unit {
  font-size: 1.25rem;
  font-weight: 600;
  opacity: 0.85;
}

.harmony-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.harmony-hero-desc {
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
  line-height: 1.5;
}

/* 6. Boyutsal Nitelik Kartları (Power, Wisdom, Optimism, Balance) */
.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.trait-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.trait-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.trait-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trait-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: #4338ca;
}

.trait-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.trait-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
}

.fill-power    { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.fill-wisdom   { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.fill-optimism { background: linear-gradient(90deg, #10b981, #06b6d4); }
.fill-balance  { background: linear-gradient(90deg, #8b5cf6, #ec4899); }

.trait-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

/* 7. Aile Üyeleri Arası Mesafe ve Çekim Kartları */
.distances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.distance-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.distance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.distance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.distance-pair-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.distance-harmony-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #059669;
}

.distance-metrics {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: #64748b;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.distance-note {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
}

/* 8. Soyağacı & Kuşaklar Arası Miras Paneli (Geniş Aile İçin) */
.heritage-card {
  background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%);
  border: 1px solid #c4b5fd;
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.heritage-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #5b21b6;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.heritage-desc {
  font-size: 0.92rem;
  color: #4c1d95;
  line-height: 1.5;
}

/* 9. Dinamik Birey & Çocuk Ekleme Butonları */
.dynamic-members-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.dynamic-member-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  animation: fadeIn 0.25s ease;
}

.dynamic-member-row .form-input {
  flex: 1;
}

.btn-remove-member {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-member:hover {
  background: #ef4444;
  color: #ffffff;
}

.add-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn-add-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.95rem;
  border-radius: 30px;
  border: 1px dashed #6366f1;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-pill:hover {
  background: #6366f1;
  color: #ffffff;
  border-style: solid;
  transform: translateY(-1px);
}

/* 10. Ruhsal & Psikolojik Unsurlara Uzaklık Matrisi */
.pole-matrix-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.pole-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pole-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  border-left: 4px solid var(--pole-color, #6366f1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pole-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.pole-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pole-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pole-affinity-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0e7ff;
  color: #3730a3;
}

.pole-card-distance {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 4px;
}

.pole-card-desc {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.35;
}

/* 11. Matematiksel & Yapay Zeka Metodoloji Stilleri */
.math-code-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  margin: 8px 0;
  overflow-x: auto;
  border-left: 3px solid #6366f1;
}

.text-primary {
  color: #4338ca;
}

/* 11. Responsive Düzenlemeler */
@media (max-width: 768px) {
  .space-canvas-wrapper {
    height: 380px;
  }
  
  .space-axis-badge {
    display: none;
  }

  .space-hud-legend {
    display: none;
  }
  
  .space-focus-hud {
    min-width: unset;
    max-width: 210px;
    padding: 6px 10px;
    background: rgba(8, 14, 26, 0.8);
    border-radius: 8px;
  }

  .focus-hud-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    margin-bottom: 2px;
  }

  .focus-hud-name {
    font-size: 0.95rem;
    margin-bottom: 3px;
  }

  .focus-hud-main-pole {
    padding: 4px 6px;
    gap: 6px;
    margin-bottom: 3px;
  }

  .focus-pole-icon {
    font-size: 1.1rem;
  }

  .focus-pole-label {
    font-size: 0.6rem;
  }

  .focus-pole-title {
    font-size: 0.8rem;
  }

  .focus-pole-metric {
    font-size: 0.68rem;
  }

  .focus-hud-sub {
    font-size: 0.68rem;
    padding-top: 2px;
  }
  
  .harmony-hero-card {
    padding: 1.5rem 1rem;
  }
  
  .harmony-score-circle {
    width: 90px;
    height: 90px;
  }
  
  .harmony-score-num {
    font-size: 2.2rem;
  }
}

