/* ===========================================================================
   Lumina Notifications — Facebook-style overlay widget
   =========================================================================== */

/* ---------- Host ---------- */
/* Default (fallback / mobile): fixed top-right.
   .inline (when injected into the nav): inline-block, no positioning. */

.lumina-notif-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", "BPG Mrgvlovani Caps", sans-serif;
  color: #050505;
  pointer-events: auto;
}
.lumina-notif-host.inline {
  position: static;
  display: inline-flex;
  align-items: center;
  z-index: auto;
}

/* ---------- Bell ---------- */

/* Default bell — round, white, fixed-mode look */
.lumina-notif-bell {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, color .15s ease;
  position: relative;
}
.lumina-notif-bell:hover {
  background: #f0f2f5;
}
.lumina-notif-bell:active {
  transform: scale(0.94);
}
.lumina-notif-bell svg {
  width: 22px;
  height: 22px;
  fill: #050505;
  transition: fill .15s ease;
}
.lumina-notif-bell.has-unread svg {
  animation: lumina-bell-shake 0.6s ease;
}

/* Inline bell — matches React nav buttons (p-2, text-stone-400) */
.lumina-notif-host.inline .lumina-notif-bell {
  width: auto;
  height: auto;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  padding: 8px;
}
.lumina-notif-host.inline .lumina-notif-bell svg {
  width: 20px;
  height: 20px;
  fill: #a8a29e; /* stone-400 */
}
.lumina-notif-host.inline .lumina-notif-bell:hover {
  background: transparent;
}
.lumina-notif-host.inline .lumina-notif-bell:hover svg {
  fill: #1c1917; /* stone-900 */
}
.lumina-notif-host.inline .lumina-notif-bell.has-unread svg {
  fill: #1c1917;
}

@keyframes lumina-bell-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}

.lumina-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e41e3f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff;
  letter-spacing: -0.5px;
}
.lumina-notif-badge.hidden { display: none; }
.lumina-notif-host.inline .lumina-notif-badge {
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
}

/* ---------- Dropdown panel ---------- */

/* Panel — fixed-positioned. Coordinates set by JS based on bell's bounding rect. */
.lumina-notif-panel {
  position: fixed;
  top: 70px;
  right: 18px;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 75vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.95) translateY(-6px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 999999;
}
.lumina-notif-panel.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.lumina-notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 8px;
  border-bottom: 1px solid #eaecef;
}
.lumina-notif-panel-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.lumina-notif-panel-header button {
  background: none;
  border: none;
  color: #1877f2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.lumina-notif-panel-header button:hover { background: #f0f2f5; }
.lumina-notif-panel-header button:disabled { color: #b0b3b8; cursor: default; background: none; }

.lumina-notif-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.lumina-notif-list::-webkit-scrollbar { width: 8px; }
.lumina-notif-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

.lumina-notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: #65676b;
  font-size: 14px;
}

/* ---------- List item ---------- */

.lumina-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s ease;
  position: relative;
}
.lumina-notif-item:hover { background: #f2f2f2; }
.lumina-notif-item.unread::before {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1877f2;
}
.lumina-notif-item.unread { background: #e7f3ff20; }

.lumina-notif-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  user-select: none;
}

.lumina-notif-body {
  flex: 1;
  min-width: 0;
}
.lumina-notif-text {
  font-size: 14px;
  line-height: 1.35;
  color: #050505;
  margin: 0 0 4px;
  word-wrap: break-word;
}
.lumina-notif-text b { font-weight: 700; }
.lumina-notif-time {
  font-size: 12px;
  color: #65676b;
  font-weight: 600;
}
.lumina-notif-item.unread .lumina-notif-time { color: #1877f2; }

.lumina-notif-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.lumina-notif-actions button {
  flex: 1;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: background .15s ease;
}
.lumina-notif-actions .accept {
  background: #1877f2;
  color: #fff;
}
.lumina-notif-actions .accept:hover { background: #166fe5; }
.lumina-notif-actions .decline {
  background: #e4e6eb;
  color: #050505;
}
.lumina-notif-actions .decline:hover { background: #d8dadf; }
.lumina-notif-actions button:disabled { opacity: 0.5; cursor: default; }

/* ===========================================================================
   Toast popup (bottom-right, slides up)
   =========================================================================== */

.lumina-toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", "BPG Mrgvlovani Caps", sans-serif;
  max-width: calc(100vw - 40px);
}

.lumina-toast {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04);
  padding: 14px;
  width: 360px;
  max-width: 100%;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  pointer-events: auto;
  cursor: pointer;
  animation: lumina-toast-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.lumina-toast.leaving {
  animation: lumina-toast-out 0.25s ease forwards;
}

@keyframes lumina-toast-in {
  from {
    opacity: 0;
    transform: translateX(120%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes lumina-toast-out {
  to {
    opacity: 0;
    transform: translateX(120%) scale(0.9);
  }
}

.lumina-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #1877f2;
  animation: lumina-toast-progress 8s linear forwards;
}
@keyframes lumina-toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

.lumina-toast-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  user-select: none;
}

.lumina-toast-body {
  flex: 1;
  min-width: 0;
}
.lumina-toast-title {
  font-size: 14px;
  font-weight: 700;
  color: #050505;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lumina-toast-title svg {
  width: 14px;
  height: 14px;
  fill: #1877f2;
  flex-shrink: 0;
}
.lumina-toast-text {
  font-size: 13px;
  color: #65676b;
  margin: 0;
  line-height: 1.3;
}

.lumina-toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #65676b;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.lumina-toast-close:hover { background: rgba(0,0,0,.06); }
