/* ==========================================================
   public/css/tree.css
   Vue "Family Card" centrée sur une personne
   ========================================================== */

.family-card {
  background: var(--c-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-xl);
  padding: var(--s-6) var(--s-4);
  box-shadow: var(--sh-md);
  position: relative;
}
@media (max-width: 600px) {
  .family-card { padding: var(--s-4) var(--s-2); }
}

/* Indicateur de génération (flèches haut/bas) */
.gen-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-size: 0.78rem;
  color: var(--c-text-muted);
  font-weight: 600;
  margin-bottom: var(--s-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gen-indicator::before, .gen-indicator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-border), transparent);
  max-width: 80px;
}

/* ==========================================================
   Layout en colonnes empilées :
   ┌──────────────┐
   │   Parents    │  ← rangée des parents (compacts)
   ├──────────────┤
   │  Frères/sœurs│  ← rangée latérale (collapse-toggle)
   ├──────────────┤
   │  ► PERSONNE◄ │  ← carte centrale + conjoints à côté
   ├──────────────┤
   │   Enfants    │  ← rangée enfants par couple
   └──────────────┘
   ========================================================== */

.fc-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--s-3);
}
.fc-section + .fc-section {
  padding-top: var(--s-4);
}
.fc-section + .fc-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: var(--s-4);
  background: linear-gradient(to bottom, transparent, var(--teal-300));
}

/* Rangée horizontale de personnes */
.fc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  position: relative;
  width: 100%;
}
@media (max-width: 600px) {
  .fc-row { gap: var(--s-2); }
}

/* ===== Tuile personne ===== */
.person-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.4rem;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
  width: 110px;
  position: relative;
  background: transparent;
  text-decoration: none;
  color: var(--c-text);
}
.person-tile:hover {
  background: var(--teal-50);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--c-text);
}
.person-tile:hover .avatar { transform: scale(1.05); }
.person-tile .avatar { transition: transform var(--t-fast); width: 64px; height: 64px; font-size: 1rem; }
.person-tile .name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  max-width: 110px;
}
.person-tile .dates {
  font-size: 0.7rem;
  color: var(--c-text-muted);
  line-height: 1.1;
}
.person-tile.deceased .name { color: var(--c-text-muted); }
.person-tile .gender-mark {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-male);
  color: white;
}
.person-tile.female .gender-mark { background: var(--c-female); }

/* Tuile compacte (parents, fratrie) */
.person-tile-compact {
  width: 92px;
  padding: 0.4rem 0.3rem;
}
.person-tile-compact .avatar { width: 52px; height: 52px; font-size: 0.85rem; }
.person-tile-compact .name { font-size: 0.75rem; }
.person-tile-compact .dates { font-size: 0.65rem; }

/* ===== Tuile FOCUS (la personne centrale) ===== */
.focus-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3);
}
.focus-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: var(--s-3);
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
  color: white;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  position: relative;
  min-width: 180px;
  max-width: 240px;
  text-align: center;
  transform: scale(1);
  transition: transform var(--t-spring);
  animation: focusEntry var(--t-spring) ease;
}
@keyframes focusEntry {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.focus-tile.female {
  background: linear-gradient(135deg, var(--rose-600), var(--rose-400));
}
.focus-tile .avatar {
  width: 88px; height: 88px;
  border: 3px solid rgba(255, 255, 255, 0.6);
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.18);
}
.focus-tile .name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}
.focus-tile .dates {
  font-size: 0.85rem;
  opacity: 0.92;
}
.focus-tile .focus-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  opacity: 0.9;
  margin-top: 0.4rem;
}
.focus-tile .focus-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.focus-tile .focus-actions button,
.focus-tile .focus-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background var(--t-fast);
}
.focus-tile .focus-actions button:hover,
.focus-tile .focus-actions a:hover {
  background: rgba(255, 255, 255, 0.32);
  color: white;
}
.focus-tile .focus-actions .material-symbols-rounded {
  font-size: 0.95rem;
}

/* Cœur entre conjoints */
.heart-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--rose-100);
  color: var(--rose-500);
  border-radius: var(--r-pill);
  flex-shrink: 0;
  position: relative;
  font-size: 1.2rem;
}
.heart-link::after {
  content: attr(data-date);
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  white-space: nowrap;
  color: var(--c-text-muted);
  font-weight: 500;
}
.heart-link.has-date { margin-bottom: 1rem; }

/* Conjoint·e à côté du focus */
.spouse-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: var(--s-3);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  min-width: 140px;
  max-width: 180px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  text-decoration: none;
  color: var(--c-text);
}
.spouse-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
  text-decoration: none;
  color: var(--c-text);
}
.spouse-tile .avatar { width: 64px; height: 64px; font-size: 1rem; }
.spouse-tile .name { font-size: 0.88rem; font-weight: 600; line-height: 1.2; }
.spouse-tile .dates { font-size: 0.72rem; color: var(--c-text-muted); }

/* Slot vide cliquable (ajouter parent/conjoint/enfant) */
.add-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.6rem;
  width: 92px; height: 92px;
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: transparent;
}
.add-slot:hover {
  border-color: var(--teal-500);
  color: var(--teal-700);
  background: var(--teal-50);
}
.add-slot .material-symbols-rounded {
  font-size: 1.4rem;
}
.add-slot.large { width: 120px; height: 120px; }

/* Section enfants groupés par couple */
.children-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  margin: var(--s-2);
}
.children-group-label {
  font-size: 0.72rem;
  color: var(--c-text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.children-group-label .avatar { width: 18px; height: 18px; font-size: 0.55rem; }

/* Section title (Parents, Frères/sœurs, Enfants...) */
.fc-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-2);
  padding: 0.25rem 0.7rem;
  background: var(--c-bg);
  border-radius: var(--r-pill);
}
.fc-section-title .count {
  background: var(--teal-700);
  color: white;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 0.65rem;
}

/* Bouton "voir plus" dans la fratrie quand il y en a plein */
.show-more {
  font-size: 0.78rem;
  color: var(--teal-700);
  padding: 0.5rem 1rem;
  border-radius: var(--r-md);
  font-weight: 600;
  border: 1px dashed var(--teal-500);
}
.show-more:hover { background: var(--teal-50); }

/* Breadcrumb de navigation (chemin parcouru) */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: var(--s-2) var(--s-3);
  background: var(--c-overlay);
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
  overflow-x: auto;
  white-space: nowrap;
  font-size: 0.85rem;
  scrollbar-width: thin;
}
.breadcrumb-bar::-webkit-scrollbar { height: 4px; }
.breadcrumb-bar::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
.breadcrumb-bar a, .breadcrumb-bar button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
  color: var(--c-text-muted);
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
}
.breadcrumb-bar a:hover, .breadcrumb-bar button:hover {
  background: var(--c-bg);
  color: var(--teal-700);
}
.breadcrumb-bar .crumb-current {
  background: var(--teal-100);
  color: var(--teal-800);
  font-weight: 600;
}
.breadcrumb-bar .sep {
  color: var(--c-border);
  flex-shrink: 0;
}

/* ===== Switch entre vues (carte / liste / lignée) ===== */
.view-switch {
  display: inline-flex;
  background: var(--c-bg);
  padding: 3px;
  border-radius: var(--r-pill);
  gap: 2px;
}
.view-switch button {
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--t-fast);
}
.view-switch button:hover { color: var(--c-text); }
.view-switch button.active {
  background: var(--teal-700);
  color: white;
}
.view-switch .material-symbols-rounded { font-size: 1rem; }

/* Mini-carte mobile : disposition verticale plus compacte */
@media (max-width: 600px) {
  .focus-block { gap: var(--s-2); }
  .focus-tile { min-width: 160px; padding: var(--s-3) var(--s-2); }
  .focus-tile .avatar { width: 72px; height: 72px; }
  .focus-tile .name { font-size: 0.92rem; }
  .heart-link { width: 28px; height: 28px; font-size: 1rem; }
  .spouse-tile { min-width: 110px; padding: var(--s-2); }
  .spouse-tile .avatar { width: 52px; height: 52px; }
  .person-tile { width: 88px; }
  .person-tile .avatar { width: 52px; height: 52px; }
  .add-slot { width: 80px; height: 80px; font-size: 0.65rem; }
}
