/* =====================================================
   RESET & VARIÁVEIS DO TEMA
====================================================== */
:root {
  --fb-blue: #1877f2;
  --fb-blue-hover: #166fe5;
  --fb-bg: #eef0f3;
  --fb-card-bg: #ffffff;
  --fb-text-primary: #050505;
  --fb-text-secondary: #65676b;
  --fb-icon-bg: #edf0f4;
  --fb-icon-hover: #e4e6eb;
  --fb-border: #dddfe2;
  --fb-divider: #e4e6eb;
  --fb-bubble-bg: #f0f2f5;
  --fb-live-red: #ef4056;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --shadow-card: 0 1px 12px rgba(0, 0, 0, 0.1);
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--fb-bg);
  color: var(--fb-text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* =====================================================
   CONTAINER PRINCIPAL (MOBILE FIRST)
====================================================== */
.page {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--fb-card-bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 431px) {
  body {
    padding: 16px 0 24px;
  }
  .page {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    min-height: calc(100vh - 40px);
  }
}

/* =====================================================
   HEADER ESTILO FACEBOOK
====================================================== */
.fb-header {
  height: 54px;
  width: 100%;
  background: var(--fb-card-bg);
  border-bottom: 1px solid var(--fb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.fb-left,
.fb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--fb-blue);
  color: #ffffff;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1px;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  font-family: Arial, sans-serif;
  letter-spacing: -2px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
  user-select: none;
}

.round-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--fb-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c1e21;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  user-select: none;
  flex-shrink: 0;
}

.round-icon:hover {
  background: var(--fb-icon-hover);
}

.round-icon:active {
  transform: scale(0.95);
}

.round-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.round-icon.message svg {
  width: 22px;
  height: 22px;
}

.round-icon.bell svg {
  width: 21px;
  height: 21px;
}

.round-icon.apps svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.round-icon.profile {
  background: #e4e7eb;
  overflow: hidden;
}

.round-icon.profile svg {
  width: 38px;
  height: 38px;
}

/* =====================================================
   CABEÇALHO DA PUBLICAÇÃO (POST HEADER)
====================================================== */
.post-header {
  padding: 14px 14px 10px;
  background: var(--fb-card-bg);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-photo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: 50% 20%;
  flex-shrink: 0;
  background: #e4e6eb;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-info {
  min-width: 0;
  flex: 1;
}

.profile-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-name {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--fb-text-primary);
}

.verified {
  width: 15px;
  height: 15px;
  border-radius: var(--radius-full);
  background: var(--fb-blue);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--fb-live-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: #ffffff;
  animation: livePulse 1.2s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

.post-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--fb-text-secondary);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-menu {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fb-text-secondary);
  font-size: 22px;
  cursor: pointer;
  border-radius: var(--radius-full);
}

.post-menu:hover {
  background: var(--fb-bubble-bg);
}

.post-title {
  margin: 12px 0 2px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--fb-text-primary);
  letter-spacing: -0.2px;
}

/* =====================================================
   ÁREA DO VÍDEO (VSL SECTION)
====================================================== */
.video-section {
  width: 100%;
  background: #000000;
  position: relative;
  overflow: hidden;
}

.video-wrapper {
  position: relative;
  width: 100%;
  background: #000000;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay com distintivo AO VIVO e visualizadores */
.video-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  display: flex;
  gap: 8px;
  pointer-events: none;
}

.video-live {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--fb-live-red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.viewer-count {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(30, 30, 30, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.viewer-count-dot {
  color: #ef4056;
}

/* Placeholder elegante caso não haja VSL inserida ainda */
.vsl-placeholder-container {
  width: 100%;
  padding: 133.33% 0 0; /* 3:4 aspect ratio ou 16:9 configurável */
  position: relative;
  background: #0d0f12;
  color: #ffffff;
  display: block;
}

.vsl-placeholder-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, #1a202c 0%, #080a0d 100%);
}

.vsl-placeholder-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: rgba(239, 64, 86, 0.2);
  border: 2px solid var(--fb-live-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(239, 64, 86, 0.4);
}

.vsl-placeholder-icon svg {
  width: 30px;
  height: 30px;
  margin-left: 3px;
  fill: #ffffff;
}

.vsl-placeholder-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.vsl-placeholder-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  max-width: 320px;
}

.vsl-placeholder-code-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 11px;
  color: #38bdf8;
}

/* Suporte para tags de players (VTurb, PandaVideo, etc.) */
.video-wrapper vturb-smartplayer,
.video-wrapper panda-player,
.video-wrapper iframe {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  border: 0 !important;
}

/* =====================================================
   REAÇÕES & ENGAJAMENTO
====================================================== */
.engagement {
  background: var(--fb-card-bg);
  padding: 10px 14px 0;
}

.engagement-top {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--fb-text-secondary);
  font-size: 13px;
}

.reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.reaction-icons {
  display: inline-flex;
  align-items: center;
}

.reaction {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-left: -4px;
  background: #eee;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reaction:first-child {
  margin-left: 0;
  z-index: 3;
}
.reaction:nth-child(2) {
  z-index: 2;
}
.reaction:nth-child(3) {
  z-index: 1;
}

.engagement-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.engagement-divider {
  height: 1px;
  background: var(--fb-divider);
  margin-top: 8px;
}

/* Linha de botões de ação */
.action-row {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-bottom: 1px solid var(--fb-divider);
}

.action-btn {
  border: 0;
  background: transparent;
  color: var(--fb-text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  flex: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.action-btn:hover {
  background: var(--fb-bubble-bg);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn.liked {
  color: var(--fb-blue);
  font-weight: 700;
}

.action-btn.liked .action-icon {
  color: var(--fb-blue);
}

.action-icon {
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.action-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* =====================================================
   CAMPO DE COMENTÁRIO (INPUT)
====================================================== */
.comment-box {
  padding: 10px 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--fb-card-bg);
  border-bottom: 1px solid var(--fb-divider);
}

.mini-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: #e4e6eb;
  color: #65676b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.comment-input-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.comment-input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  border-radius: var(--radius-full);
  background: var(--fb-bubble-bg);
  padding: 0 40px 0 14px;
  font-size: 13px;
  color: var(--fb-text-primary);
  font-family: inherit;
  transition: background 0.15s ease;
}

.comment-input:focus {
  background: #e8ecf1;
}

.comment-input::placeholder {
  color: var(--fb-text-secondary);
}

.comment-send {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--fb-blue);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: transform 0.1s ease, color 0.15s ease;
}

.comment-send:active {
  transform: scale(0.9);
}

.comment-send svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* =====================================================
   LISTA DE COMENTÁRIOS AO VIVO
====================================================== */
.comments-container {
  background: var(--fb-card-bg);
  padding: 12px 12px 28px;
  flex: 1;
}

.comments-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fb-text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comments-filter {
  color: var(--fb-blue);
  font-weight: 600;
  cursor: pointer;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.comment.new-comment {
  animation: commentIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes commentIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  user-select: none;
  object-fit: cover;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.comment-main {
  min-width: 0;
  flex: 1;
}

.comment-bubble {
  display: inline-block;
  max-width: 100%;
  border-radius: var(--radius-lg);
  background: var(--fb-bubble-bg);
  padding: 8px 12px;
}

.comment-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--fb-text-primary);
}

.comment-text {
  font-size: 13px;
  line-height: 1.38;
  color: var(--fb-text-primary);
  overflow-wrap: anywhere;
}

.comment-actions {
  padding: 3px 8px 0;
  display: flex;
  gap: 14px;
  color: var(--fb-text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.comment-action-item {
  cursor: pointer;
}

.comment-action-item:hover {
  text-decoration: underline;
}

.comment-time {
  font-weight: 400;
}

/* =====================================================
   SEÇÃO OPCIONAL DE PITCH / CTA (DELAY DA VSL)
====================================================== */
.vsl-pitch-section {
  display: none; /* Controlado via JavaScript com delay */
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 24px 16px;
  border-top: 2px solid #e2e8f0;
  text-align: center;
  animation: pitchReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pitchReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vsl-pitch-section.visible {
  display: block;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  min-height: 54px;
  padding: 12px 24px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: ctaPulse 2s infinite ease-in-out;
}

@keyframes ctaPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.65);
  }
}

.cta-button:active {
  transform: scale(0.98);
}

.cta-guarantee {
  margin-top: 12px;
  font-size: 12px;
  color: var(--fb-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* =====================================================
   RODAPÉ (PRIVACY FOOTER)
====================================================== */
.privacy-footer {
  padding: 20px 14px 26px;
  text-align: center;
  background: #f0f2f5;
  border-top: 1px solid var(--fb-border);
  font-size: 12px;
  color: var(--fb-text-secondary);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.privacy-link {
  color: var(--fb-blue);
  font-weight: 600;
  text-decoration: none;
  transition: text-decoration 0.15s ease;
}

.privacy-link:hover {
  text-decoration: underline;
}

.copyright-text {
  font-size: 11px;
  color: #8a8d91;
}

/* =====================================================
   TOAST DE NOTIFICAÇÃO (COMPARTILHAMENTO)
====================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
