﻿/* ── Horos Notification System Styles ──────────────────────────────────────── */

/* ── Bell badge ──────────────────────────────────────────────────────────────── */
.hn-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  border: 2px solid var(--topbar-bg, #0a0a0e);
  z-index: 1;
}

/* ── Global Toast Stack (top-right) ─────────────────────────────────────────── */
.hn-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.hn-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e293b;
  border: 1px solid rgba(31,147,255,0.25);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 280px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  cursor: pointer;
  pointer-events: all;
  animation: hnToastIn 0.2s ease both;
  transition: opacity 0.2s;
}
.hn-toast:hover { background: #263045; }

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

.hn-toast-emoji {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.hn-toast-body {
  flex: 1;
  min-width: 0;
}

.hn-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.hn-toast-msg {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hn-toast-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 0 0 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.hn-toast-close:hover { color: #f1f5f9; }

/* ── Notification Center dropdown ────────────────────────────────────────────── */
.hn-nc {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 520px;
  background: #111827;
  border: 1px solid rgba(31,147,255,0.2);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9000;
  animation: hnNCIn 0.18s ease both;
}

@keyframes hnNCIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hn-nc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.hn-nc-heading {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.hn-nc-mark-all {
  background: none;
  border: none;
  color: #1F93FF;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.hn-nc-mark-all:hover { background: rgba(31,147,255,0.12); }

/* ── Filter tabs ──────────────────────────────────────────────────────────────── */
.hn-nc-filters {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.hn-nc-filters::-webkit-scrollbar { display: none; }

.hn-nc-filter-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.hn-nc-filter-btn:hover { background: rgba(255,255,255,0.06); color: #cbd5e1; }
.hn-nc-filter-btn.active { background: rgba(31,147,255,0.18); color: #60B8FF; }

/* ── Notification list ────────────────────────────────────────────────────────── */
.hn-nc-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.hn-nc-list::-webkit-scrollbar { width: 4px; }
.hn-nc-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.hn-nc-section {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hn-nc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.hn-nc-item:hover { background: rgba(255,255,255,0.04); }
.hn-nc-item.read { opacity: 0.55; }

.hn-nc-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(31,147,255,0.12);
}
.hn-nc-icon-messages { background: rgba(37,211,102,0.12); }
.hn-nc-icon-system   { background: rgba(0,125,255,0.12); }
.hn-nc-icon-agenda   { background: rgba(31,147,255,0.12); }
.hn-nc-icon-leads    { background: rgba(31,147,255,0.12); }
.hn-nc-icon-default  { background: rgba(100,116,139,0.12); }

.hn-nc-body {
  flex: 1;
  min-width: 0;
}

.hn-nc-title {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.hn-nc-item:not(.read) .hn-nc-title { font-weight: 600; color: #f1f5f9; }

.hn-nc-msg {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.hn-nc-time {
  font-size: 11px;
  color: #475569;
}

.hn-nc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1F93FF;
  flex-shrink: 0;
  margin-top: 4px;
}

.hn-nc-empty {
  padding: 32px;
  text-align: center;
  color: #475569;
  font-size: 13px;
}

.hn-nc-load-more {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: #1F93FF;
  font-size: 13px;
  font-weight: 500;
  padding: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.hn-nc-load-more:hover { background: rgba(31,147,255,0.08); }

/* ── Light theme overrides ────────────────────────────────────────────────────── */
[data-theme="light"] .hn-toast {
  background: #fff;
  border-color: rgba(31,147,255,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] .hn-toast:hover { background: #f8fafc; }
[data-theme="light"] .hn-toast-title { color: #0f172a; }
[data-theme="light"] .hn-toast-msg   { color: #64748b; }

[data-theme="light"] .hn-nc {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
[data-theme="light"] .hn-nc-heading  { color: #0f172a; }
[data-theme="light"] .hn-nc-title    { color: #1e293b; }
[data-theme="light"] .hn-nc-item:not(.read) .hn-nc-title { color: #0f172a; }
[data-theme="light"] .hn-nc-msg      { color: #64748b; }
[data-theme="light"] .hn-nc-item:hover { background: #f8fafc; }
[data-theme="light"] .hn-nc-section  { color: #94a3b8; }
[data-theme="light"] .hn-nc-header,
[data-theme="light"] .hn-nc-filters,
[data-theme="light"] .hn-nc-item,
[data-theme="light"] .hn-nc-load-more { border-color: rgba(0,0,0,0.06); }
[data-theme="light"] .hn-bell-badge  { border-color: #fff; }
[data-theme="light"] .hn-nc-icon-messages { background: rgba(37,211,102,0.1); }
[data-theme="light"] .hn-nc-icon-system   { background: rgba(0,125,255,0.1); }
[data-theme="light"] .hn-nc-icon          { background: rgba(31,147,255,0.1); }

/* ── Notification detail modal ───────────────────────────────────────────────── */
.hn-nc-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hnNCIn 0.15s ease both;
}

.hn-nc-detail {
  background: #111827;
  border: 1px solid rgba(31,147,255,0.2);
  border-radius: 8px;
  padding: 20px 22px 22px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
}

.hn-nc-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.hn-nc-detail-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}

.hn-nc-detail-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.12s;
}
.hn-nc-detail-close:hover { color: #f1f5f9; }

.hn-nc-detail-body {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0 0 18px;
}

.hn-nc-detail-link {
  background: rgba(31,147,255,0.15);
  border: none;
  color: #60B8FF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: inherit;
  transition: background 0.15s;
}
.hn-nc-detail-link:hover { background: rgba(31,147,255,0.26); }

[data-theme="light"] .hn-nc-detail {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}
[data-theme="light"] .hn-nc-detail-title { color: #0f172a; }
[data-theme="light"] .hn-nc-detail-body  { color: #64748b; }

/* ============================================================================
   NOTIFICAÇÕES NO TEMA DO SITE (2026-10-03, pedido do usuário)
   Painel do sino, detalhe e aviso que chega usam as mesmas variáveis do resto
   do app (--card, --line, --fg…) nos modos escuro e claro — sem o azul-marinho fixo.
   Vem por último e vence as regras de cima.
   ============================================================================ */
.hn-bell-badge { background: var(--hot); border-color: var(--topbar-bg, var(--bg)); }

/* Painel do sino */
.hn-nc, [data-theme="light"] .hn-nc {
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 384px;
}
.hn-nc-header, [data-theme="light"] .hn-nc-header { border-bottom: 1px solid var(--line); padding: 16px 16px 12px; }
.hn-nc-heading, [data-theme="light"] .hn-nc-heading { color: var(--fg); font-size: 15px; font-weight: 600; }
.hn-nc-mark-all { color: var(--accent); border-radius: 8px; }
.hn-nc-mark-all:hover { background: var(--bg-2); }
.hn-nc-filters, [data-theme="light"] .hn-nc-filters { border-color: var(--line); }
.hn-nc-filter-btn { color: var(--fg-3); }
.hn-nc-filter-btn:hover { background: var(--bg-2); color: var(--fg); }
.hn-nc-filter-btn.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hn-nc-list { scrollbar-color: color-mix(in srgb, var(--fg) 18%, transparent) transparent; }
.hn-nc-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--fg) 18%, transparent); }
.hn-nc-section, [data-theme="light"] .hn-nc-section { color: var(--fg-4); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 12px; }
.hn-nc-item, [data-theme="light"] .hn-nc-item { border-color: var(--line); }
.hn-nc-item:hover, [data-theme="light"] .hn-nc-item:hover { background: var(--bg-2); }
.hn-nc-item.read { opacity: 1; }
.hn-nc-item.read .hn-nc-title, .hn-nc-item.read .hn-nc-msg { color: var(--fg-3); }
.hn-nc-title, [data-theme="light"] .hn-nc-title { color: var(--fg-2); }
.hn-nc-item:not(.read) .hn-nc-title, [data-theme="light"] .hn-nc-item:not(.read) .hn-nc-title { color: var(--fg); }
.hn-nc-msg, [data-theme="light"] .hn-nc-msg { color: var(--fg-3); }
.hn-nc-time { color: var(--fg-4); font-variant-numeric: tabular-nums; }
.hn-nc-dot { background: var(--accent); }
.hn-nc-empty { color: var(--fg-4); }
.hn-nc-icon { border-radius: 10px; }
.hn-nc-load-more, [data-theme="light"] .hn-nc-load-more { color: var(--accent); border-color: var(--line); }
.hn-nc-load-more:hover { background: var(--bg-2); }

/* Detalhe da notificação */
.hn-nc-detail-overlay { background: rgba(8, 10, 14, .55); backdrop-filter: blur(3px); }
.hn-nc-detail, [data-theme="light"] .hn-nc-detail {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); color: var(--fg);
}
.hn-nc-detail-title, [data-theme="light"] .hn-nc-detail-title { color: var(--fg); font-weight: 600; }
.hn-nc-detail-body, [data-theme="light"] .hn-nc-detail-body { color: var(--fg-3); }
.hn-nc-detail-close { color: var(--fg-3); }
.hn-nc-detail-close:hover { color: var(--fg); }
.hn-nc-detail-link { background: var(--accent); color: #fff; }
.hn-nc-detail-link:hover { background: var(--accent); filter: brightness(1.07); }

/* Aviso que chega (GlobalToast em shell.jsx) */
.hn-toast-stack { top: 72px; right: 20px; gap: 10px; }
.hn-toast, [data-theme="light"] .hn-toast {
  position: relative; overflow: hidden; align-items: flex-start; gap: 12px;
  width: 360px; min-width: 0; max-width: calc(100vw - 32px); padding: 14px 12px 16px 16px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px -14px rgb(0 0 0 / .45), 0 2px 6px -2px rgb(0 0 0 / .15);
  animation: hnToastIn2 .42s cubic-bezier(.2, .9, .25, 1.15) both;
}
[data-theme="light"] .hn-toast { box-shadow: 0 18px 44px -16px rgb(15 23 42 / .28), 0 2px 6px -2px rgb(15 23 42 / .08); }
.hn-toast::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.hn-toast.hn-mod-messages::before { background: #25D366; }
.hn-toast:hover, [data-theme="light"] .hn-toast:hover { background: var(--card); border-color: color-mix(in srgb, var(--fg) 16%, transparent); }
.hn-toast.leaving { animation: hnToastOut .22s cubic-bezier(.4, 0, 1, 1) both; }
@keyframes hnToastIn2 {
  0%   { opacity: 0; transform: translateX(28px) scale(.96); }
  100% { opacity: 1; transform: none; }
}
@keyframes hnToastOut { to { opacity: 0; transform: translateX(24px) scale(.97); } }
.hn-toast-ico {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--bg-2); color: var(--fg-2);
}
.hn-toast-ico img { width: 20px; height: 20px; }
.hn-toast-body { flex: 1; min-width: 0; padding-top: 1px; }
.hn-toast-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 11.5px; line-height: 1.2; }
.hn-toast-kicker { color: var(--fg-3); font-weight: 500; }
.hn-toast-when { color: var(--fg-4); }
.hn-toast-when::before { content: "\00B7"; margin-right: 8px; color: var(--fg-4); }
.hn-toast-title, [data-theme="light"] .hn-toast-title {
  color: var(--fg); font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 0;
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hn-toast-msg, [data-theme="light"] .hn-toast-msg {
  color: var(--fg-3); font-size: 12.5px; line-height: 1.4; margin-top: 2px;
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hn-toast-close {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; padding: 0; margin: -4px -2px 0 0;
  color: var(--fg-4); background: transparent; transition: background .15s, color .15s;
}
.hn-toast-close:hover { color: var(--fg); background: var(--bg-2); }
.hn-toast-timer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform-origin: left;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  animation: hnToastTimer linear forwards;
}
.hn-toast.hn-mod-messages .hn-toast-timer { background: color-mix(in srgb, #25D366 70%, transparent); }
.hn-toast.paused .hn-toast-timer { animation-play-state: paused; }
@keyframes hnToastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 520px) { .hn-toast-stack { left: 16px; right: 16px; top: 68px; } .hn-toast { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .hn-toast, .hn-toast.leaving { animation-duration: 1ms; } }

/* ── Aviso "Receba os avisos no celular" (notification-service.js _maybeAskPush) ── */
#hn-push-ask { position: fixed; left: 12px; right: 12px; bottom: calc(var(--mtab-h, 62px) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 9500;
  background: var(--card); color: var(--fg); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px;
  padding: 14px 14px 12px; box-shadow: 0 12px 32px rgba(0,0,0,.22); animation: hnPaIn .28s ease-out; }
#hn-push-ask .hn-pa-t { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
#hn-push-ask .hn-pa-s { font-size: 13.5px; line-height: 1.45; color: var(--fg-2); }
#hn-push-ask .hn-pa-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#hn-push-ask button { height: 36px; padding: 0 14px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
#hn-push-ask .hn-pa-no { background: transparent; border: 1px solid var(--line); color: var(--fg-2); }
#hn-push-ask .hn-pa-yes { background: var(--accent); border: 0; color: #fff; }
@keyframes hnPaIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #hn-push-ask { animation: none; } }
