/* WATranslate v4.6 — New message alerts */

.notification-toast-region {
  position: fixed;
  z-index: 5000;
  top: 16px;
  right: 16px;
  display: grid;
  width: min(370px, calc(100vw - 32px));
  gap: 9px;
  pointer-events: none;
}

.new-message-toast {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: #202c33;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
  color: #e9edef;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  animation: wat-notification-in .18s ease-out both;
}

.new-message-toast.leaving {
  animation: wat-notification-out .18s ease-in both;
}

.new-message-toast-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 11px;
}

.new-message-toast-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.new-message-toast-copy strong {
  overflow: hidden;
  color: #e9edef;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-message-toast-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: #aebac1;
  font-size: 12.5px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.new-message-toast-close {
  align-self: start;
  color: #8696a0;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.contact-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.contact-name-line .contact-name {
  min-width: 0;
  flex: 1;
}

.contact-unread-badge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #25d366;
  color: #0b141a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-settings-section {
  display: grid;
  gap: 13px;
  margin-top: 1px;
  padding: 16px 0 2px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.notification-settings-section h3 {
  margin: 0;
  color: #e9edef;
  font-size: 15px;
}

.notification-settings-help {
  margin: -4px 0 0;
  color: #9fb0b8;
  font-size: 12px;
  line-height: 1.4;
}

.notification-setting-row,
.notification-sound-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.notification-setting-copy,
.notification-sound-row > span {
  display: grid;
  gap: 3px;
}

.notification-setting-copy strong,
.notification-sound-row strong {
  color: #e9edef;
  font-size: 13px;
}

.notification-setting-copy small,
.notification-sound-row small {
  color: #8696a0;
  font-size: 11.5px;
  line-height: 1.35;
}

.notification-permission-button {
  min-width: 150px;
}

.notification-sound-row {
  cursor: pointer;
}

.notification-sound-row input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: #00a884;
}

.notification-test-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-permission-status {
  min-width: 0;
  color: #9fb0b8;
  font-size: 11.5px;
  line-height: 1.35;
}

.notification-permission-status.success {
  color: #74d7b7;
}

.notification-permission-status.error {
  color: #ff9696;
}

.notification-permission-status.muted {
  color: #8696a0;
}

@keyframes wat-notification-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wat-notification-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-7px);
  }
}

@media (max-width: 760px) {
  .notification-toast-region {
    top: calc(env(safe-area-inset-top) + 8px);
    right: 8px;
    left: 8px;
    width: auto;
  }

  .new-message-toast {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    padding: 10px;
    border-radius: 11px;
  }

  .new-message-toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .notification-setting-row,
  .notification-sound-row {
    grid-template-columns: 1fr;
  }

  .notification-permission-button {
    width: 100%;
  }

  .notification-sound-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .notification-test-row {
    align-items: stretch;
    flex-direction: column;
  }
}
