/* Global Styles */
body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2); 
}

/* Chat Container */
.chat-container {
  width: 100%;
  max-width: 400px;
  height: 100vh;
  max-height: 600px;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box; /* Ensure padding/border are included in height/width */
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid #e0e0e0;
  box-sizing: border-box;
}

/* Chat Box */
.chat-box {
  padding: 20px;
  background-color: #f9f9f9;
  flex: 1; /* Ensure it takes available space */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

/* Message */
.message {
  max-width: 75%;
  padding: 12px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  display: inline-block;
  cursor: pointer;
  position: relative;
  animation: fadeIn 0.4s ease-in-out;
}

.message:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Bot Message */
.bot-message {
  background-color: #667eea;
  color: white;
  align-self: flex-start;
  border-bottom-left-radius: 0;
  transition: color 0.3s ease; /* Smooth transition for color change */
}

.bot-message:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: black; /* Change text color to black on hover */
}

/* User Message */
.user-message {
  background-color: #f1f1f1;
  color: #333;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

/* Chat Input Area */
.chat-input {
  display: flex;
  padding: 15px;
  background-color: #f0f0f0;
  border-top: 1px solid #ddd;
  box-sizing: border-box;
}

/* Chat Input Adjustments */
.chat-input input {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 30px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input input:focus {
  border-color: #667eea;
}

.chat-input button {
  background-color: #667eea;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 50%;
  margin-left: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input button:hover {
  background-color: #764ba2;
}

/* Reply Preview */
.reply-preview {
  padding: 10px;
  background-color: #f1f1f1;
  border-left: 4px solid #667eea;
  margin-bottom: 10px;
  border-radius: 5px;
  font-size: 12px;
  color: #333;
  display: flex;
  justify-content: space-between;
}

.reply-preview button {
  background-color: transparent;
  border: none;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
  .chat-container {
    width: 100%;
    height: 77vh;
    margin-top: -70px;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: 0; /* Remove padding */
    box-shadow: none; /* Remove box-shadow if necessary */
  }

  .chat-header {
    font-size: 16px;
    padding: 10px; /* Reduce padding */
    border-bottom: none; /* Remove border */
  }

  .chat-box {
    padding: 10px; /* Reduce padding */
  }

  .chat-input {
    padding: 10px; /* Reduce padding */
    border-top: none; /* Remove border */
  }

  .chat-input input {
    font-size: 14px;
    padding: 10px;
  }

  .chat-input button {
    padding: 10px;
  }

  .message {
    max-width: 90%;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .chat-header {
    font-size: 14px;
    padding: 8px; /* Further reduce padding */
  }

  .chat-input input {
    font-size: 12px;
    padding: 8px;
  }

  .chat-input button {
    padding: 8px;
  }

  .message {
    max-width: 95%;
    font-size: 12px;
  }
}
