/* ═══════════════════════════════════════════════════
   Skritka – Notifications
   Badges, panel, toasts
   ═══════════════════════════════════════════════════ */

/* ─── Unread Badge (shared: home icon, DM items, bell) ─── */

.unread-badge,
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  pointer-events: none;
}

/* Parent elements need position relative for badge positioning */
.server-icon,
.dm-item {
  position: relative;
}

/* ─── Notification Bell Icon ─── */

.notif-icon-btn {
  position: relative;
}

.server-icon.notif-icon {
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  width: 40px;
  height: 40px;
}

.server-icon.notif-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: none;
  border-radius: 50%;
}

.server-icon.notif-icon .material-symbols-outlined {
  font-size: 22px;
}

/* ─── Notification Panel ─── */

.notif-panel {
  position: fixed;
  top: 56px;
  left: var(--server-bar-width);
  width: 360px;
  max-height: 520px;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.notif-panel-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.notif-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
}

.notif-clear:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.notif-clear .material-symbols-outlined {
  font-size: 18px;
}

/* ─── Tabs ─── */

.notif-tabs {
  display: flex;
  padding: 0 12px;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.notif-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.notif-tab:hover {
  color: var(--text-secondary);
}

.notif-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Notification List ─── */

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}

.notif-item:hover {
  background: var(--bg-hover);
}

.notif-item.unread {
  border-left-color: var(--accent);
  background: rgba(16, 185, 129, 0.04);
}

.notif-item .notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item .notif-icon .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
}

.notif-item .notif-icon .notif-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.notif-item .notif-icon .notif-avatar-letter {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Friend Request Action Buttons ─── */

.notif-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.notif-action-btn {
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.notif-action-btn.accept {
  background: var(--accent);
  color: #fff;
}

.notif-action-btn.accept:hover {
  background: var(--accent-hover);
}

.notif-action-btn.decline {
  background: var(--bg-lighter);
  color: var(--text-secondary);
}

.notif-action-btn.decline:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ─── Toast Notifications ─── */

.notif-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateY(16px) translateX(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.notif-toast.show {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

.notif-toast strong {
  font-size: 13px;
  color: var(--text-primary);
  display: block;
}

.notif-toast span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Stack multiple toasts */
.notif-toast:nth-last-of-type(2) {
  bottom: 88px;
}

.notif-toast:nth-last-of-type(3) {
  bottom: 152px;
}

/* ─── Settings warning banner ─── */
.settings-notif-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(250, 166, 26, 0.1);
  border: 1px solid rgba(250, 166, 26, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #faa61a;
}

.settings-notif-warning .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .notif-panel {
    left: 56px;
    width: 300px;
  }
}

@media (max-width: 600px) {
  .notif-panel {
    left: 0;
    right: 0;
    width: 100%;
    top: 0;
    max-height: 100vh;
    border-radius: 0;
  }
}
