/* ═══════════════════════════════════════════
   FLOATING SOCIAL SHARE BUTTON
   Vanilla CSS — matches ProjectsHub design system
   ═══════════════════════════════════════════ */

/* ── Floating container ── */
.social-share {
  position: fixed;
  top: 100px;
  right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  /* justify-content: center; */
  touch-action: none;
  /* prevent scroll while dragging on mobile */
  user-select: none;
  -webkit-user-select: none;
  
  /* ✅ Smooth position transitions */
  transition: left 300ms cubic-bezier(0.23, 1, 0.32, 1),
              top 300ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Capsule pill ── */
.social-share__pill {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  border-radius: 9999px;
  overflow: hidden;
  cursor: grab;

  /* Glass surface */
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;

  /* Animate width with spring-like cubic-bezier */
  width: 50px;
  transition:
    width 450ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 300ms ease,
    border-color 300ms ease;
}

.social-share__pill:hover {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  border-color: rgba(255, 255, 255, 0.18);
}

.social-share__pill.is-expanded {
  width: 190px;
  cursor: grab;
}

/* While actively dragging */
.social-share.is-dragging {
  transition: none !important;
  cursor: grabbing;
}

.social-share.is-dragging .social-share__pill {
  cursor: grabbing;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: scale(1.04);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

/* ── Trigger content (Share + icon) ── */
.social-share__trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* gap: 8px; */
  font-family: 'Lexend Deca', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;

  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.social-share__trigger svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-share__pill.is-expanded .social-share__trigger {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

/* ── Expanded actions row ── */
.social-share__actions {
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 0;

  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  transition:
    opacity 200ms ease 100ms,
    transform 200ms ease 100ms;
}

.social-share__pill.is-expanded .social-share__actions {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* ── Individual social buttons ── */
.social-share__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease;
  flex-shrink: 0;
}

.social-share__btn svg {
  width: 20px;
  height: 20px;
}

/* Brand hover colors */
.social-share__btn--twitter:hover {
  color: #1DA1F2;
  background: rgba(29, 161, 242, 0.1);
}

.social-share__btn--instagram:hover {
  color: #E1306C;
  background: rgba(225, 48, 108, 0.1);
}

.social-share__btn--linkedin:hover {
  color: #0A66C2;
  background: rgba(10, 102, 194, 0.1);
}

.social-share__btn--copy:hover {
  background: rgba(255, 255, 255, 0.08);
}

.social-share__btn--copy.is-copied {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.social-share__btn--whatsapp {
  color: #25D366;
}

/* ── Divider ── */
.social-share__divider {
  width: 1px;
  height: 24px;
  background: var(--border-glass);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ── Tooltip ── */
.social-share__tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.social-share__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

.social-share__pill.is-expanded .social-share__btn:hover .social-share__tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ═══════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ═══════════════════════════════════════════ */

body.light .social-share__pill {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

body.light .social-share__pill:hover {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.06) inset;
  border-color: rgba(0, 0, 0, 0.15);
}

body.light .social-share__trigger {
  color: #475569;
}

body.light .social-share__btn {
  color: #64748b;
}

body.light .social-share__btn--copy:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.light .social-share__btn--copy.is-copied {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

body.light .social-share__divider {
  background: rgba(0, 0, 0, 0.1);
}

body.light .social-share__tooltip {
  background: rgba(15, 23, 42, 0.9);
}

body.light .social-share__tooltip::after {
  border-top-color: rgba(15, 23, 42, 0.9);
}

.social-share.open-left .social-share__pill {
  direction: rtl;
}

.social-share.open-left .social-share__actions {
  direction: ltr;
}

/* ── Responsive ── */
@media (max-width: 575px) {
  .social-share {
    top: 90px;
    right: 16px;

  }

  .social-share__pill {
    height: 44px;
    width: 44px;
    min-width: 44px;
  }

  .social-share__pill.is-expanded {
    width: 170px;
    min-width: 170px;
  }

  .social-share__trigger {
    font-size: 0.8125rem;
  }

  .social-share__btn {
    width: 36px;
    height: 36px;
  }

  .social-share__btn svg {
    width: 18px;
    height: 18px;
  }
}