/* ===== SSE NOTIFICATION BELL + PANEL ===== */

/* Bell button in header */
.sse-bell-wrapper {
  position: relative;
  margin-left: 10px;
}

#sse-bell-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  padding: 0;
}

#sse-bell-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#sse-bell-btn i.material-icons {
  font-size: 22px;
}

/* Unread badge */
#sse-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  padding: 0 5px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#sse-bell-badge.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== Notification Panel ===== */

#sse-notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 460px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#sse-notif-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Panel header */
.sse-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.sse-notif-header h6 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
}

#sse-notif-clear {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

#sse-notif-clear:hover {
  background: #eff6ff;
}

/* Notification list */
#sse-notif-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#sse-notif-list::-webkit-scrollbar {
  width: 5px;
}

#sse-notif-list::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* Individual items */
.sse-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
  cursor: default;
}

.sse-notif-item:last-child {
  border-bottom: none;
}

.sse-notif-item:hover {
  background: #fafafa;
}

.sse-notif-item.unread {
  background: #f0f7ff;
}

.sse-notif-item.unread:hover {
  background: #e8f1fc;
}

.sse-notif-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--notif-level-bg, linear-gradient(135deg, #3b82f6, #2563eb));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sse-notif-item.unread .sse-notif-item-icon {
  box-shadow: 0 2px 8px var(--notif-level-shadow, rgba(59, 130, 246, 0.35));
}

/* Level colors */
.sse-notif-item.level-info   { --notif-level-bg: linear-gradient(135deg, #3b82f6, #2563eb); --notif-level-shadow: rgba(59,130,246,0.35); }
.sse-notif-item.level-success  { --notif-level-bg: linear-gradient(135deg, #10b981, #059669); --notif-level-shadow: rgba(16,185,129,0.35); }
.sse-notif-item.level-warning  { --notif-level-bg: linear-gradient(135deg, #f59e0b, #d97706); --notif-level-shadow: rgba(245,158,11,0.35); }
.sse-notif-item.level-critical { --notif-level-bg: linear-gradient(135deg, #ef4444, #dc2626); --notif-level-shadow: rgba(239,68,68,0.35); }

.sse-notif-item-icon i.material-icons {
  font-size: 18px;
  color: white;
}

.sse-notif-item-body {
  flex: 1;
  min-width: 0;
}

.sse-notif-item-msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: #333;
  word-wrap: break-word;
}

.sse-notif-item.unread .sse-notif-item-msg {
  font-weight: 600;
  color: #1a1a1a;
}

.sse-notif-item-time {
  font-size: 12px;
  color: #999;
  margin-top: 3px;
  display: inline-block;
}

/* Empty state */
#sse-notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
}

#sse-notif-empty i.material-icons {
  font-size: 48px;
  opacity: 0.35;
  display: block;
  margin-bottom: 10px;
}

#sse-notif-empty p {
  margin: 0;
  font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  #sse-notif-panel {
    width: calc(100vw - 24px);
    right: -60px;
    max-height: 400px;
  }
}
