/* ─────────────────────────────────────────────────────────────────────────
   share.css — Humbolo TIME Partage
   Desktop : barre sticky à droite (verticale)
   Mobile  : barre fixed en bas (horizontale)
───────────────────────────────────────────────────────────────────────────── */

/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --share-bg:         rgba(12, 8, 20, 0.92);
  --share-border:     rgba(255, 255, 255, 0.08);
  --share-radius:     16px;
  --share-wa:         #25D366;
  --share-x:          #e7e9ea;
  --share-fb:         #1877F2;
  --share-tg:         #2AABEE;
  --share-copy:       #d4af37;
  --share-ig:         #E1306C;
}

/* ── Conteneur principal ─────────────────────────────────────────────────── */
.share-wrap {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--share-bg);
  border: 1px solid var(--share-border);
  border-radius: var(--share-radius);
  padding: 0.75rem 0.6rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  transition: opacity 0.3s ease;
}

.share-wrap:hover { opacity: 1 !important; }

.share-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(240, 240, 240, 0.3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  margin-bottom: 0.25rem;
  user-select: none;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  color: rgba(240,240,240,0.6);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0;           /* hide text, show SVG only */
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.share-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.share-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(12, 8, 20, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(240,240,240,0.85);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.share-btn:hover::after { opacity: 1; }

/* Couleurs par plateforme */
.share-wa:hover  { background: rgba(37,211,102,0.15);  border-color: rgba(37,211,102,0.4);  color: var(--share-wa); }
.share-x:hover   { background: rgba(231,233,234,0.1);  border-color: rgba(231,233,234,0.3); color: var(--share-x); }
.share-fb:hover  { background: rgba(24,119,242,0.15);  border-color: rgba(24,119,242,0.4);  color: var(--share-fb); }
.share-tg:hover  { background: rgba(42,171,238,0.15);  border-color: rgba(42,171,238,0.4);  color: var(--share-tg); }
.share-copy:hover{ background: rgba(212,175,55,0.15);  border-color: rgba(212,175,55,0.4);  color: var(--share-copy); }
.share-ig:hover  { background: rgba(225,48,108,0.15);  border-color: rgba(225,48,108,0.4);  color: var(--share-ig); }

/* Pulse on copied */
.share-copy.copied {
  background: rgba(212,175,55,0.2);
  border-color: rgba(212,175,55,0.6);
  color: var(--share-copy);
  animation: pulse-share 0.4s ease;
}

@keyframes pulse-share {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
#share-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(212,175,55,0.95);
  color: #080510;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 1.25rem;
  border-radius: 50px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

#share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile : barre horizontale fixed en bas ──────────────────────────────── */
@media (max-width: 900px) {
  .share-wrap {
    position: fixed;
    right: auto;
    bottom: 0;
    left: 0;
    top: auto;
    transform: none;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    border-radius: 16px 16px 0 0;
    padding: 0.65rem 1rem;
    gap: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .share-label {
    writing-mode: horizontal-tb;
    transform: none;
    margin-bottom: 0;
    margin-right: 0.25rem;
    font-size: 0.55rem;
  }

  .share-btn {
    width: 42px;
    height: 42px;
  }

  .share-btn::after { display: none; } /* pas de tooltip mobile */

  #share-toast { bottom: 5.5rem; }
}

/* ── Masqué sur very small screens si vraiment nécessaire ─────────────────── */
@media (max-width: 360px) {
  .share-label { display: none; }
  .share-btn { width: 36px; height: 36px; }
  .share-btn svg { width: 15px; height: 15px; }
}
