/* ============================================================
   SHARE WIDGET — share-widget.css
   Covers: floating widget + inline share button + card injected icons
   ============================================================ */

:root {
  --sw-primary:       #1a1a2e;
  --sw-accent:        #e94560;
  --sw-surface:       #ffffff;
  --sw-border:        #e8e8f0;
  --sw-shadow:        0 8px 32px rgba(0,0,0,0.14);
  --sw-shadow-hover:  0 12px 40px rgba(0,0,0,0.20);
  --sw-radius:        14px;
  --sw-radius-sm:     8px;
  --sw-font:          'Segoe UI', system-ui, sans-serif;
  --sw-anim:          0.22s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Platform colours */
  --sw-whatsapp:  #25d366;
  --sw-linkedin:  #0a66c2;
  --sw-facebook:  #1877f2;
  --sw-twitter:   #000000;
  --sw-telegram:  #26a5e4;
  --sw-email:     #ea4335;
  --sw-instagram: #e1306c;
  --sw-copy:      #6c757d;
  --sw-copy-ok:   #28a745;
}

/* ── Reset inside widget scope ─────────────────────────────── */
.sw-wrap *, .sw-floating-wrap * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   1. FLOATING WIDGET — vertical stack on right edge
   ============================================================ */
.sw-floating-wrap {
  position: fixed;
  right: 0;                        /* flush to right edge */
  bottom: 140px;                   /* above chat/feedback/gototop cluster */
  z-index: 9999;
  font-family: var(--sw-font);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

/* Toggle button — tab shape sticking out from right edge */
.sw-float-toggle {
  width: 44px;
  height: 44px;
  border-radius: 8px 0 0 8px;     /* rounded left, flush right */
  background: var(--sw-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -3px 3px 12px rgba(0,0,0,0.18);
  transition: transform var(--sw-anim), box-shadow 0.2s, opacity 0.2s;
  position: relative;
  z-index: 2;
  opacity: 0.45;                   /* semi-transparent by default */
}
.sw-float-toggle:hover,
.sw-floating-wrap.sw-open .sw-float-toggle {
  opacity: 1;
  transform: translateX(-3px);
  box-shadow: -5px 4px 18px rgba(0,0,0,0.22);
}
.sw-float-toggle svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  transition: transform 0.3s ease, opacity 0.2s;
}
.sw-float-toggle .sw-icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}
.sw-floating-wrap.sw-open .sw-float-toggle .sw-icon-share {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}
.sw-floating-wrap.sw-open .sw-float-toggle .sw-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Pulse ring */
.sw-float-toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 10px 0 0 10px;
  border: 2px solid var(--sw-accent);
  opacity: 0;
  animation: sw-pulse 2.4s ease-in-out infinite;
}
@keyframes sw-pulse {
  0%   { opacity: 0.6; transform: scale(1);   }
  70%  { opacity: 0;   transform: scale(1.45); }
  100% { opacity: 0;   transform: scale(1.45); }
}

/* Floating panel — opens to the LEFT of the toggle, never overflows right */
.sw-float-panel {
  position: absolute;
  bottom: 0;
  right: 14px;                     /* sits immediately left of toggle button */
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius) 0 0 var(--sw-radius);
  box-shadow: var(--sw-shadow);
  padding: 14px;
  width: 254px;                    /* fixed, never bleeds right */
  opacity: 0;
  transform: translateX(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  transform-origin: right center;
}
.sw-floating-wrap.sw-open .sw-float-panel {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: all;
}

.sw-float-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 10px;
}

/* ============================================================
   2. SHARED PLATFORM BUTTONS GRID
   ============================================================ */
.sw-platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sw-platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: var(--sw-radius-sm);
  border: 1px solid var(--sw-border);
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform var(--sw-anim);
  text-decoration: none;
}
.sw-platform-btn:hover {
  transform: translateY(-2px) scale(1.04);
}
.sw-platform-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sw-platform-btn span {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

/* Per-platform accent on hover */
.sw-platform-btn[data-platform="whatsapp"]:hover  { background: #e6faf0; border-color: var(--sw-whatsapp); }
.sw-platform-btn[data-platform="linkedin"]:hover  { background: #e8f1fb; border-color: var(--sw-linkedin); }
.sw-platform-btn[data-platform="facebook"]:hover  { background: #e7f0fd; border-color: var(--sw-facebook); }
.sw-platform-btn[data-platform="twitter"]:hover   { background: #f0f0f0; border-color: var(--sw-twitter); }
.sw-platform-btn[data-platform="email"]:hover     { background: #fdecea; border-color: var(--sw-email); }
.sw-platform-btn[data-platform="instagram"]:hover { background: #fce8f1; border-color: var(--sw-instagram); }
.sw-platform-btn[data-platform="copy"]:hover      { background: #f0f0f0; border-color: var(--sw-copy); }

/* Copy success flash */
.sw-platform-btn[data-platform="copy"].sw-copied {
  background: #e6f9ed;
  border-color: var(--sw-copy-ok);
}
.sw-platform-btn[data-platform="copy"].sw-copied span { color: var(--sw-copy-ok); }

/* ============================================================
   3. INLINE SHARE BUTTON (detail pages)
   ============================================================ */
.sw-wrap {
  font-family: var(--sw-font);
  display: inline-block;
}

/* Trigger button — compact pill */
.sw-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--sw-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform var(--sw-anim);
}
.sw-trigger:hover {
  background: var(--sw-accent);
  transform: scale(1.04);
}
.sw-trigger svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Popup overlay */
.sw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.sw-overlay.sw-visible {
  opacity: 1;
  pointer-events: all;
}

/* Popup card */
.sw-popup {
  background: var(--sw-surface);
  border-radius: var(--sw-radius);
  box-shadow: var(--sw-shadow);
  padding: 24px;
  width: min(360px, 92vw);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sw-overlay.sw-visible .sw-popup {
  transform: translateY(0) scale(1);
}

.sw-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sw-popup-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--sw-primary);
  line-height: 1.3;
  max-width: 280px;
}
.sw-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 20px;
  line-height: 1;
  padding: 0 0 0 8px;
  transition: color 0.15s;
}
.sw-popup-close:hover { color: var(--sw-accent); }

.sw-popup-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sw-popup-meta .sw-badge {
  background: #f0f0f8;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 600;
  color: var(--sw-primary);
  font-size: 11px;
}

/* Inside popup use a 4-col grid */
.sw-popup .sw-platforms {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sw-popup .sw-platform-btn {
  padding: 12px 6px;
}
.sw-popup .sw-platform-btn svg {
  width: 22px;
  height: 22px;
}
.sw-popup .sw-platform-btn span {
  font-size: 10px;
}

/* URL copy row */
.sw-url-row {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  border-top: 1px solid var(--sw-border);
  padding-top: 14px;
}
.sw-url-input {
  flex: 1;
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  color: #555;
  background: #f8f8fc;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  outline: none;
}
.sw-url-copy-btn {
  padding: 7px 14px;
  background: var(--sw-primary);
  color: #fff;
  border: none;
  border-radius: var(--sw-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.sw-url-copy-btn:hover  { background: var(--sw-accent); }
.sw-url-copy-btn.sw-copied { background: var(--sw-copy-ok); }

/* ============================================================
   4. CARD-INJECTED ICON ROW (listing pages)
   ============================================================ */
.sw-card-icons {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.sw-card-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--sw-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--sw-anim), border-color 0.15s;
  position: relative;
  padding: 0;
  line-height: 1;
}
.sw-card-icon-btn:hover { transform: scale(1.18); }
.sw-card-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block !important;
  visibility: visible !important;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}
/* Preserve each platform's own fill colour against global CSS resets */
.sw-card-icon-btn svg,
.sw-card-icon-btn svg path,
.sw-card-icon-btn svg rect,
.sw-card-icon-btn svg circle {
  fill: inherit;
}
.sw-card-icon-btn[data-platform="whatsapp"] svg,
.sw-card-icon-btn[data-platform="whatsapp"] svg path  { fill: #25d366 !important; }
.sw-card-icon-btn[data-platform="linkedin"] svg,
.sw-card-icon-btn[data-platform="linkedin"] svg path  { fill: #0a66c2 !important; }
.sw-card-icon-btn[data-platform="facebook"] svg,
.sw-card-icon-btn[data-platform="facebook"] svg path  { fill: #1877f2 !important; }
.sw-card-icon-btn[data-platform="twitter"]  svg,
.sw-card-icon-btn[data-platform="twitter"]  svg path  { fill: #000000 !important; }
.sw-card-icon-btn[data-platform="copy"]     svg,
.sw-card-icon-btn[data-platform="copy"]     svg path  { fill: #6c757d !important; }

/* Tooltip */
.sw-card-icon-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: var(--sw-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.sw-card-icon-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ============================================================
   5. SHARE COUNT BADGE (optional)
   ============================================================ */
.sw-count {
  font-size: 11px;
  color: #999;
  margin-top: 10px;
  text-align: center;
}
.sw-count strong { color: var(--sw-primary); }

/* ============================================================
   6. TOAST NOTIFICATION
   ============================================================ */
.sw-toast {
  position: fixed;
  bottom: 90px;
  right: 28px;
  background: var(--sw-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  font-family: var(--sw-font);
}
.sw-toast.sw-toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   7. RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .sw-floating-wrap {
    bottom: 100px;              /* stay above mobile FAB cluster */
  }
  .sw-float-panel {
    width: 200px;
    right: 44px;
  }
  .sw-popup .sw-platforms {
    grid-template-columns: repeat(3, 1fr);
  }
  .sw-toast {
    right: 12px;
    bottom: 70px;
  }
}