/* ============================================================
   FanForge Share Sheet — companion CSS for fanforge-share.js
   Used when navigator.share isn't available (desktop, etc.)
   Mobile-first, dark aesthetic with pink/purple/blue gradient
   ============================================================ */

.ffs-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 6, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ffs-fade-in 180ms ease-out;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (min-width: 640px) {
  .ffs-overlay {
    align-items: center;
    padding: 24px;
  }
}

@keyframes ffs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ffs-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #15151c 0%, #0c0c12 100%);
  color: #f5f5f7;
  border-radius: 24px 24px 0 0;
  padding: 28px 22px 22px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  animation: ffs-slide-up 220ms cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 640px) {
  .ffs-sheet {
    border-radius: 24px;
    padding: 32px 28px 26px;
  }
}

@keyframes ffs-slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.ffs-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff2d8a 0%, #7b2cff 50%, #1e3aff 100%);
  border-radius: 24px 24px 0 0;
}

.ffs-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms;
}

.ffs-close:hover,
.ffs-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.ffs-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff2d8a;
  margin: 0 0 6px;
  background: linear-gradient(90deg, #ff2d8a 0%, #7b2cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ffs-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 18px;
  color: #fff;
  letter-spacing: -0.01em;
}

.ffs-preview {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 20px;
  border-radius: 14px;
  overflow: hidden;
  display: block;
  box-shadow: 0 8px 28px rgba(123, 44, 255, 0.28),
              0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  background: #0a0a0f;
}

.ffs-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ffs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

@media (max-width: 380px) {
  .ffs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ffs-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: #f5f5f7;
  cursor: pointer;
  transition: transform 120ms, background 140ms, border-color 140ms;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.ffs-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.ffs-btn:active {
  transform: translateY(0);
}

.ffs-btn:focus-visible {
  outline: 2px solid #ff2d8a;
  outline-offset: 2px;
}

.ffs-btn-emoji {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.ffs-btn-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(245, 245, 247, 0.85);
  text-align: center;
  letter-spacing: 0.01em;
}

.ffs-btn.is-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.08));
  border-color: rgba(34, 197, 94, 0.5);
}

.ffs-btn.is-success .ffs-btn-label {
  color: #4ade80;
}

.ffs-btn.is-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.08));
  border-color: rgba(239, 68, 68, 0.5);
}

.ffs-btn.is-error .ffs-btn-label {
  color: #f87171;
}

.ffs-foot {
  text-align: center;
  font-size: 12px;
  color: rgba(245, 245, 247, 0.5);
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ffs-foot a {
  color: rgba(255, 45, 138, 0.9);
  text-decoration: none;
  font-weight: 600;
}

.ffs-foot a:hover {
  text-decoration: underline;
}

/* ============================================================
   Inline trigger button — drop-in for any page
   <button class="ff-share-btn">Share</button>
   ============================================================ */

.ff-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #ff2d8a 0%, #7b2cff 50%, #1e3aff 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(123, 44, 255, 0.35);
  transition: background-position 320ms ease, transform 120ms, box-shadow 220ms;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.ff-share-btn:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(255, 45, 138, 0.42);
}

.ff-share-btn:active {
  transform: translateY(0);
}

.ff-share-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ff-share-btn::before {
  content: "✨";
  font-size: 16px;
}

/* Smaller variant */
.ff-share-btn.ff-share-btn--sm {
  padding: 8px 16px;
  font-size: 13px;
}

.ff-share-btn.ff-share-btn--sm::before {
  font-size: 14px;
}

/* Dark/native dark mode preference */
@media (prefers-reduced-motion: reduce) {
  .ffs-overlay,
  .ffs-sheet,
  .ff-share-btn {
    animation: none;
    transition: none;
  }
}
