/* Draft alerts: header bell, its panel, the alerts page and the "notify users" picker. */

/* The bell sits at the end of the fixed page header (left in Arabic), on every page. */
.header-bell {
  position: fixed;
  top: 0;
  inset-inline-end: 16px;
  z-index: 1001; /* above .header */
  height: var(--header-hieght);
  display: flex;
  align-items: center;
}

@media (min-width: 950px) {
  .header-bell {
    inset-inline-end: 56px; /* same inset as .container */
  }
}

/* Page headers leave room for the bell so their buttons never sit under it. */
body.has-header-bell .header .inner-header {
  padding-inline-end: 52px;
}

.notification-bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #fff;
  color: #354359;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.notification-bell-btn i {
  font-size: 20px;
}

.notification-bell-btn:hover,
.notification-bell-btn[aria-expanded="true"] {
  background-color: #f3f4f6;
}

.notification-bell-btn.selected {
  color: #307600;
  border-color: #b9ef93;
  background-color: #D4FFB7;
}

.notification-bell-btn:focus-visible {
  outline: 2px solid #2f7d46;
  outline-offset: 2px;
}

.notification-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background-color: var(--danger-color);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.notification-panel {
  position: fixed;
  z-index: 1080;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  overflow: hidden;
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f2;
  font-size: 13px;
}

.notification-link-btn {
  padding: 0;
  border: none;
  background: none;
  color: #24888e;
  font-size: 11px;
  cursor: pointer;
}

.notification-link-btn:hover {
  text-decoration: underline;
}

.notification-panel-list,
.notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification-panel-list {
  overflow-y: auto;
}

.notification-panel-empty {
  padding: 24px 14px;
  color: var(--secondary-text-color);
  text-align: center;
}

.notification-panel-footer {
  display: block;
  padding: 10px 14px;
  border-top: 1px solid #eef0f2;
  color: #24888e;
  text-align: center;
  text-decoration: none;
}

.notification-panel-footer:hover {
  background-color: #f9fafb;
}

.notification-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #2C2C2C;
  text-decoration: none;
}

.notification-item:hover {
  background-color: #f9fafb;
  color: #2C2C2C;
}

.notification-item.is-unread {
  background-color: var(--light-bg-color);
}

.notification-item.is-unread:hover {
  background-color: var(--darker-bg-color);
}

.notification-item-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #fff7d6;
  color: #9a6b00;
  font-size: 16px;
}

.notification-item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notification-item-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.notification-item-title bdi {
  font-weight: 500;
}

.notification-item-meta {
  color: var(--secondary-text-color);
  font-size: 11px;
}

.notification-item-note {
  color: #4b5563;
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item-state {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 50px;
  font-size: 10px;
  background-color: #FFD12F;
  color: #333;
}

.notification-item-state.is-posted {
  background-color: #2FE441;
  color: #fff;
}

/* Alerts page */
.notifications-page {
  max-width: 860px;
}

.notifications-page .notification-list {
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  overflow: hidden;
}

.notifications-page .notification-item {
  padding: 14px 18px;
  font-size: 13px;
}

.notifications-page .notification-item-meta {
  font-size: 12px;
}

.notifications-page .notification-item-note {
  -webkit-line-clamp: unset;
  display: block;
}

.notifications-empty {
  padding: 48px 16px;
  color: var(--secondary-text-color);
  text-align: center;
}

.notifications-empty i {
  display: block;
  margin-bottom: 8px;
  font-size: 32px;
}

.notifications-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

/* "Notify users" picker on draft documents */
.draft-notify-btn {
  position: relative;
}

.draft-notify-btn .draft-notify-count {
  margin-inline-start: 4px;
  padding: 0 6px;
  border-radius: 9px;
  background-color: #24888e;
  color: #fff;
  font-size: 10px;
}

.draft-notify-auto {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 50px;
  background-color: var(--light-bg-color);
  color: #24888e;
  font-size: 11px;
  white-space: nowrap;
}

.draft-notify-help {
  margin: 0 0 12px;
  color: var(--secondary-text-color);
  font-size: 12px;
}

.draft-notify-note {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}
