/* ============================================================
   Post Detail View (pd-*) — Overrides for detail context
   Uses shared pc-* classes from rede-social.css as base
   ============================================================ */

/* Layout */
.pd-container { max-width: 680px; margin: 0 auto; padding: 16px 12px; }
.pd-card { border-radius: 8px; margin-bottom: 16px; }
.pd-card .pc-header { padding: 16px 16px 0; }
.pd-card .pc-avatar, .pd-card .pc-avatar img, .pd-card .pc-avatar-fb { width: 48px; height: 48px; font-size: 1rem; }

/* Header actions (follow + menu) */
.pd-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pd-follow-btn { padding: 6px 16px; border-radius: 6px; font-size: 0.875rem; font-weight: 600; border: 1px solid #0095f6; background: #0095f6; color: #fff; cursor: pointer; transition: all 0.2s; }
.pd-follow-btn:hover { background: #007ad9; }
.pd-follow-btn.following { background: transparent; color: #050505; border-color: #dbdbdb; }
.pd-follow-btn.following:hover { border-color: #c7c7c7; }

/* Title */
.pd-title { font-size: 1.5rem; font-weight: 700; color: #050505; margin: 0 0 12px; line-height: 1.3; }

/* Body overrides */
.pd-body { padding: 12px 16px 16px; }

/* Hashtags */
.pd-hashtags { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 12px; }
.pd-hashtag { display: inline-block; padding: 4px 12px; background: #eff6ff; color: #2563eb; border-radius: 16px; font-size: 0.8125rem; font-weight: 500; text-decoration: none; transition: all 0.15s; }
.pd-hashtag:hover { background: #dbeafe; }

/* Links in text */
.pd-body .hashtag-link { color: #1877f2; text-decoration: none; font-weight: 500; }
.pd-body .hashtag-link:hover { text-decoration: underline; }
.pd-body .mention-link { color: #1877f2; text-decoration: none; font-weight: 600; }
.pd-body .mention-link:hover { text-decoration: underline; }
.pd-body .mention-species { color: #0096c7; }
.pd-body .mention-plant { color: #2d6a4f; }

/* Engagement bar override — show views */
.pd-card .pc-engagement { padding: 10px 16px; }

/* Comments Section */
.pd-comments-section { background: #fff; border: 1px solid #e4e6eb; border-radius: 8px; overflow: hidden; }
.pd-comments-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 12px; border-bottom: 1px solid #e4e6eb; }
.pd-comments-title { font-size: 1.125rem; font-weight: 700; color: #050505; margin: 0; }
.pd-comments-count { font-size: 0.875rem; color: #65676b; font-weight: 400; margin-left: 6px; }

/* Comment sort toggle */
.comment-sort { display: flex; gap: 4px; }
.comment-sort .sort-btn { padding: 4px 12px; border-radius: 16px; font-size: 0.8125rem; font-weight: 600; border: 1px solid #e4e6eb; background: transparent; color: #65676b; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.comment-sort .sort-btn.active { background: #e7f3ff; color: #1877f2; border-color: #1877f2; }
.comment-sort .sort-btn:hover:not(.active) { background: #f0f2f5; }

/* Comment form in detail */
.pd-comment-form-wrap { padding: 12px 16px; border-bottom: 1px solid #e4e6eb; }
.pd-comment-form { display: flex; align-items: center; gap: 10px; }
.pd-comment-form .pc-cf-avatar,
.pd-comment-form .pc-cf-avatar-fb { width: 32px; height: 32px; font-size: 0.75rem; }
.pd-comment-input-wrap { flex: 1; display: flex; align-items: center; background: #f0f2f5; border-radius: 20px; padding: 6px 12px; }
.pd-comment-input { flex: 1; border: none; outline: none; font-size: 0.875rem; padding: 4px 0; background: transparent; font-family: inherit; color: #050505; }
.pd-comment-input::placeholder { color: #8e8e8e; }
.pd-comment-submit { border: none; background: none; color: #0095f6; font-weight: 600; font-size: 0.875rem; cursor: pointer; padding: 4px 8px; transition: opacity 0.15s, color 0.15s; opacity: 0.4; }
.pd-comment-submit.has-text { opacity: 1; }
.pd-comment-submit:hover { color: #00376b; }

/* Comments loading & list */
.pd-comments-loading { text-align: center; padding: 20px; color: #65676b; font-size: 0.875rem; }
.pd-comments-list { padding: 0 16px 16px; }
.pd-login-prompt { text-align: center; padding: 24px 16px; color: #65676b; font-size: 0.9375rem; }
.pd-login-prompt a { color: #1877f2; font-weight: 600; text-decoration: none; }
.pd-login-prompt a:hover { text-decoration: underline; }

/* Report modal */
.pd-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; }
.pd-modal-overlay.active { display: flex; }
.pd-modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 400px; width: 90%; animation: pdModalIn 0.2s ease; }
@keyframes pdModalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.pd-modal h3 { font-size: 1.125rem; font-weight: 700; color: #050505; margin: 0 0 16px; }
.pd-modal-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pd-modal-reasons label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e4e6eb; border-radius: 8px; cursor: pointer; font-size: 0.9375rem; transition: background 0.15s; }
.pd-modal-reasons label:hover { background: #f0f2f5; }
.pd-modal-reasons input[type="radio"] { accent-color: #1877f2; }
.pd-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pd-modal-btn { padding: 8px 20px; border-radius: 6px; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.15s; border: none; font-family: inherit; }
.pd-modal-btn-cancel { background: #e4e6eb; color: #050505; }
.pd-modal-btn-cancel:hover { background: #d8dadf; }
.pd-modal-btn-submit { background: #e74c3c; color: #fff; }
.pd-modal-btn-submit:hover { background: #c0392b; }

/* Likers modal */
.pd-likers-list { max-height: 300px; overflow-y: auto; }
.pd-liker { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.pd-liker-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pd-liker-avatar-fb { width: 36px; height: 36px; border-radius: 50%; background: #667eea; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.pd-liker-name { font-weight: 600; color: #050505; text-decoration: none; font-size: 0.9375rem; }
.pd-liker-name:hover { text-decoration: underline; }

/* Lightbox */
.post-lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 10000; align-items: center; justify-content: center; }
.post-lightbox.active { display: flex; }
.post-lightbox .lb-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; z-index: 10001; padding: 4px 10px; border-radius: 50%; transition: background 0.2s; }
.post-lightbox .lb-close:hover { background: rgba(255,255,255,0.15); }
.post-lightbox .lb-img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.post-lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 1.5rem; padding: 12px 16px; cursor: pointer; border-radius: 50%; transition: background 0.2s; z-index: 10001; }
.post-lightbox .lb-nav:hover { background: rgba(255,255,255,0.3); }
.post-lightbox .lb-prev { left: 16px; }
.post-lightbox .lb-next { right: 16px; }
.post-lightbox .lb-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.8); font-size: 0.875rem; }

/* Toast notification */
.pd-toast { position: fixed; top: 20px; right: 20px; z-index: 10000; opacity: 0; transform: translateX(100%); transition: all 0.3s ease; max-width: 400px; }
.pd-toast.show { opacity: 1; transform: translateX(0); }
.pd-toast-content { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: white; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); min-width: 280px; }
.pd-toast-success .pd-toast-content { border-left: 4px solid #10b981; }
.pd-toast-error .pd-toast-content { border-left: 4px solid #ef4444; }
.pd-toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.pd-toast-message { flex: 1; font-size: 0.875rem; color: #374151; }
.pd-toast-close { background: none; border: none; font-size: 1.25rem; color: #9ca3af; cursor: pointer; padding: 0; border-radius: 4px; transition: color 0.2s; }
.pd-toast-close:hover { color: #374151; }

/* Confirm modal */
.pd-confirm-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 10000; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.pd-confirm-overlay.show { display: flex; opacity: 1; }
.pd-confirm-box { background: #fff; border-radius: 16px; padding: 32px; max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center; transform: scale(0.9); transition: transform 0.3s ease; }
.pd-confirm-overlay.show .pd-confirm-box { transform: scale(1); }
.pd-confirm-icon { font-size: 3rem; margin-bottom: 12px; }
.pd-confirm-title { font-size: 1.25rem; font-weight: 600; color: #1f2937; margin-bottom: 8px; }
.pd-confirm-message { font-size: 0.875rem; color: #6b7280; margin-bottom: 24px; line-height: 1.5; }
.pd-confirm-actions { display: flex; gap: 12px; justify-content: center; }
.pd-confirm-btn { padding: 10px 24px; border: none; border-radius: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; min-width: 100px; font-family: inherit; }
.pd-confirm-btn-cancel { background: #f3f4f6; color: #374151; }
.pd-confirm-btn-cancel:hover { background: #e5e7eb; }
.pd-confirm-btn-confirm { background: #dc2626; color: white; }
.pd-confirm-btn-confirm:hover { background: #b91c1c; }

/* Like animation */
@keyframes pdHeartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.15); }
}
.pd-card .pc-action-btn.animate-like .action-icon { animation: pdHeartBeat 0.5s ease; }

/* Mobile */
@media (max-width: 768px) {
  .pd-container { padding: 8px 0; }
  .pd-card { border-radius: 0; border-left: 0; border-right: 0; }
  .pd-comments-section { border-radius: 0; border-left: 0; border-right: 0; }
  .pd-title { font-size: 1.25rem; }
  .pd-follow-btn { padding: 4px 12px; font-size: 0.8125rem; }
  .pd-card .pc-avatar, .pd-card .pc-avatar img, .pd-card .pc-avatar-fb { width: 40px; height: 40px; }
  .pd-toast { right: 8px; left: 8px; max-width: none; }
  .pd-confirm-box { padding: 24px; margin: 20px; }
  .pd-confirm-actions { flex-direction: column; }
  .pd-confirm-btn { width: 100%; }
}
