/* ════════════════════════════════════════════════════
   PALAVRA VIVA PRO — posts.css
   Estilo Premium & Moderno para o Feed de Posts (Estilo TikTok/Instagram)
   Suporta Light e Dark Mode automaticamente com CSS Variables
   ════════════════════════════════════════════════════ */

/* Cores e Variáveis Específicas do Feed */
:root {
  --feed-card-bg-light: rgba(255, 255, 255, 0.7);
  --feed-card-bg-dark: rgba(20, 20, 35, 0.65);
  --feed-card-border-light: rgba(230, 230, 240, 0.8);
  --feed-card-border-dark: rgba(255, 255, 255, 0.08);
  --feed-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --feed-glow: 0 0 15px rgba(201, 168, 76, 0.2);
  
  --tiktok-red: #fe2c55;
  --tiktok-cyan: #25f4ee;
  --post-gradient: linear-gradient(135deg, var(--brand-1), #ff7e5f);
}

/* ── VIEW CONTÊINER PRINCIPAL ── */
#view-posts {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 100px;
  animation: fadeIn 0.4s ease-out;
}

/* ── HEADER DO FEED ── */
.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.posts-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-1), var(--brand-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.posts-create-btn {
  background: var(--post-gradient);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 40px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.posts-create-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.posts-create-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.45);
  background: linear-gradient(135deg, #ff7e5f, var(--brand-1));
}

.posts-create-btn:active {
  transform: translateY(0);
}

/* ── TABS FILTROS (PILLS PREMIUM) ── */
.posts-tabs {
  display: flex;
  background: var(--bg-3);
  padding: 4px;
  border-radius: 30px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  gap: 4px;
}

.posts-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: 25px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
}

.posts-tab.active {
  background: var(--bg-1);
  color: var(--brand-1);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.posts-tab:hover:not(.active) {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.05);
}

/* ── LISTA DE POSTS ── */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── CARD DE POST (GLASSMORPHISM TIKTOK STYLE) ── */
.post-card {
  background: var(--feed-card-bg-light);
  border: 1px solid var(--feed-card-border-light);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--feed-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: slideUp 0.5s ease-out both;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .post-card {
  background: var(--feed-card-bg-dark);
  border: 1px solid var(--feed-card-border-dark);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
}

/* ── HEADER DO POST (AUTOR) ── */
.post-card .post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.post-card .post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-card .post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--brand-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: var(--text-2);
}

.post-card .post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card .post-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-card .post-author-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.post-card .post-author-date {
  font-size: 11px;
  color: var(--text-3);
}

.post-official-badge {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(255, 126, 95, 0.1));
  color: var(--brand-1);
  border: 1px solid rgba(201, 168, 76, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--feed-glow);
}

.post-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-menu-btn:hover {
  background: rgba(254, 44, 85, 0.15);
  color: var(--tiktok-red);
}

/* ── CONTEÚDO DO POST ── */
.post-content {
  margin-bottom: 16px;
}

.post-text {
  font-family: 'Lora', Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-1);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

/* ── MÍDIA DO POST (IMAGEM E VÍDEO NO ESTILO TIKTOK) ── */
.post-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #09090e;
  border: 1px solid var(--feed-card-border-dark);
  box-shadow: var(--shadow-md);
  margin-top: 12px;
  transition: all 0.3s ease;
}

/* Proporção TikTok */
.post-media:has(.post-image) {
  max-height: 500px;
}

.post-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

.post-media:hover .post-image {
  transform: scale(1.02);
}

/* Estilização Iframe Vídeo TikTok Style */
.post-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

@media (max-aspect-ratio: 1/1) {
  .post-video {
    aspect-ratio: 9 / 16;
    max-height: 600px;
  }
}

/* ── BOTÕES DE AÇÕES (COM CONTADOR E GLOW) ── */
.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-action-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: 30px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-action-btn:hover {
  transform: translateY(-1px);
  background: var(--bg-2);
  color: var(--text-1);
}

.post-action-btn:active {
  transform: translateY(0);
}

/* Efeitos Específicos das Ações */
.post-action-btn:nth-child(1):hover {
  border-color: rgba(254, 44, 85, 0.4);
  background: rgba(254, 44, 85, 0.08);
  color: var(--tiktok-red);
  box-shadow: 0 0 10px rgba(254, 44, 85, 0.2);
}

.post-action-btn:nth-child(2):hover {
  border-color: rgba(37, 244, 238, 0.4);
  background: rgba(37, 244, 238, 0.08);
  color: #00f2fe;
}

.post-action-btn:nth-child(3):hover {
  border-color: rgba(201, 168, 76, 0.4);
  background: rgba(201, 168, 76, 0.08);
  color: var(--brand-1);
}

/* ── MODAL DE COMPARTILHAMENTO PREMIUM (TIKTOK GLASS CARD) ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 14, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-radius: 24px;
  width: 100%;
  max-width: 540px;
  animation: scaleDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .modal-card {
  background: rgba(20, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-overlay.visible .modal-card {
  animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Header do Modal */
.modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
}

.modal-header button {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-header button:hover {
  background: var(--bg-2);
  color: var(--text-1);
  transform: rotate(90deg);
}

/* Corpo do Modal */
.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.modal-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font-family: 'Lora', Georgia, serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-1);
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-textarea:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.post-form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-form-section label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

/* Estilizar Input File Premium */
.post-form-section input[type="file"] {
  display: none;
}

.post-form-section::before {
  content: none;
}

/* Custom File Upload Trigger */
.post-form-section label[for="postFormImageInput"] {
  background: var(--bg-3);
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.post-form-section label[for="postFormImageInput"]:hover {
  border-color: var(--brand-1);
  background: rgba(201, 168, 76, 0.04);
  color: var(--text-1);
}

/* Text Input Premium */
.modal-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--brand-1);
}

/* Preview de Imagem no Form */
.post-form-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 8px;
  background: #000;
  max-height: 200px;
}

.post-form-preview img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
}

.post-remove-img {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.2s;
}

.post-remove-img:hover {
  background: rgba(254, 44, 85, 0.9);
}

/* Footer do Modal */
.modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 30px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn.secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.modal-btn.secondary:hover {
  background: var(--bg-2);
  color: var(--text-1);
}

.modal-btn.primary {
  background: var(--post-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.25);
}

.modal-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(201, 168, 76, 0.35);
}

/* ── EMPTY STATE DE POSTS ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: 20px;
  animation: fadeIn 0.6s ease-out;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(var(--feed-glow));
}

.empty-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-3);
}

/* ── ANIMAÇÕES ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleDown {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* ── RESPONSIVIDADE MOBILE-FIRST ── */
@media (max-width: 600px) {
  #view-posts {
    padding: 16px 12px 100px;
  }
  
  .posts-header h2 {
    font-size: 18px;
  }

  .posts-create-btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  .post-card {
    padding: 16px;
    border-radius: 16px;
  }

  .post-card .post-avatar {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .post-text {
    font-size: 14px;
  }

  .post-action-btn {
    padding: 6px 12px;
    font-size: 11px;
    gap: 4px;
  }
}

/* ── NOTIFICAÇÃO DE NOVO POST PREMIUM (ESTILO IOS/TIKTOK PUSH) ── */
.premium-toast {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

[data-theme="dark"] .premium-toast {
  background: rgba(18, 18, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.premium-toast.visible {
  top: 24px;
  opacity: 1;
  pointer-events: auto;
}

.premium-toast-icon {
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-toast-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.premium-toast-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-1);
}

.premium-toast-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.premium-toast-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.premium-toast-close:hover {
  color: var(--text-1);
}
