/* Share panel (sound detail) + popover + Shareon polish */

/* ---------- Detail panel ---------- */
.sb-share-panel__label {
  margin: 0 0 0.75rem;
  font-size: 0.625rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.sb-share-panel__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sb-share-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #ff2e93 0%, #7c3aed 100%);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 20px rgba(255, 46, 147, 0.22);
  -webkit-tap-highlight-color: transparent;
}
.sb-share-cta:hover {
  opacity: 0.95;
}
.sb-share-cta:active {
  transform: scale(0.98);
}
.sb-share-cta--ghost {
  background: #141a26;
  border: 1px solid #1f293d;
  color: #cbd5e1;
  box-shadow: none;
}
.sb-share-cta--ghost:hover {
  color: #00f0ff;
  border-color: rgba(0, 240, 255, 0.4);
  opacity: 1;
}
.sb-share-cta__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}
.sb-share-cta.sb-copy-link.is-copied {
  color: #00f0ff !important;
  border-color: rgba(0, 240, 255, 0.45) !important;
}

/* Even icon grid — 4 cols phone, 7 cols desktop */
.sb-shareon-inline.shareon {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  font-size: 0 !important;
}

@media (min-width: 480px) {
  .sb-shareon-inline.shareon {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

.sb-share-popover .shareon,
.sb-shareon-inline.shareon {
  font-size: 0 !important;
}

.sb-share-popover .shareon > *,
.sb-shareon-inline.shareon > * {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  font-size: 0 !important;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.sb-share-popover .shareon > *:hover,
.sb-shareon-inline.shareon > *:hover {
  opacity: 0.88;
  cursor: pointer;
}
.sb-share-popover .shareon > *:active,
.sb-shareon-inline.shareon > *:active {
  transform: scale(0.96);
}

/* Recenter Shareon glyph (vendor uses absolute top/left) */
.sb-share-popover .shareon > *:before,
.sb-shareon-inline.shareon > *:before {
  position: static !important;
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  top: auto !important;
  left: auto !important;
  background-size: 20px 20px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.sb-share-popover .shareon > *:not(:empty),
.sb-shareon-inline.shareon > *:not(:empty) {
  font-size: 0 !important;
  padding: 0 !important;
}
.sb-share-popover .shareon > *:not(:empty):before,
.sb-shareon-inline.shareon > *:not(:empty):before {
  width: 20px !important;
  height: 20px !important;
}

/* Narrow phones: stack Share / Copy */
@media (max-width: 360px) {
  .sb-share-panel__actions {
    grid-template-columns: 1fr;
  }
}

/* ---------- Popover (pads / header share) ---------- */
.sb-share-popover {
  position: absolute;
  z-index: 80;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 16px));
  padding: 0.85rem 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 61, 0.95);
  background: rgba(15, 19, 28, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.sb-share-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.65rem;
}

.sb-share-popover__close {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  min-width: 36px;
  min-height: 36px;
}
.sb-share-popover__close:hover {
  color: #e2e8f0;
  background: rgba(31, 41, 61, 0.8);
}

.sb-share-popover__url {
  display: block;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 61, 0.95);
  background: #0a0d12;
  color: #94a3b8;
  font-size: 0.7rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-share-popover .shareon {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
}

/* Mobile: bottom sheet for share popover */
@media (max-width: 640px) {
  .sb-share-popover.is-sheet {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    border-radius: 20px 20px 0 0;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  }
  .sb-share-popover.is-sheet .shareon {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .sb-share-popover.is-sheet .shareon > * {
    height: 48px !important;
  }
}

.sb-share-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.sb-share-backdrop.is-on {
  display: block;
}

.sb-share,
.sb-copy {
  background: transparent !important;
  box-shadow: none !important;
}
.sb-share.sb-share-cta,
.sb-copy.sb-share-cta {
  background: linear-gradient(135deg, #ff2e93 0%, #7c3aed 100%) !important;
  box-shadow: 0 8px 20px rgba(255, 46, 147, 0.22) !important;
}
.sb-share.sb-share-cta--ghost,
.sb-copy.sb-share-cta--ghost {
  background: #141a26 !important;
  box-shadow: none !important;
}

.sb-copy-link.is-copied,
.sb-copy.is-copied {
  color: #00f0ff !important;
  border-color: rgba(0, 240, 255, 0.4) !important;
}

.sb-share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  z-index: 90;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(20, 26, 38, 0.96);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.sb-share-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
