#chat-widget {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 350px;
  max-height: 600px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 9999;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

@media (max-width: 480px) {
  #chat-widget {
    width: 95%;
    left: 2.5%;
    bottom: 10px;
    max-height: 80vh;
  }

  #chat-widget-body {
    max-height: 60vh;
  }

  #chat-messages {
    height: calc(60vh - 60px);
  }
}

#chat-widget-header {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #4a90e2, #357ab8);
  color: #fff;
  padding: 15px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  user-select: none;
  justify-content: space-between;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: url('https://rotary-pig.com/wp-content/uploads/2023/05/spittingpiglogo-500-%C3%97-250-px-450-%C3%97-250-px-1.png.webp') no-repeat center center;
  background-size: cover;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.greeting {
  flex-grow: 1;
  margin-left: 10px;
  animation: pulse 2s infinite;
}

.close-button {
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.3s;
}

.close-button:hover {
  transform: rotate(90deg);
}

@keyframes pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

#chat-widget-body {
  display: none;
  padding: 15px;
  overflow-y: auto;
  background: #f9fafb;
  max-height: 500px;
}

#chat-messages {
  height: 380px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 5px;
}

.message {
  padding: 10px 15px;
  margin: 8px 0;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  animation: fadeIn 0.5s ease-in-out;
}

.user-message {
  background: #4a90e2;
  color: white;
  float: right;
  justify-content: flex-end;
}

.bot-message {
  background: #e0e7ff;
  color: #333;
  float: left;
  justify-content: flex-start;
}

.bot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
  background: url('https://rotary-pig.com/wp-content/uploads/2023/05/spittingpiglogo-500-%C3%97-250-px-450-%C3%97-250-px-1.png.webp') no-repeat center center;
  background-size: cover;
}

#chat-widget-input {
  width: calc(100% - 60px);
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#chat-widget-send {
  padding: 12px;
  background: linear-gradient(135deg, #4a90e2, #357ab8);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s;
  margin-left: 5px;
}

#chat-widget-send:hover {
  transform: scale(1.1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}