/* 未读消息标识样式 */
.unread-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #e74c3c;
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  padding: 0 4px;
  box-sizing: border-box;
  animation: pulse 1.5s infinite;
}

.customer-item.has-unread {
  background-color: #3a5169;
  border-left: 3px solid #e74c3c;
}

/* 增加新消息动画效果 */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* 客户列表项样式调整 */
.customer-item {
  position: relative;
  transition: background-color 0.3s, border-left 0.3s;
}

/* 应用内通知样式 */
.in-app-notification {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: #34495e;
  color: white;
  padding: 12px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 300px;
  display: none;
  animation: notification-slide-in 0.3s ease;
  border-left: 4px solid #3498db;
}

.in-app-notification-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

.in-app-notification-body {
  font-size: 13px;
  margin-bottom: 8px;
  word-break: break-word;
}

.in-app-notification-close {
  position: absolute;
  top: 5px;
  right: 5px;
  color: #bdc3c7;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

@keyframes notification-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes notification-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification-slide-out {
  animation: notification-slide-out 0.3s ease forwards;
}

/* 通知按钮样式 */
#requestNotificationPermission {
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

#requestNotificationPermission:hover {
  background-color: #2980b9;
}

/* 移动设备样式调整 */
@media (max-width: 768px) {
  .unread-badge {
    width: 18px;
    height: 18px;
    font-size: 10px;
    top: 6px;
    right: 6px;
  }

  .in-app-notification {
    top: auto;
    bottom: 70px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
}
