/* Màu chủ đạo Facebook */
:root {
  --fb-bg-color: #f0f2f5;
  --fb-card-bg: #ffffff;
  --fb-border-color: #dddfe2;
  --fb-text-primary: #050505;
  --fb-text-secondary: #65676b;
  --fb-blue: #1877f2;
}

body {
  background-color: var(--fb-bg-color);
  font-family: Helvetica, Arial, sans-serif;
}

/* === Layout tổng === */
.fb-feed-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile: 1 cột */
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* Sidebar trái + phải */
.fb-sidebar-left,
.fb-sidebar-right {
  display: none;
}

/* === Feed chính === */
.fb-feed-main {
  display: flex;
  flex-direction: column;
}

/* === Post Card === */
.fb-post-card {
  background: var(--fb-card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
  border: 1px solid var(--fb-border-color);
  overflow: hidden;
  transition: all 0.2s ease;
}
.fb-post-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Header */
.fb-post-card-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
}

.fb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.fb-author-name {
  font-weight: 600;
  color: var(--fb-text-primary);
  text-decoration: none;
}
.fb-author-name:hover {
  text-decoration: underline;
}

.fb-post-meta {
  font-size: 13px;
  color: var(--fb-text-secondary);
}

/* Nội dung bài viết */
.fb-post-content {
  padding: 0 16px 12px;
}

.fb-post-description {
  color: var(--fb-text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.fb-post-image {
  width: 100%;
  height: auto;
  display: block;
  border-top: 1px solid var(--fb-border-color);
  border-bottom: 1px solid var(--fb-border-color);
}

/* === Nút tương tác === */
.fb-post-stats {
  display: none;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--fb-text-secondary);
  border-bottom: 1px solid var(--fb-border-color);
}

.fb-post-actions {
  display: flex;
  justify-content: space-around;
  padding: 4px 0 8px;
}

.fb-action-button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 15px;
  color: var(--fb-text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s;
}
.fb-action-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* === Spinner + End message === */
.fb-spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--fb-blue);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#end-of-feed-message {
  color: var(--fb-text-secondary);
  text-align: center;
  margin: 16px 0;
}

/* === Desktop (3 cột) === */
@media (min-width: 900px) {
  .fb-feed-grid {
    grid-template-columns: 280px 1fr 280px;
    gap: 24px;
  }

  .fb-sidebar-left,
  .fb-sidebar-right {
    display: block;
    position: sticky;
    top: 70px;
    align-self: start;
  }
}

/* === Căn lại 3 nút hành động === */
.fb-post-actions {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 0 8px;
  border-top: 1px solid var(--fb-border-color);
}

/* Style chung cho cả nút và link */
.fb-action-button,
.fb-action-link {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--fb-text-secondary);
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.fb-action-button:hover,
.fb-action-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--fb-blue);
}

/* Icon + text nếu có */
.fb-action-button i,
.fb-action-link i {
  margin-right: 6px;
  font-size: 16px;
}

/* Giữ chiều cao đồng đều */
.fb-action-button,
.fb-action-link {
  min-height: 40px;
  line-height: 1;
}

/* ===== POPUP CHI TIẾT ===== */
.fb-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.fb-popup.hidden {
  display: none;
}

.fb-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}

.fb-popup-content {
  position: relative;
  background: #fff;
  max-width: 720px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  animation: popupFade 0.25s ease;
}

.fb-popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 28px;
  background: none;
  border: none;
  color: #444;
  cursor: pointer;
  transition: 0.2s;
}
.fb-popup-close:hover { color: #000; }

/* Tabs */
.fb-popup-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}
.fb-tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: #f9fafb;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}
.fb-tab-btn.active {
  background: #fff;
  border-bottom: 2px solid #1877f2;
  color: #1877f2;
}

/* Nội dung tab */
.fb-popup-tab {
  padding: 15px;
  display: none;
}
.fb-popup-tab.active {
  display: block;
}

@keyframes popupFade {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* === Vô hiệu hóa tính năng "Xem trước liên kết" (Tooltip / Preview) === */

/* Giữ click hoạt động nhưng chặn sự kiện hover mà script preview dùng */
.fb-post-card a[href^="http"] {
    pointer-events: auto; /* Cho phép click bình thường */
}

/* Không thay đổi hiệu ứng khi hover link */
.fb-post-card a[href^="http"]:hover {
    /* Không cần xử lý gì thêm khi hover */
}

/* Ẩn popup preview mà JS tạo ra (ví dụ: #lp-popup) */
#lp-popup {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

/* Ẩn toàn bộ tooltip / preview từ các thư viện khác (nếu có) */
.tippy-box,
.pll-preview-popup,
.link-preview-widget-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
