/* public/css/share.css — Cross-platform share modal + platform icon row.
   NovaReel dark theme: cyan #00F2EA, coral #FF4D6D */

:root {
  --share-cyan: #00F2EA;
  --share-coral: #FF4D6D;
  --share-bg: #0a0a0a;
  --share-surface: #161616;
  --share-surface2: #1e1e1e;
  --share-border: rgba(255,255,255,0.08);
  --share-text: #f0f0f0;
  --share-text-muted: #888;
}

/* ── Share Button ─────────────────────────────────────────────────────────── */

.share-platform-btn {
  background: rgba(0,194,199,0.12);
  border: 1px solid rgba(0,194,199,0.25);
  color: var(--share-cyan);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.share-platform-btn:hover {
  background: rgba(0,194,199,0.22);
  border-color: rgba(0,194,199,0.5);
  transform: scale(1.04);
}
.share-platform-btn:active { transform: scale(0.95); }
.share-platform-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Share Modal ─────────────────────────────────────────────────────────── */

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.share-modal.open { display: flex; }

.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}

.share-modal-box {
  position: relative;
  z-index: 1;
  background: var(--share-surface);
  border: 1px solid var(--share-border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
  animation: shareModalSlideUp 0.25s ease-out;
}

@keyframes shareModalSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.share-modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--share-text);
}
.share-modal-close {
  background: none;
  border: none;
  color: var(--share-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.share-modal-close:hover { color: var(--share-text); background: rgba(255,255,255,0.08); }

/* Post info row */
.share-post-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--share-surface2);
  border-radius: 10px;
}
.share-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--share-surface);
  border: 1.5px solid var(--share-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--share-cyan);
  overflow: hidden;
  flex-shrink: 0;
}
.share-post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.share-post-meta { flex: 1; min-width: 0; }
.share-post-handle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--share-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-post-caption {
  font-size: 0.75rem;
  color: var(--share-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Platform grid */
.share-platforms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.share-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 12px 4px;
  border-radius: 14px;
  background: var(--share-surface2);
  border: 1px solid var(--share-border);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.share-platform:hover { transform: translateY(-2px); }
.share-platform:active { transform: scale(0.94); }

.share-platform-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-platform-icon svg { width: 22px; height: 22px; }
.share-platform-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--share-text-muted);
  text-align: center;
}

/* Loading state — applied by shareToPlatform() before window.open */
.share-platform.sharing { opacity: 0.6; pointer-events: none; }
.share-platform.sharing .share-platform-icon { animation: shareSpinner 0.6s linear infinite; }
@keyframes shareSpinner { to { opacity: 0.3; } }

/* Platform brand colors */
.share-platform-tiktok .share-platform-icon { background: #000; border: 1px solid rgba(255,255,255,0.15); }
.share-platform-tiktok:hover { border-color: #00F2EA; }
.share-platform-instagram .share-platform-icon { background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCAF45); }
.share-platform-instagram:hover { border-color: #E1306C; }
.share-platform-snapchat .share-platform-icon { background: #FFFC00; }
.share-platform-snapchat:hover { border-color: #FFFC00; }
.share-platform-youtube .share-platform-icon { background: #FF0000; }
.share-platform-youtube:hover { border-color: #FF0000; }
.share-platform-linkedin .share-platform-icon { background: #0A66C2; }
.share-platform-linkedin:hover { border-color: #0A66C2; }
.share-platform-facebook .share-platform-icon { background: #1877F2; }
.share-platform-facebook:hover { border-color: #1877F2; }
.share-platform-whatsapp .share-platform-icon { background: #25D366; }
.share-platform-whatsapp:hover { border-color: #25D366; }
.share-platform-telegram .share-platform-icon { background: #0088CC; }
.share-platform-telegram:hover { border-color: #0088CC; }

/* Native share option */
.share-native-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0,194,199,0.08);
  border: 1px solid rgba(0,194,199,0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.share-native-option:hover { background: rgba(0,194,199,0.15); }
.share-native-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--share-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-native-icon svg { width: 20px; height: 20px; stroke: #000; }
.share-native-text { flex: 1; }
.share-native-title { font-size: 0.88rem; font-weight: 600; color: var(--share-cyan); }
.share-native-desc { font-size: 0.72rem; color: var(--share-text-muted); margin-top: 1px; }
.share-native-arrow { color: var(--share-text-muted); }

/* Divider */
.share-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--share-text-muted);
  font-size: 0.72rem;
}
.share-divider::before,
.share-divider::after { content: ''; flex: 1; height: 1px; background: var(--share-border); }

/* ── Responsive ───────────────────────────────────────────────────────────── */

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