.chatbot-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(120deg, #155799, #159957);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
}

.chatbot-button:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 450px;
  height: 550px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.chatbot-container.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chatbot-container.enlarged {
  width: 600px;
  height: 700px;
}

.chatbot-header {
  background: linear-gradient(120deg, #155799, #159957);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.chatbot-header h3 i {
  margin-right: 10px;
  font-size: 20px;
}

.chatbot-controls {
  display: flex;
  gap: 10px;
}

.chatbot-toggle, .chatbot-fullscreen-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.9;
  transition: all 0.2s ease;
}

.chatbot-fullscreen-toggle {
  margin-right: 10px;
}

.chatbot-toggle:hover, .chatbot-fullscreen-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

.chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  align-items: flex-start;
  max-width: 80%;
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  line-height: 1.5;
}

.bot-message .message-content {
  background-color: #f8f9fa;
  border-radius: 12px;
  margin-left: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
  border-left: none;
}

.bot-message .message-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #155799, #159957);
  border-radius: 12px 12px 0 0;
  opacity: 0.6;
}

.message-content pre {
  background-color: #f6f8fa;
  padding: 16px;
  border-radius: 8px;
  border-left: none;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 0.9em;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

.message-content pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #155799, #159957);
  opacity: 0.5;
  border-radius: 8px 8px 0 0;
}

.user-message .message-content {
  background: linear-gradient(120deg, #155799, #159957);
  color: white;
  border-radius: 12px;
  margin-right: 10px;
}

.bot-icon, .user-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.bot-icon {
  background: linear-gradient(120deg, #155799, #159957);
  color: white;
}

.user-icon {
  background-color: #f0f0f0;
  color: #555;
}

.chatbot-input {
  padding: 15px;
  border-top: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #f9f9f9;
}

.chatbot-input textarea {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 12px 16px;
  resize: none;
  max-height: 100px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.chatbot-input textarea:focus {
  border-color: #159957;
  box-shadow: 0 1px 4px rgba(21, 153, 87, 0.2);
}

.send-btn {
  background: linear-gradient(120deg, #155799, #159957);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: none;
  color: white;
}

.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.message-content code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 3px 5px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #d14;
  white-space: pre-wrap;
  word-break: break-word;
}

  .message-content pre.code-block {
    background-color: #f6f8fa;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0;
    font-size: 0.9em;
    line-height: 1.5;
    border: 1px solid #e1e4e8;
    position: relative;
  }
  
  .message-content .code-header {
    background: #f1f1f1;
    padding: 6px 16px;
    font-family: sans-serif;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #e1e4e8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  .message-content pre.code-block::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #155799, #159957);
    opacity: 0.7;
  }
  
  .message-content pre.code-block code {
    background-color: transparent;
    padding: 16px;
    border-radius: 0;
    display: block;
    color: #24292e;
    white-space: pre;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
  }
  
  .message-content pre::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #155799, #159957);
    opacity: 0.7;
  }

.message-content pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
  color: #24292e;
  white-space: pre;
}

.message-content p {
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul, 
.message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content h1, 
.message-content h2, 
.message-content h3, 
.message-content h4 {
  margin: 16px 0 8px 0;
  color: #24292e;
}

.message-content a {
  color: #155799;
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

.message-content strong {
  font-weight: 600;
}

.message-content em {
  font-style: italic;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #159957;
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out both;
  opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.chatbot-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
  border-radius: 0 0 10px 0;
  z-index: 1001;
}

@media (max-width: 480px) {
  .chatbot-container {
    width: 90%;
    height: 70vh;
    bottom: 10px;
    right: 5%;
    left: 5%;
  }
  
  .chatbot-button {
    bottom: 10px;
    right: 10px;
  }
  
  .chatbot-container.enlarged {
    width: 90%;
    height: 80vh;
  }
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 0.9em;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-content th {
  background: linear-gradient(90deg, #155799, #159957);
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
}

.message-content td {
  padding: 8px 12px;
  border-bottom: 1px solid #e1e4e8;
}

.message-content tr:nth-child(even) {
  background-color: #f6f8fa;
}

.message-content tr:last-child td {
  border-bottom: none;
}

.message-content tr:hover {
  background-color: #f0f4f8;
}


.bot-icon::before,
.user-icon::before,
.chatbot-button::before,
.send-btn::before,
.chatbot-toggle::before,
.chatbot-fullscreen-toggle::before {
  font-family: 'FontAwesome', sans-serif;
  display: inline-block;
}

.bot-icon:empty::before {
  content: "🤖";
}

.user-icon:empty::before {
  content: "👤";
}

.chatbot-button:empty::before {
  content: "💬";
}

.send-btn:empty::before {
  content: "📤";
}

.chatbot-toggle:empty::before {
  content: "✖";
}

.chatbot-fullscreen-toggle:empty::before {
  content: "⤢";
}
