/**
 * Dayditto notification bell + panel (used by planner.html).
 * Standalone; no Tailwind dependency.
 */

.dd-notif-mount {
  display: flex;
  align-items: center;
  position: relative;
}

/* ── BELL BUTTON ── */
.bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  color: #64748b;
}
.bell-btn:hover {
  background: #f1f5f9;
  border-color: rgba(30, 58, 95, 0.2);
}
.bell-btn.open {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #ef4444;
  border: 2px solid #fff;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  transition: all 0.2s;
}
.bell-badge.hide {
  transform: scale(0);
  opacity: 0;
}

/* ── PANEL ── */
.notif-panel {
  position: fixed;
  top: 66px;
  right: 16px;
  width: 360px;
  background: #fff;
  border: 1px solid rgba(30, 58, 95, 0.1);
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(15, 32, 64, 0.04),
    0 10px 30px rgba(15, 32, 64, 0.12),
    0 24px 60px rgba(15, 32, 64, 0.08);
  z-index: 200;
  overflow: hidden;
  display: none;
  animation: ddnp-panelIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.notif-panel.open {
  display: flex;
  flex-direction: column;
}
@keyframes ddnp-panelIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.np-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(30, 58, 95, 0.07);
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.np-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
  letter-spacing: -0.2px;
}
.np-count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  margin-left: 8px;
}
.np-mark-all {
  font-size: 11.5px;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.12s;
  font-family: inherit;
}
.np-mark-all:hover {
  background: #eff6ff;
}

.np-tabs {
  display: flex;
  gap: 0;
  padding: 8px 12px 0;
  flex-shrink: 0;
}
.np-tab {
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.np-tab:hover {
  color: #475569;
}
.np-tab.act {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 700;
}

.np-list {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.np-list::-webkit-scrollbar {
  width: 4px;
}
.np-list::-webkit-scrollbar-track {
  background: transparent;
}
.np-list::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}
.np-list::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

.np-date-group {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.np-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  border-bottom: 1px solid rgba(30, 58, 95, 0.04);
}
.np-item:last-child {
  border-bottom: none;
}
.np-item:hover {
  background: #f8fafc;
}
.np-item.unread {
  background: #fafbff;
}
.np-item.unread:hover {
  background: #f0f5ff;
}

.np-unread-dot {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.np-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.np-content {
  flex: 1;
  min-width: 0;
}
.np-line1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.np-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  flex-shrink: 0;
}
.np-time {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 500;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.np-line2 {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  max-height: 35px;
}
.np-item.unread .np-line2 {
  color: #334155;
}

.np-task-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 4px;
  transition: all 0.12s;
  cursor: pointer;
}
.np-task-chip:hover {
  background: #dbeafe;
}
.np-task-chip.deleted {
  color: #94a3b8;
  background: #f1f5f9;
  border-color: #e2e8f0;
  cursor: default;
}

.np-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
  margin-top: 1px;
}
.np-item:hover .np-actions {
  opacity: 1;
}
.np-act-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.12s;
}
.np-act-btn:hover {
  background: #f1f5f9;
  color: #475569;
}
.np-act-btn.dismiss:hover {
  background: #fee2e2;
  color: #ef4444;
}

.np-empty {
  padding: 48px 24px;
  text-align: center;
  color: #94a3b8;
}
.np-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}
.np-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.np-empty-sub {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
}

.np-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(30, 58, 95, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.np-footer-lbl {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.np-footer-link {
  font-size: 11.5px;
  font-weight: 700;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.np-footer-link:hover {
  text-decoration: underline;
}

.ic-wa {
  background: #dcfce7;
}
.ic-ai {
  background: #ede9fe;
}
.ic-cal {
  background: #ede9fe;
}
.ic-notif {
  background: #fef3c7;
}
.ic-task {
  background: #eff6ff;
}
.ic-focus {
  background: #fef3c7;
}
.ic-sys {
  background: #f1f5f9;
}
.ic-mail {
  background: #dbeafe;
}

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 520px) {
  .notif-panel {
    left: 8px;
    right: 8px;
    width: auto;
    top: 60px;
  }
}

/* Full-screen dim + elevated panel (mobile planner: overlayBackdrop) */
.ddnp-panel-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 480;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.ddnp-panel-bg.open {
  display: block;
}
body.ddnp-backdrop-on {
  overflow: hidden;
}
.notif-panel.ddnp-with-overlay {
  z-index: 490 !important;
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 88px)) !important;
  left: auto !important;
  right: 12px !important;
  width: min(360px, calc(100vw - 24px)) !important;
  max-height: min(calc(100dvh - 200px - env(safe-area-inset-bottom, 0px)), 560px) !important;
}
.notif-panel.ddnp-with-overlay .np-list {
  max-height: none;
  flex: 1;
  min-height: 0;
}
.notif-panel.ddnp-with-overlay .np-name {
  max-width: none;
}

.ddnp-jump-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.ddnp-jump-toast.show {
  opacity: 1;
}

/* Actionable notification buttons (Yes / No) */
.np-action-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.np-action-yes,
.np-action-no {
  flex: 1;
  padding: 7px 10px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.np-action-yes:hover { opacity: .85; }
.np-action-no:hover  { opacity: .85; }
.np-action-yes {
  background: #2563EB;
  color: #fff;
}
.np-action-no {
  background: #F1F5F9;
  color: #475569;
}
.np-action-done {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #15803D;
}
