/* Partage d'un apprentissage (Phase 2) — styles du module public/learning-share.js. */

/* Conteneur de la vignette : la flèche est ancrée à SON coin haut-droit (cf. règles ci-dessous). */
.learning-share-host { position: relative; }
/* Mon fil et Profil uniquement : conteneur de la vignette bridé à 220 px et centré. La carte de
   Découvrir (élément flex du carousel, 166 px) n'est pas concernée : pas de marge auto sur elle. */
.mon-fil-card-learning-tile.learning-share-host,
.profil-learning-tile.learning-share-host {
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

/* Flèche discrète, à l'intérieur de la vignette. Zone tactile 36 px (confortable au doigt), aspect
   visuel léger : fond translucide, trait fin. Aucun texte. */
.learning-share-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.learning-share-btn:hover,
.learning-share-btn:focus-visible { opacity: 0.8; }
.learning-share-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.learning-share-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 1.3;
  stroke-linejoin: round;
  paint-order: stroke fill;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

/* Cadre de la miniature (Mon fil et Profil) : ancre de la flèche, qui se place dans son coin haut-droit. */
.learning-share-frame { position: relative; }
.learning-share-frame > .learning-share-btn { top: 2px; right: 2px; }



.learning-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.32);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.learning-share-dialog {
  width: 100%;
  max-width: 330px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 70% at 50% 0%, #e8f3f7 0%, #fff 60%);
  color: #2c3e50;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  font-family: inherit;
}

.learning-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 6px;
}
.learning-share-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.learning-share-close {
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}
.learning-share-subject { margin: 0 18px 10px; font-size: 0.92rem; color: #374151; }

.learning-share-body {
  padding: 0 18px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.learning-share-muted { color: #6b7280; font-size: 0.9rem; margin: 10px 0; }

/* Sablier de chargement des abonnés : rotation continue, taille lisible au premier coup d'œil. */
.learning-share-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 0 12px;
}
.learning-share-hourglass {
  width: 80px;
  height: 80px;
  object-fit: contain;
  animation: learning-share-spin 1s linear infinite;
  transform-origin: center;
  will-change: transform;
}
.learning-share-loading .learning-share-muted { text-align: center; margin: 0; }
@keyframes learning-share-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .learning-share-hourglass { animation-duration: 2.5s; }
}

.learning-share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.learning-share-recipient {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.learning-share-recipient.is-selected { border-color: #516776; background: #e8f3f7; box-shadow: inset 0 0 0 1px #516776; }
.learning-share-recipient:disabled { opacity: 0.6; cursor: default; }
.learning-share-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  font-weight: 700;
}
.learning-share-avatar img { width: 100%; height: 100%; object-fit: cover; }
.learning-share-names { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.learning-share-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learning-share-handle { font-size: 0.82rem; color: #6b7280; }
.learning-share-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #9ca3af;
  flex: 0 0 auto;
}
.learning-share-recipient.is-selected .learning-share-mark { background: #516776; border-color: #516776; }
.learning-share-already { font-size: 0.78rem; color: #6b7280; white-space: nowrap; }

.learning-share-comment-label { display: block; margin: 14px 0 6px; font-size: 0.88rem; font-weight: 600; }
.learning-share-comment {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  resize: vertical;
}
.learning-share-counter { text-align: right; font-size: 0.78rem; color: #6b7280; margin: 4px 0 12px; }

.learning-share-footer {
  padding: 10px 18px 16px;
  border-top: 1px solid #e5e7eb;
  display: grid;
  gap: 8px;
}
.learning-share-status { margin: 0; min-height: 1.2em; font-size: 0.88rem; color: #374151; }
.learning-share-status.is-error { color: #b91c1c; }
.learning-share-send {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: #2c3e50;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.learning-share-send:disabled { background: #9ca3af; cursor: not-allowed; }
.learning-share-back {
  width: 100%;
  min-height: 44px;
  border: 1px solid #AEC0CC;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  color: #2c3e50;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.learning-share-back:focus-visible { outline: 2px solid #a0c6d4; outline-offset: 2px; }
@media (hover: hover) {
  .learning-share-back:hover { background: #f4f8fa; }
}

@media (max-width: 520px) {
  .learning-share-dialog { max-height: 86vh; }
}



/* ─── Premier écran et sélection : une seule carte blanche (mêmes règles pour les deux écrans) ─── */
.learning-share-intro {
  position: relative;
  padding: 30px 26px 26px;
  text-align: center;
}
.learning-share-pick {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.learning-share-intro[hidden],
.learning-share-pick[hidden] { display: none; }
.learning-share-decor {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto 14px;
  pointer-events: none;
}
.learning-share-decor-link { stroke: #AEC0CC; stroke-width: 1.2; stroke-linecap: round; }
.learning-share-decor-node { fill: #516776; }
.learning-share-decor-node.is-accent { fill: #a0c6d4; }
.learning-share-decor-spark { fill: #7a9bab; opacity: 0.8; }
.learning-share-intro-title {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: #2c3e50;
}
.learning-share-intro-text {
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #516776;
}
.learning-share-intro-cta {
  display: inline-block;
  min-width: 200px;
  max-width: 100%;
  min-height: 44px;
  padding: 12px 22px;
  border: 0;
  border-radius: 12px;
  background: #2c3e50;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.learning-share-intro-cta strong { font-weight: 800; }
.learning-share-intro-cta:focus-visible { outline: 2px solid #a0c6d4; outline-offset: 3px; }
.learning-share-intro-cta:active { transform: scale(0.98); }
@media (hover: hover) {
  .learning-share-intro-cta:hover { background: #1f2d3d; }
}
.learning-share-intro-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #516776;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.learning-share-intro-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.learning-share-intro-close:focus-visible { outline: 2px solid #a0c6d4; outline-offset: 2px; }
@media (hover: hover) {
  .learning-share-intro-close:hover { background: rgba(81, 103, 118, 0.1); }
}

/* Transition douce entre les deux écrans (désactivée si l'utilisateur réduit les animations). */
.learning-share-view { animation: learning-share-in 0.2s ease both; }
@keyframes learning-share-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .learning-share-view { animation: none; }
  .learning-share-intro-cta { transition: none; }
}
