/* Bloc Mi-points — styles (variables CSS uniquement, suit les thèmes) */

#midpoints-body { display: flex; flex-direction: column; height: 100%; }

/* Onglets Natal / RS / Progressions */
.mp-tabs { display: flex; gap: 4px; padding: 4px 4px 0; flex: 0 0 auto; }
.mp-tab {
  flex: 1; padding: 6px 4px; font: inherit; font-size: 0.78rem;
  background: transparent; color: var(--text); opacity: 0.6;
  border: none; border-bottom: 2px solid transparent; cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
}
.mp-tab:hover { background: var(--hover-bg); opacity: 0.85; }
.mp-tab-active { opacity: 1; border-bottom-color: var(--indigo); font-weight: 600; }

/* Barre de contrôles */
.mp-controls {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 8px 10px; flex: 0 0 auto; border-bottom: 1px solid var(--border);
}

/* Segments de boutons (Occupés/Tous, et Trier) */
.mp-toggle, .mp-sort-btns { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mp-toggle button, .mp-sort button {
  font: inherit; font-size: 0.74rem; padding: 4px 10px;
  background: transparent; color: var(--text); opacity: 0.65;
  border: none; border-left: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}
.mp-toggle button:first-child { border-left: none; }
.mp-toggle button:hover, .mp-sort button:hover { background: var(--hover-bg); }
.mp-toggle button.mp-on, .mp-sort button.mp-on { background: var(--indigo); color: #fff; opacity: 1; font-weight: 600; }

/* Bouton ⇄ — inverse les deux personnes (mode Synastrie) */
.mp-swap {
  font: inherit; font-size: 0.74rem; padding: 4px 11px;
  background: transparent; color: var(--text); opacity: 0.8;
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
.mp-swap:hover { background: var(--hover-bg); opacity: 1; border-color: var(--indigo); }

/* En-tête de tableau cliquable (sticky) */
.mp-table thead {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg);
}
[data-theme="lishu"]  .mp-table thead { background: rgba(255,248,234,0.97); }
[data-theme="ocean"]  .mp-table thead { background: rgba(251,246,232,0.97); }
[data-theme="glass"]  .mp-table thead { background: rgba(16,18,40,0.97); }
[data-theme="aurora"] .mp-table thead { background: rgba(250,235,243,0.97); }
[data-theme="forest"] .mp-table thead { background: rgba(240,233,219,0.97); }
.mp-table thead th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
  font-weight: 600; text-align: left; padding: 7px 5px; white-space: nowrap;
  border-bottom: 1.5px solid var(--border);
}
.mp-th { cursor: pointer; user-select: none; opacity: 0.9; }
.mp-th:hover { color: var(--indigo); }
.mp-th-on { color: var(--indigo); }
.mp-th-num { text-align: right; }
.mp-th-plain { opacity: 0.5; }

/* Bouton filtre */
.mp-filter-btn {
  font: inherit; font-size: 0.74rem; padding: 4px 10px; cursor: pointer;
  background: transparent; color: var(--text); opacity: 0.8;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.mp-filter-btn:hover { background: var(--hover-bg); opacity: 1; }
.mp-fbadge { background: var(--indigo); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 0.68rem; font-weight: 600; }

/* Curseur d'orbe */
.mp-orb { display: inline-flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--text); }
.mp-orb label { opacity: 0.7; white-space: nowrap; }
.mp-orb input[type="range"] { width: 100px; accent-color: var(--indigo); cursor: pointer; }
.mp-orb-val { min-width: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Panneau de filtre (dans <body>, position fixe) */
.mp-filter-pop {
  position: fixed; z-index: 9999; min-width: 190px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28); padding: 6px;
}
.mp-fl-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 0.82rem; cursor: pointer; border-radius: 6px; }
.mp-fl-row:hover { background: var(--hover-bg); }
.mp-fl-row input { accent-color: var(--indigo); }
.mp-fl-all { font-weight: 600; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px; }
.mp-fl-name { color: var(--text); opacity: 0.9; }

/* Zone de résultats scrollable */
.mp-results { flex: 1 1 auto; overflow-y: auto; padding: 0 0 12px; }
.mp-empty { padding: 24px 12px; text-align: center; opacity: 0.55; font-size: 0.85rem; line-height: 1.5; }

/* Table : colonnes alignées */
.mp-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.mp-table td { padding: 4px 5px; vertical-align: baseline; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); }
.mp-table th:first-child, .mp-table td:first-child { padding-left: 12px; }
.mp-table th:last-child,  .mp-table td:last-child  { padding-right: 12px; }

/* Colonne corps / occupant en tête de ligne (vues plates) */
.mp-c-corp, .mp-c-occ1 { white-space: nowrap; }

/* En-tête de groupe (corps occupant / section) */
.mp-grp .mp-grp-cell { padding: 9px 4px 4px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text); }
.mp-grp:first-child .mp-grp-cell { padding-top: 4px; }
.mp-grp-name { margin-left: 6px; }
.mp-count { margin-left: 8px; font-weight: 400; font-size: 0.72rem; opacity: 0.5; }

/* Colonnes */
.mp-c-pair    { white-space: nowrap; }
.mp-c-pos     { text-align: center; white-space: nowrap; opacity: 0.78; font-variant-numeric: tabular-nums; }
/* En-tête « Position » centré aussi (mp-th-num NON-dernier = Position ; le dernier = Orbe, reste à droite). */
.mp-table thead th.mp-th-num:not(:last-child) { text-align: center; }
.mp-c-orb     { text-align: right; white-space: nowrap; opacity: 0.7; font-variant-numeric: tabular-nums; width: 1%; }
.mp-c-occ     { text-align: right; }
.mp-c-occhead { white-space: nowrap; width: 1%; }
.mp-eq        { margin-left: 5px; opacity: 0.45; }
.mp-orbinline { margin-left: 3px; font-size: 0.72rem; opacity: 0.55; font-variant-numeric: tabular-nums; }
.mp-none      { opacity: 0.3; }

.mp-pair { display: inline-flex; align-items: baseline; gap: 5px; }

/* Étiquette « Porte visible / Porte invisible » sur la paire Saturne/Uranus
   (axe des portes, Castanier — nom dynamique selon le thème). */
.mp-porte {
  margin-left: 7px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.mp-pair-sep { opacity: 0.4; }

/* Surbrillance (vue « Tous ») : mi-point occupé */
tr.mp-occupied td { background: color-mix(in srgb, var(--gold) 16%, transparent); }
tr.mp-occupied td:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
tr.mp-occupied td:last-child  { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.mp-occ-by { color: var(--gold); font-weight: 600; }

/* Libellé d'angle (AC / MC) */
.mp-angle-lbl { font-weight: 600; font-size: 0.82rem; opacity: 0.85; letter-spacing: 0.02em; }

/* Glyphes des roues en contexte HTML — même gabarit que .wx-gsvg (annexe).
   (Remplace l'ancien rendu texte .mp-glyph, police système : règle Mélanie
   2026-08-18, « glyphes des roues partout ».) */
.mp-gsvg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  display: inline-block;
}
