/* =====================================================
   Nanoverse Community Share Overlay
   Provides a glassmorphic action badge + composer modal
   ===================================================== */

.nv-share-target {
  position: relative;
}

.nv-share-overlay-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(11, 14, 26, 0.72);
  color: #f5f6ff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  z-index: 4;
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
}

.nv-share-overlay-btn i {
  font-size: 0.85rem;
}

.nv-share-overlay-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(111, 168, 255, 0.8);
}

.nv-share-overlay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nv-share-overlay-btn[data-share-state="shared"] {
  background: rgba(7, 191, 137, 0.85);
  border-color: rgba(7, 191, 137, 0.4);
}

.nv-share-overlay-btn[data-share-state="shared"] i {
  color: #051c15;
}

/* Share Composer Modal */
.nv-share-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 18, 0.65);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.nv-share-modal {
  width: min(420px, 92vw);
  border-radius: 22px;
  padding: 28px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(6, 10, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  color: #f6f8ff;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.nv-share-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  color: rgba(246, 248, 255, 0.7);
  font-size: 1.4rem;
  cursor: pointer;
}

.nv-share-close:hover {
  color: #ffffff;
}

.nv-share-modal h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.nv-share-modal p {
  margin: 0 0 18px;
  color: rgba(246, 248, 255, 0.75);
}

.nv-share-modal label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(246, 248, 255, 0.7);
}

.nv-share-modal input,
.nv-share-modal textarea,
.nv-share-modal select {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #f6f8ff;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.nv-share-modal textarea {
  min-height: 110px;
}

.nv-share-preview {
  width: 100%;
  min-height: 160px;
  margin-bottom: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nv-share-preview img,
.nv-share-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nv-share-preview audio {
  width: 100%;
}

.nv-share-preview-fallback {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  color: rgba(246, 248, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}

.nv-share-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.nv-share-modal-actions button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
}

.nv-share-modal-actions .nv-share-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #f6f8ff;
}

.nv-share-modal-actions .nv-share-submit {
  background: linear-gradient(120deg, #7c5cff, #29b6f6);
  color: #050714;
  min-width: 120px;
}

.nv-share-modal-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Auto-detected category badge (read-only display) */
.nv-share-category-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(41, 182, 246, 0.1));
  border: 1px solid rgba(124, 92, 255, 0.35);
}

.nv-share-category-badge .category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(246, 248, 255, 0.6);
}

.nv-share-category-badge .category-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nv-share-category-badge .category-value::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #29b6f6);
}

/* Category-specific badge colors */
.nv-share-category-badge .category-value[data-category="art"] { color: #f472b6; }
.nv-share-category-badge .category-value[data-category="art"]::before { background: linear-gradient(135deg, #ec4899, #f472b6); }

.nv-share-category-badge .category-value[data-category="shorts"] { color: #fb923c; }
.nv-share-category-badge .category-value[data-category="shorts"]::before { background: linear-gradient(135deg, #ea580c, #fb923c); }

.nv-share-category-badge .category-value[data-category="music"] { color: #34d399; }
.nv-share-category-badge .category-value[data-category="music"]::before { background: linear-gradient(135deg, #10b981, #34d399); }

.nv-share-category-badge .category-value[data-category="podcasts"] { color: #a78bfa; }
.nv-share-category-badge .category-value[data-category="podcasts"]::before { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.nv-share-category-badge .category-value[data-category="apps"] { color: #60a5fa; }
.nv-share-category-badge .category-value[data-category="apps"]::before { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.nv-share-category-badge .category-value[data-category="research"] { color: #fbbf24; }
.nv-share-category-badge .category-value[data-category="research"]::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

.nv-share-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 14px 20px;
  border-radius: 999px;
  color: #050714;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1000;
  background: #07bf89;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nv-share-toast.error {
  background: #ff6b6b;
  color: #140505;
}

.nv-share-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   User Tagging / Mention System
   ===================================================== */

.nv-share-tag-users-wrap {
  position: relative;
  margin-bottom: 16px;
}

.nv-share-tag-users-wrap label {
  display: block;
  margin-bottom: 6px;
}

.nv-share-tag-input-container {
  position: relative;
}

.nv-share-tag-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #f6f8ff;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

.nv-share-tag-input::placeholder {
  color: rgba(246, 248, 255, 0.5);
}

/* Live search results dropdown */
.nv-share-tag-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: linear-gradient(145deg, rgba(12, 14, 24, 0.98), rgba(8, 10, 18, 0.99));
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
}

.nv-share-tag-results.active {
  display: block;
}

.nv-share-tag-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nv-share-tag-result-item:last-child {
  border-bottom: none;
}

.nv-share-tag-result-item:hover {
  background: rgba(124, 92, 255, 0.15);
}

.nv-share-tag-result-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #29b6f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.nv-share-tag-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nv-share-tag-result-info {
  flex: 1;
  min-width: 0;
}

.nv-share-tag-result-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f6f8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nv-share-tag-result-handle {
  font-size: 0.8rem;
  color: rgba(246, 248, 255, 0.6);
}

.nv-share-tag-results-empty {
  padding: 16px;
  text-align: center;
  color: rgba(246, 248, 255, 0.5);
  font-size: 0.85rem;
}

.nv-share-tag-results-loading {
  padding: 16px;
  text-align: center;
  color: rgba(246, 248, 255, 0.5);
  font-size: 0.85rem;
}

.nv-share-tag-results-loading i {
  margin-right: 6px;
}

/* Tagged users display (chips) */
.nv-share-tagged-users {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.nv-share-tagged-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  background: rgba(124, 92, 255, 0.2);
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 999px;
  font-size: 0.8rem;
  color: #a78bfa;
}

.nv-share-tagged-chip-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #29b6f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
}

.nv-share-tagged-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nv-share-tagged-chip-remove {
  background: none;
  border: none;
  color: rgba(246, 248, 255, 0.6);
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1;
  transition: color 0.2s;
}

.nv-share-tagged-chip-remove:hover {
  color: #ff6b6b;
}
