/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

/* Global Color Variables */
:root {
  --primary-blue: #0056b3;
  --secondary-blue: #007aff;
  --background-light: #fafafa;
  --text-dark: #333;
  --text-light: #aaa;
  --gradient-blue-start: #0056b3;
  --gradient-blue-end: #007aff;
  --gradient-green-start: #4caf50;
  --gradient-green-end: #6fd37d;
  --gradient-red-start: #c73232;
  --gradient-red-end: #b43d3d;
}

/* Body and Background Styles */
body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: url('assests/bg.jpg') no-repeat center center;
  background-size: cover;
}

/* Dark Overlay for Background Contrast */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* Chat Container Styles */
#chat-container {
  width: 100%;
  max-width: 800px;
  height: 90vh;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

/* Status Bar Styles */
#status {
  text-align: center;
  font-size: 18px;
  color: #444;
  padding: 10px;
  font-weight: bold;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Messages Container Styles */
#messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  background: var(--background-light);
}

/* Message Base Styles */
.message {
  position: relative;
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 10px;
  margin: 8px 0;
  font-size: 16px;
  word-wrap: break-word;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Sent Message Styles */
.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gradient-blue-start), var(--gradient-blue-end));
  color: white;
  border-radius: 10px 10px 0 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.sent:hover {
  transform: scale(1.02);
}

/* Received Message Styles */
.received {
  align-self: flex-start;
  background: #e3e6ed;
  color: var(--text-dark);
  border-radius: 10px 10px 10px 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Replied Message Styles */
.replied-message {
  background: rgba(240, 240, 255, 0.8);
  color: #555;
  border-left: 4px solid var(--primary-blue);
  padding: 10px;
  margin-bottom: 8px;
  font-size: 15px;
  border-radius: 8px;
}

/* Reply Icon Styles */
.reply-icon {
  font-size: 18px;
  color: var(--primary-blue);
  cursor: pointer;
  margin-top: 5px;
}

.reply-icon:hover {
  color: #003d80;
}

/* Input Container Styles */
#input-container {
  display: flex;
  padding: 15px;
  border-top: 1px solid #ddd;
  justify-content: space-between;
}

/* Message Input Styles */
#message-input {
  width: 75%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  background: #ffffff;
  color: var(--text-dark);
}

#message-input::placeholder {
  color: var(--text-light);
}

#message-input:focus {
  outline: none;
  border-color: var(--secondary-blue);
}

/* Send Button Styles */
#send-button {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--gradient-green-start), var(--gradient-green-end));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#send-button:hover {
  background: linear-gradient(135deg, #3d9140, #5bbf6d);
}

#next-button {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--gradient-red-start), var(--gradient-red-end));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#next-button:hover {
  background: linear-gradient(135deg, #bd4848, #d15252);
}

/* Scrollbar Styles */
#messages::-webkit-scrollbar {
  width: 8px;
}

#messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Responsive Mobile Styles */
@media (max-width: 768px) {
  #chat-container {
    height: 100vh;
    border-radius: 0;
  }

  #messages {
    padding-bottom: 80px;
  }

  #input-container {
    padding: 10px;
  }

  #message-input,
  .message {
    font-size: 15px;
  }
}
