/* ============================================================
   PathtoAI Blog & Research Papers — Engagement Component
   Social Sharing, Copy Link, Likes, Comments
   ============================================================ */

/* ─── Engagement Wrapper ─── */
.engagement-wrapper {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line, #d8d1c5);
  border-radius: 12px;
  padding: 20px;
  margin: 32px 0;
  backdrop-filter: blur(8px);
}

.engagement-section {
  margin-bottom: 20px;
}

.engagement-section:last-child {
  margin-bottom: 0;
}

/* ─── Engagement Header ─── */
.engagement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #d8d1c5);
}

.engagement-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2, #5d6e80);
}

/* ─── Share Buttons ─── */
.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line, #d8d1c5);
  background: var(--card, white);
  color: var(--text, #1d2a39);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

.share-btn:hover {
  border-color: var(--a1, #2f6f8f);
  background: linear-gradient(135deg, rgba(47, 111, 143, 0.08), rgba(217, 119, 6, 0.06));
  transform: translateY(-2px);
}

.share-btn.copy-link {
  border-color: var(--a2, #d97706);
}

.share-btn.copy-link:hover {
  border-color: var(--a2, #d97706);
  background: rgba(217, 119, 6, 0.12);
}

.share-btn.twitter {
  border-color: #1da1f2;
}

.share-btn.twitter:hover {
  background: rgba(29, 161, 242, 0.12);
  color: #1da1f2;
}

.share-btn.linkedin {
  border-color: #0077b5;
}

.share-btn.linkedin:hover {
  background: rgba(0, 119, 181, 0.12);
  color: #0077b5;
}

.share-btn.facebook {
  border-color: #1877f2;
}

.share-btn.facebook:hover {
  background: rgba(24, 119, 242, 0.12);
  color: #1877f2;
}

.share-btn.reddit {
  border-color: #ff4500;
}

.share-btn.reddit:hover {
  background: rgba(255, 69, 0, 0.12);
  color: #ff4500;
}

.share-btn.email {
  border-color: var(--a1, #2f6f8f);
}

.share-btn.email:hover {
  background: rgba(47, 111, 143, 0.12);
  color: var(--a1, #2f6f8f);
}

.share-btn-icon {
  font-size: 1.1rem;
}

/* Tooltip for copy feedback */
.share-btn.copy-link.copied::after {
  content: "Copied!";
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text, #1d2a39);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

/* ─── Like Section ─── */
.like-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--a2, #d97706);
  background: transparent;
  color: var(--a2, #d97706);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.like-btn:hover {
  background: rgba(217, 119, 6, 0.12);
  transform: scale(1.05);
}

.like-btn.liked {
  background: var(--a2, #d97706);
  color: white;
}

.like-btn .heart {
  display: inline-block;
  font-size: 1.2rem;
}

.like-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
  font-size: 0.9rem;
  color: var(--a2, #d97706);
  font-weight: 600;
}

/* ─── Comments Section ─── */
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.comment-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--a2, #d97706);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.comment-form {
  background: var(--bg-1, #f3efe6);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line, #d8d1c5);
}

.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8d1c5);
  border-radius: 6px;
  background: var(--card, white);
  color: var(--text, #1d2a39);
  font-family: var(--body, sans-serif);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 10px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--a1, #2f6f8f);
  box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.1);
}

.comment-form input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line, #d8d1c5);
  border-radius: 6px;
  background: var(--card, white);
  color: var(--text, #1d2a39);
  font-family: var(--body, sans-serif);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.comment-form input[type="text"]:focus {
  outline: none;
  border-color: var(--a1, #2f6f8f);
  box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.1);
}

.comment-form-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.comment-submit {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  background: var(--a2, #d97706);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-submit:hover {
  background: #b85f00;
}

.comment-cancel {
  padding: 9px 16px;
  border: 1px solid var(--line, #d8d1c5);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2, #5d6e80);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-cancel:hover {
  border-color: var(--text-2, #5d6e80);
  background: rgba(0, 0, 0, 0.02);
}

/* ─── Comments List ─── */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment {
  background: var(--card, white);
  border: 1px solid var(--line, #d8d1c5);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s ease;
}

.comment:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 700;
  color: var(--text, #1d2a39);
  font-size: 0.9rem;
}

.comment-time {
  font-size: 0.8rem;
  color: var(--text-2, #5d6e80);
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-dim, #5d6e80);
  line-height: 1.6;
  margin: 8px 0;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line, #d8d1c5);
}

.comment-action {
  font-size: 0.8rem;
  color: var(--a1, #2f6f8f);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.comment-action:hover {
  color: var(--a2, #d97706);
  text-decoration: underline;
}

/* Nested replies */
.comment.reply {
  margin-left: 32px;
  margin-top: -8px;
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--a1, #2f6f8f);
}

.no-comments-message {
  text-align: center;
  padding: 24px;
  color: var(--text-2, #5d6e80);
  font-size: 0.9rem;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-2, #5d6e80);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.empty-state-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── Dark Theme Support ─── */
[data-theme="dark"] .engagement-wrapper {
  background: rgba(30, 44, 84, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .share-btn {
  background: var(--card, white);
  color: var(--text, white);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .share-btn:hover {
  border-color: var(--a1, #2f6f8f);
  background: rgba(47, 111, 143, 0.2);
}

[data-theme="dark"] .comment-form {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .comment-form textarea,
[data-theme="dark"] .comment-form input[type="text"] {
  background: var(--card, white);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text, white);
}

[data-theme="dark"] .comment {
  border-color: rgba(255, 255, 255, 0.1);
}

/* ─── Mobile Responsive ─── */
@media (max-width: 640px) {
  .engagement-wrapper {
    padding: 16px;
  }

  .share-buttons {
    gap: 8px;
  }

  .share-btn {
    padding: 9px 12px;
    font-size: 0.8rem;
  }

  .share-btn-icon {
    font-size: 1rem;
  }

  .like-section {
    flex-wrap: wrap;
  }

  .comment.reply {
    margin-left: 16px;
  }

  .share-btn.copy-link.copied::after {
    font-size: 0.7rem;
    bottom: -24px;
  }
}
