/* ══════════════════════════════════════════════════════════════
   novidades.css — Tela de Novidades + Modal de Boas-vindas
   ══════════════════════════════════════════════════════════════ */

/* ── Modal flutuante de aviso (aparece no login quando há não-lidas) ── */
#novidades-welcome-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  animation: nvFadeIn .25s ease;
}

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

#novidades-welcome-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  padding: 36px 40px 32px;
  width: 440px; max-width: calc(100vw - 32px);
  text-align: center;
  animation: nvSlideUp .3s ease;
  position: relative;
}

.nv-welcome-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent, var(--accent, #7c3aed)), var(--accent-light, #a855f7));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb, 124,58,237),.4);
  font-size: 26px;
}

.nv-welcome-title {
  font-size: 20px; font-weight: 700; color: var(--text-1);
  margin-bottom: 10px;
}

.nv-welcome-sub {
  font-size: 14px; color: var(--text-2); line-height: 1.6;
  margin-bottom: 28px;
}

.nv-welcome-count {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent, var(--accent, #7c3aed)), var(--accent-light, #a855f7));
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 4px 14px; border-radius: 99px;
  margin-bottom: 24px;
}

.nv-welcome-actions {
  display: flex; gap: 10px; justify-content: center;
}

.nv-btn-ver {
  flex: 1; height: 42px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent, var(--accent, #7c3aed)), var(--accent-light, #a855f7));
  color: #fff; font-size: 14px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  box-shadow: 0 2px 12px rgba(var(--accent-rgb, 124,58,237),.4);
  transition: filter .15s, box-shadow .15s;
}
.nv-btn-ver:hover { filter: brightness(1.08); box-shadow: 0 4px 18px rgba(var(--accent-rgb, 124,58,237),.55); }

.nv-btn-depois {
  flex: 1; height: 42px; border: 1.5px solid var(--border); border-radius: 10px;
  background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 500; font-family: var(--font); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.nv-btn-depois:hover { border-color: var(--accent); color: var(--accent); }

.nv-btn-nao-informar {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 11.5px; color: var(--text-4, #9ca3af);
  font-family: var(--font); text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
  padding: 2px 0;
}
.nv-btn-nao-informar:hover { color: var(--text-2); }


/* ── Tela principal de Novidades ── */
.nv-page {
  padding: 0;
  animation: nvFadeIn .25s ease;
}

.nv-page-header {
  margin-bottom: 28px;
}

.nv-page-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; font-weight: 700; color: var(--text-1);
  margin-bottom: 6px;
}

.nv-page-title-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent, var(--accent, #7c3aed)), var(--accent-light, #a855f7));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(var(--accent-rgb, 124,58,237),.35);
}

.nv-page-sub {
  font-size: 13px; color: var(--text-3);
  margin-left: 52px; /* alinha com o título */
}

/* Barra de controles (filtros + marcar todas) */
.nv-controls {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 24px;
}

.nv-filter-tabs {
  display: flex; gap: 6px; flex: 1; flex-wrap: wrap;
}

.nv-filter-tab {
  padding: 6px 14px; border-radius: 99px;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 500;
  font-family: var(--font); cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.nv-filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.nv-filter-tab.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; box-shadow: 0 2px 8px rgba(var(--accent-rgb, 124,58,237),.3);
}

.nv-btn-marcar-todas {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 8px;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 12.5px; font-family: var(--font);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.nv-btn-marcar-todas:hover { border-color: var(--accent); color: var(--accent); }
.nv-btn-marcar-todas:disabled { opacity: .5; cursor: not-allowed; }

/* Grid de cards */
.nv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Card individual */
.nv-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: border-color .2s, box-shadow .2s, opacity .2s;
  position: relative;
  overflow: hidden;
  cursor: default;
}
.nv-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(var(--accent-rgb, 124,58,237),.12); }

/* Linha lateral colorida por categoria */
.nv-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.nv-card.cat-novo::before    { background: #10b981; }
.nv-card.cat-melhoria::before { background: var(--accent, #7c3aed); }
.nv-card.cat-correcao::before { background: #f97316; }

/* Estado lida: opacidade reduzida */
.nv-card.lida { opacity: .55; }
.nv-card.lida:hover { opacity: .8; }

/* Selo "NOVO" em cards não lidos */
.nv-card:not(.lida)::after {
  content: ''; position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent, #7c3aed);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 124,58,237),.25);
}

.nv-card-top {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}

.nv-card-icone {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--bg-2); border: 1.5px solid var(--border);
  color: var(--accent);
}
.cat-novo    .nv-card-icone { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.2); color: #059669; }
.cat-melhoria .nv-card-icone { background: rgba(var(--accent-rgb, 124,58,237),.1); border-color: rgba(var(--accent-rgb, 124,58,237),.2); color: var(--accent, #7c3aed); }
.cat-correcao .nv-card-icone { background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.2); color: #ea580c; }

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

.nv-card-titulo {
  font-size: 14px; font-weight: 700; color: var(--text-1);
  margin-bottom: 4px; line-height: 1.3;
}

.nv-card-categoria {
  display: inline-block;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .4px;
}
.cat-novo    .nv-card-categoria { background: rgba(16,185,129,.12); color: #059669; }
.cat-melhoria .nv-card-categoria { background: rgba(var(--accent-rgb, 124,58,237),.12); color: var(--accent, #7c3aed); }
.cat-correcao .nv-card-categoria { background: rgba(249,115,22,.12); color: #ea580c; }

.nv-card-desc {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  margin-bottom: 16px;
}

.nv-card-footer {
  display: flex; align-items: center; justify-content: space-between;
}

.nv-card-data {
  font-size: 11px; color: var(--text-3); font-family: var(--mono);
}

.nv-card-btn-lida {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 4px 0;
  font-family: var(--font); transition: opacity .15s;
  display: flex; align-items: center; gap: 4px;
}
.nv-card-btn-lida:hover { opacity: .7; }
.nv-card-btn-lida.ja-lida { color: var(--text-3); cursor: default; pointer-events: none; }

/* Estado vazio */
.nv-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 24px;
  color: var(--text-3);
}
.nv-empty svg { opacity: .3; display: block; margin: 0 auto 14px; }
.nv-empty strong { display: block; font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.nv-empty span { font-size: 13px; }

/* Skeleton loader */
.nv-skeleton {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.nv-skeleton-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px; height: 160px;
}
.nv-skeleton-line {
  height: 12px; border-radius: 6px; background: var(--bg-3);
  margin-bottom: 10px; animation: nvPulse 1.4s ease infinite;
}
.nv-skeleton-line.w60 { width: 60%; }
.nv-skeleton-line.w40 { width: 40%; }
.nv-skeleton-line.w80 { width: 80%; }
@keyframes nvPulse {
  0%,100% { opacity: 1; } 50% { opacity: .4; }
}

/* ── Card clicável ───────────────────────────────────────────────────────── */
.nv-card-clicavel { cursor: pointer; }
.nv-card-clicavel:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb, 124,58,237),.15);
  transform: translateY(-1px);
  transition: border-color .2s, box-shadow .2s, transform .2s, opacity .2s;
}

/* Badges de mídia no footer do card */
.nv-card-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px;
  background: rgba(var(--accent-rgb, 124,58,237),.1); color: var(--accent, #7c3aed);
  letter-spacing: .2px;
}
.nv-card-badge-video {
  background: rgba(239,68,68,.1); color: #ef4444;
}

/* ══════════════════════════════════════════════════════════════════════════
   Modal de detalhe da novidade
   ══════════════════════════════════════════════════════════════════════════ */
#nv-detalhe-overlay {
  position: fixed; inset: 0; z-index: 2200;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  opacity: 0; transition: opacity .22s ease;
}
#nv-detalhe-overlay.nv-det-visible { opacity: 1; }
#nv-detalhe-overlay.nv-det-visible #nv-detalhe-box { transform: translateY(0); }

#nv-detalhe-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0,0,0,.28);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex; flex-direction: column;
  transform: translateY(16px); transition: transform .22s ease;
}

/* Header do modal */
.nv-det-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nv-det-icone {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nv-det-icone.cat-novo     { background: rgba(16,185,129,.1); color: #059669; }
.nv-det-icone.cat-melhoria { background: rgba(var(--accent-rgb, 124,58,237),.1); color: var(--accent, #7c3aed); }
.nv-det-icone.cat-correcao { background: rgba(249,115,22,.1); color: #ea580c; }

.nv-det-titulo {
  font-size: 16px; font-weight: 700; color: var(--text-1); line-height: 1.3;
}

.nv-det-close {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-3); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
}
.nv-det-close:hover { border-color: var(--accent); color: var(--accent); background: rgba(124,58,237,.06); }

/* Imagem */
.nv-det-imagem {
  width: 100%; overflow: hidden; flex-shrink: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  max-height: 300px;
  display: flex; align-items: center; justify-content: center;
}
.nv-det-imagem img {
  width: 100%; height: 100%; max-height: 300px;
  object-fit: cover; display: block;
}

/* Corpo */
.nv-det-corpo {
  padding: 20px 22px;
  flex: 1;
}

.nv-det-desc {
  font-size: 14px; color: var(--text-2); line-height: 1.75;
  margin: 0 0 18px;
}

/* Botão de vídeo */
.nv-det-video-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 10px;
  border: 1.5px solid rgba(239,68,68,.3);
  background: rgba(239,68,68,.05);
  color: #ef4444; font-size: 13.5px; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.nv-det-video-btn:hover {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.5);
  transform: translateX(2px);
}
.nv-det-video-icone {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(239,68,68,.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Footer do modal */
.nv-det-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.nv-det-btn-lida {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px;
  border: 1.5px solid var(--accent); background: rgba(124,58,237,.07);
  color: var(--accent); font-size: 13px; font-weight: 600;
  font-family: var(--font); cursor: pointer; transition: all .15s;
}
.nv-det-btn-lida:hover { background: rgba(var(--accent-rgb, 124,58,237),.14); }

/* Responsivo */
@media (max-width: 640px) {
  .nv-grid { grid-template-columns: 1fr; }
  .nv-page-sub { margin-left: 0; }
  #novidades-welcome-box { padding: 28px 20px 24px; }
  #nv-detalhe-box { border-radius: 14px; }
  .nv-det-imagem { max-height: 200px; }
}