/**
 * share-buttons.css — styles for the share FAB + panel built by js/share-buttons.js
 * Tokens mirror styles/main.css so the floating share UI matches the rest of
 * the official website (dark surface, cyan→blue/violet brand gradient).
 */

:root {
  --share-radius: 12px;
  --share-z: 1000;
}

/* Floating trigger */
.share-toggle {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(52, 215, 208, 0.96), rgba(124, 140, 255, 0.96));
  color: #0a0a12;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(124, 140, 255, 0.35);
  z-index: var(--share-z);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.share-toggle:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55); }
.share-toggle:focus-visible { outline: 2px solid #34d7d0; outline-offset: 3px; }
.share-toggle.active { transform: rotate(45deg); }
.share-toggle svg { width: 22px; height: 22px; display: block; }

/* Panel */
.share-panel {
  position: fixed;
  right: 24px;
  bottom: 160px;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 14px 12px;
  background: rgba(8, 9, 11, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--share-radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  z-index: calc(var(--share-z) - 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: inherit;
  color: #f7f4ec;
}
.share-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}
.share-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.share-panel-title { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: #f7f4ec; }
.share-panel-close {
  background: transparent;
  border: none;
  color: #a6adb5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.share-panel-close:hover { background: rgba(255, 255, 255, 0.08); color: #f7f4ec; }

/* 7-channel grid */
.share-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.share-panel-grid .share-btn:nth-child(7) {
  grid-column: 3 / span 2;
  justify-self: stretch;
  width: auto;
}
@media (max-width: 360px) {
  .share-panel { right: 16px; left: 16px; width: auto; }
  .share-panel-grid .share-btn:nth-child(7) { grid-column: auto; }
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f7f4ec;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.share-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(124, 140, 255, 0.55); transform: translateY(-1px); }
.share-btn:focus-visible { outline: 2px solid #34d7d0; outline-offset: 2px; }
.share-btn svg { width: 20px; height: 20px; display: block; color: #f7f4ec; }
.share-btn span { font-size: 11px; color: #a6adb5; white-space: nowrap; }

/* WeChat modal */
.share-wechat-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 8, 0.72);
  z-index: calc(var(--share-z) + 10);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.share-wechat-modal.show { opacity: 1; }
.share-wechat-modal-content {
  position: relative;
  width: min(280px, 90vw);
  padding: 24px 20px 20px;
  background: #0d0f15;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--share-radius);
  text-align: center;
  color: #f7f4ec;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.share-wechat-modal-content strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #f7f4ec; }
.share-wechat-modal-content small { display: block; margin-top: 10px; font-size: 12px; color: #a6adb5; }
.share-wechat-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  padding: 8px;
  background: #ffffff;
  border-radius: 8px;
}
.share-wechat-qr img, .share-wechat-qr canvas { display: block; width: 160px !important; height: 160px !important; }
.share-wechat-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a6adb5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.share-wechat-close:hover { background: rgba(255, 255, 255, 0.12); color: #f7f4ec; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .share-toggle, .share-panel, .share-btn, .share-wechat-modal { transition-duration: 0s; }
  .share-toggle.active { transform: none; }
}
