/* ================================================
   NOTIFICATION BELL BUTTON
   ================================================ */

/* Container on dashboard — sits inline between logo and ⋮ menu */
#notificationBellContainer {
  display: flex;
  align-items: center;
}

/* Container on projects page — fixed top-right corner */
.projects-bell-container {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 900;
}

.notif-bell-btn {
  position: relative;
  background: rgba(90, 24, 154, 0.1);
  border: 1px solid rgba(90, 24, 154, 0.2);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #5a189a);
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(90, 24, 154, 0.1);
}

.notif-bell-btn:hover {
  background: rgba(90, 24, 154, 0.18);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(90, 24, 154, 0.18);
}

body.dark .notif-bell-btn {
  background: rgba(255, 214, 10, 0.1);
  border-color: rgba(255, 214, 10, 0.2);
  color: var(--color-secondary, #ffd60a);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .notif-bell-btn:hover {
  background: rgba(255, 214, 10, 0.18);
  box-shadow: 0 4px 14px rgba(255, 214, 10, 0.15);
}

.notif-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
  border: 2px solid var(--bg-body, #f4f7f9);
  animation: badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ================================================
   OVERLAY
   ================================================ */
.notif-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1099;
  background: transparent;
}

.notif-overlay.open { display: block; }

/* ================================================
   SLIDE-IN PANEL
   ================================================ */
.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100dvh;
  background: var(--bg-glass-panel, #fff);
  border-left: 1px solid var(--border-color, #e0e0e0);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Poppins', system-ui, sans-serif;
}

.notif-panel.open {
  transform: translateX(0);
}

/* ── Header ── */
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #333);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-panel-title i {
  color: var(--color-primary, #5a189a);
  font-size: 1rem;
}

body.dark .notif-panel-title i { color: var(--color-secondary, #ffd60a); }

.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-mark-all-btn {
  background: none;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary, #5a189a);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
  font-family: inherit;
}

.notif-mark-all-btn:hover {
  background: rgba(90, 24, 154, 0.06);
}

body.dark .notif-mark-all-btn {
  color: var(--color-secondary, #ffd60a);
  border-color: var(--border-color, #3c096c);
}

.notif-close-btn {
  background: rgba(90, 24, 154, 0.08);
  border: 1px solid rgba(90, 24, 154, 0.18);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #5a189a);
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  flex-shrink: 0;
}

.notif-close-btn:hover {
  background: rgba(90, 24, 154, 0.16);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(90, 24, 154, 0.15);
}

body.dark .notif-close-btn {
  background: rgba(255, 214, 10, 0.1);
  border-color: rgba(255, 214, 10, 0.2);
  color: var(--color-secondary, #ffd60a);
}

body.dark .notif-close-btn:hover {
  background: rgba(255, 214, 10, 0.18);
  box-shadow: 0 2px 8px rgba(255, 214, 10, 0.12);
}

/* ── List ── */
.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* ── Empty state ── */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--color-soft-gray, #6b7280);
  text-align: center;
}

.notif-empty i {
  font-size: 2.5rem;
  opacity: 0.35;
}

.notif-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* ── Notification item ── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  transition: background 0.15s, opacity 0.25s, transform 0.25s;
  cursor: pointer;
  position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: rgba(0, 0, 0, 0.025); }
body.dark .notif-item:hover { background: rgba(255, 255, 255, 0.03); }

.notif-item--unread {
  background: rgba(90, 24, 154, 0.04);
}

body.dark .notif-item--unread {
  background: rgba(255, 214, 10, 0.04);
}

.notif-item--unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary, #5a189a);
  border-radius: 0 2px 2px 0;
}

body.dark .notif-item--unread::before {
  background: var(--color-secondary, #ffd60a);
}

.notif-item--removing {
  opacity: 0;
  transform: translateX(20px);
}

/* ── Item icon ── */
.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: rgba(90, 24, 154, 0.1);
  color: var(--color-primary, #5a189a);
}

.notif-icon--collab_invite {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.notif-icon--collab_removed {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.notif-icon--project_update {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.notif-icon--system {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

body.dark .notif-item-icon {
  background: rgba(255, 214, 10, 0.1);
  color: var(--color-secondary, #ffd60a);
}

/* ── Item body ── */
.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  margin: 0 0 3px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #333);
  line-height: 1.4;
}

.notif-item-text {
  margin: 0 0 5px;
  font-size: 0.8rem;
  color: var(--color-soft-gray, #6b7280);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-time {
  font-size: 0.72rem;
  color: var(--color-soft-gray, #6b7280);
  opacity: 0.8;
}

/* ── Item action buttons ── */
.notif-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.notif-item:hover .notif-item-actions { opacity: 1; }

.notif-read-btn,
.notif-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--color-soft-gray, #6b7280);
  transition: background 0.15s, color 0.15s;
}

.notif-read-btn:hover {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.notif-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* ================================================
   MOBILE
   ================================================ */
@media (max-width: 480px) {
  .notif-panel {
    width: 100vw;
    border-left: none;
  }
}
