/* ==========================================================================
   pedagogue.css — Styles du bandeau pédagogique Tosio-Chat
   Isolé du design system existant, variables CSS héritées du site vitrine
   ========================================================================== */

/* ── Tooltip (N0) ── */
.pedagogue-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 280px;
  padding: 8px 12px;
  background: #1f2328;
  color: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  line-height: 1.4;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pedagogue-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.pedagogue-tooltip .difficulty {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
}

/* ── Popup latéral (N1) ── */
.pedagogue-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-height: 70vh;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pedagogue-slide-up 0.2s ease;
}

@keyframes pedagogue-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pedagogue-popup.closing {
  animation: pedagogue-slide-down 0.15s ease forwards;
}

@keyframes pedagogue-slide-down {
  to {
    opacity: 0;
    transform: translateY(12px);
  }
}

.pedagogue-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #d0d7de;
  background: #f6f8fa;
}

.pedagogue-popup-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0d1117;
  margin: 0;
}

.pedagogue-popup-header .difficulty-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ddf4ff;
  color: #0969da;
}

.pedagogue-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #656d76;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
}

.pedagogue-popup-close:hover {
  background: #eaeef2;
  color: #1f2328;
}

.pedagogue-popup-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.pedagogue-popup-body p {
  color: #24292f;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ── Schéma de connexions SVG ── */
.pedagogue-graph {
  margin: 12px 0;
  padding: 12px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  text-align: center;
}

.pedagogue-graph svg {
  max-width: 100%;
  height: auto;
}

/* ── Matrice des paramètres ── */
.pedagogue-params {
  margin-top: 12px;
}

.pedagogue-params h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #656d76;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.pedagogue-params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.pedagogue-params-table th,
.pedagogue-params-table td {
  padding: 6px 8px;
  border: 1px solid #d0d7de;
  text-align: left;
}

.pedagogue-params-table th {
  background: #f6f8fa;
  font-weight: 600;
  color: #656d76;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.pedagogue-params-table td {
  color: #24292f;
}

.pedagogue-params-table .param-ok {
  color: #059669;
}

.pedagogue-params-table .param-warn {
  color: #d97706;
}

.pedagogue-params-table .param-action {
  color: #dc2626;
  font-size: 0.7rem;
  font-style: italic;
}

/* ── Pied du popup ── */
.pedagogue-popup-footer {
  padding: 10px 16px;
  border-top: 1px solid #d0d7de;
  background: #f6f8fa;
  text-align: right;
}

.pedagogue-popup-footer a {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0969da;
  text-decoration: none;
}

.pedagogue-popup-footer a:hover {
  color: #0550ae;
  text-decoration: underline;
}

/* ── Bandeau de navigation visible (sticky) ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem !important;
  margin-left: -24px;
  margin-right: -24px;
  padding-left: 24px !important;
  padding-right: 24px !important;
  padding-top: 10px !important;
}

/* ── Mots-clés balisés (data-concept) ── */
[data-concept] {
  cursor: help;
  color: #0969da;
  border-bottom: 2px solid #0969da;
  border-bottom-style: double;
  padding-bottom: 1px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Puce bleue avant le mot */
[data-concept]::before {
  content: '•';
  color: #2563eb;
  font-size: 0.7em;
  margin-right: 2px;
  vertical-align: super;
}

/* Flèche d'information après le mot */
[data-concept]::after {
  content: 'ⓘ';
  color: #60a5fa;
  font-size: 0.65em;
  margin-left: 3px;
  vertical-align: super;
  font-style: normal;
  font-weight: bold;
}

[data-concept]:hover {
  background: #ddf4ff;
  border-bottom-color: #0550ae;
}

/* ── Barre d'amorce pédagogique (teaser) ── */
.pedagogue-teaser {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  max-width: 600px;
  width: calc(100% - 32px);
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #2563eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #1f2328;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.pedagogue-teaser.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.pedagogue-teaser .teaser-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.pedagogue-teaser .teaser-text {
  flex: 1;
  min-width: 0;
}

.pedagogue-teaser .teaser-text strong {
  color: #0d1117;
}

.pedagogue-teaser .teaser-cta {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.pedagogue-teaser .teaser-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #656d76;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
}

.pedagogue-teaser .teaser-close:hover {
  color: #1f2328;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .pedagogue-popup {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 8px;
    max-height: 60vh;
  }

  .pedagogue-tooltip {
    max-width: 200px;
    font-size: 0.75rem;
  }
}
