/* ===== Notification Center V2 ===== */

/* --- Keep existing base styles --- */
.notif-center { position: relative; }
.notif-center__bell {
  background: none; border: none;
  color: var(--ag-color-text-body); font-size: 1.25rem;
  padding: var(--ag-space-2); cursor: pointer;
  border-radius: var(--ag-radius-full); position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.notif-center__bell:hover { background: var(--ag-color-bg-surface-alt); }
.notif-center__badge, .shell__topbar-btn__badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--ag-color-error);
  color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center;
}
.notif-center__panel {
  position: absolute; top: calc(100% + var(--ag-space-2)); right: 0;
  width: 380px; max-width: calc(100vw - 32px); max-height: 480px;
  background: var(--ag-color-bg-surface);
  border: 1px solid var(--ag-color-border);
  border-radius: var(--ag-radius-lg);
  box-shadow: var(--ag-shadow-lg); z-index: 1050;
  display: flex; flex-direction: column; overflow: hidden;
}
.notif-center__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--ag-space-3) var(--ag-space-4);
  border-bottom: 1px solid var(--ag-color-border);
}
.notif-center__title { margin: 0; font-size: var(--ag-font-size-md); font-weight: 600; color: var(--ag-color-text-heading); }
.notif-center__mark-all {
  background: none; border: none; color: var(--ag-color-brand-primary);
  font-size: var(--ag-font-size-sm); cursor: pointer; padding: 0;
}
.notif-center__mark-all:hover { text-decoration: underline; }
.notif-center__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.notif-center__empty {
  padding: var(--ag-space-4); text-align: center;
  color: var(--ag-color-text-muted); font-size: var(--ag-font-size-sm);
}
.notif-center__see-all {
  display: block; text-align: center; padding: var(--ag-space-3);
  font-size: var(--ag-font-size-sm); color: var(--ag-color-brand-primary);
  text-decoration: none; border-top: 1px solid var(--ag-color-border);
}
.notif-center__see-all:hover { background: var(--ag-color-bg-surface-alt); }

/* --- Tabs --- */
.notif-tabs {
  display: flex; border-bottom: 2px solid var(--ag-color-border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}
.notif-tabs::-webkit-scrollbar { display: none; }
.notif-tabs::after {
  content: "";
  position: sticky;
  right: 0;
  flex-shrink: 0;
  width: 24px;
  background: linear-gradient(to right, transparent, var(--ag-color-bg-surface, #fff));
  pointer-events: none;
}
.notif-tabs__tab {
  flex: none; padding: var(--ag-space-2) var(--ag-space-3);
  font-size: var(--ag-font-size-xs); color: var(--ag-color-text-muted);
  cursor: pointer; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; position: relative;
  transition: color 0.15s, border-color 0.15s;
}
.notif-tabs__tab:hover { color: var(--ag-color-text-heading); }
.notif-tabs__tab--active {
  color: var(--ag-color-brand-primary); font-weight: 600;
  border-bottom-color: var(--ag-color-brand-primary);
}
.notif-tabs__tab--partner { color: #059669; }
.notif-tabs__tab--partner.notif-tabs__tab--active { border-bottom-color: #059669; }
.notif-tabs__dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--ag-color-error);
  margin-left: 4px; vertical-align: top;
}
.notif-tabs__overflow {
  flex: none; padding: var(--ag-space-2) var(--ag-space-3);
  font-size: 16px; color: var(--ag-color-text-muted);
  cursor: pointer; background: none; border: none;
  margin-bottom: -2px;
}

/* --- Overflow Menu --- */
.notif-overflow {
  position: absolute; right: 0; top: 100%;
  background: var(--ag-color-bg-surface);
  border: 1px solid var(--ag-color-border);
  border-radius: var(--ag-radius-md);
  box-shadow: var(--ag-shadow-lg); z-index: 1060;
  min-width: 200px; display: none;
}
.notif-overflow--open { display: block; }
.notif-overflow__item {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--ag-space-2) var(--ag-space-3);
  font-size: var(--ag-font-size-sm); color: var(--ag-color-text-body);
  cursor: pointer; text-decoration: none; border: none; background: none; width: 100%;
  text-align: left;
}
.notif-overflow__item:hover { background: var(--ag-color-bg-surface-alt); }

/* --- Notification Items (grouped) --- */
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--ag-color-border);
  cursor: pointer; transition: background 0.1s;
  text-decoration: none; color: inherit;
}
.notif-item:hover { background: var(--ag-color-bg-surface-alt); }
.notif-item--unread { background: #eef3ff; }
.notif-item--unread:hover { background: #e0ebff; }

/* Urgency borders */
.notif-item--success { border-left: 3px solid #059669; background: #f0fdf4; }
.notif-item--urgent { border-left: 3px solid var(--ag-color-error); background: #fef2f2; }
.notif-item--warning { border-left: 3px solid #f59e0b; background: #fff7ed; }

/* Avatar */
.notif-item__avatar {
  position: relative; flex-shrink: 0; width: 44px; height: 44px;
}
.notif-item__avatar-img {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: var(--ag-color-bg-surface-alt);
}
.notif-item__avatar-fallback {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.notif-item__badge-overlay {
  position: absolute; bottom: -2px; right: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Content */
.notif-item__content { flex: 1; min-width: 0; }
.notif-item__text {
  font-size: 13px; line-height: 1.4; color: var(--ag-color-text-heading);
}
.notif-item__text strong { font-weight: 600; }
.notif-item__meta {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.notif-item__reactions { font-size: 15px; }
.notif-item__time { font-size: 11px; color: var(--ag-color-text-muted); }
.notif-item__partner-badge {
  display: inline-block; font-size: 9px; padding: 2px 6px;
  background: #059669; color: #fff; border-radius: 8px;
  font-weight: 600; margin-left: 4px;
}

/* Thumbnail */
.notif-item__thumbnail {
  width: 44px; height: 44px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
  background: var(--ag-color-bg-surface-alt);
}

/* Action buttons (security, subscription) */
.notif-item__actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.notif-item__action {
  padding: 4px 12px; border-radius: 6px;
  font-size: 11px; cursor: pointer; border: 1px solid var(--ag-color-border);
  background: var(--ag-color-bg-surface);
}
.notif-item__action--danger {
  background: var(--ag-color-error); color: #fff; border: none;
}

/* Responsive */
@media (max-width: 575.98px) {
  .notif-center__panel {
    position: fixed;
    top: var(--ag-header-height, 56px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 0 0 12px 12px;
    border-top: none;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
  .notif-center__header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .notif-tabs {
    padding-inline: 4px;
  }
  .notif-tabs__tab {
    padding: 10px 14px;
    min-height: 44px;
  }
}
