.chatbot-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,115,232,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  z-index: 2147483600;
  transition: background 0.2s ease;
  animation: chatbot-pulse 2.4s ease-in-out infinite;
}

.chatbot-bubble:hover {
  background: #1557b0;
  animation-play-state: paused;
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(26,115,232,0.6);
}

@keyframes chatbot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(26,115,232,0.45);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 8px 28px rgba(26,115,232,0.7);
  }
}

.chatbot-label {
  position: fixed;
  bottom: 46px;
  right: 114px;
  background: #fff;
  color: #1a1a1a;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  z-index: 2147483600;
  white-space: nowrap;
  animation: chatbot-label-in 0.4s ease-out 2s both;
}

.chatbot-label::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #fff;
  border-right: none;
}

@keyframes chatbot-label-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.chatbot-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 500px;
  min-width: 300px;
  min-height: 320px;
  max-width: 95vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  z-index: 2147483600;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: box-shadow 0.2s ease;
}

.chatbot-window.maximized {
  width: calc(100vw - 48px);
  height: calc(100vh - 48px);
  bottom: 24px;
  right: 24px;
  border-radius: 8px;
}

.chatbot-window.maximized .chatbot-resize {
  display: none;
}

.chatbot-resize {
  position: absolute;
  z-index: 10;
}

.chatbot-resize-n {
  top: 0;
  left: 12px;
  right: 12px;
  height: 6px;
  cursor: ns-resize;
}

.chatbot-resize-w {
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 6px;
  cursor: ew-resize;
}

.chatbot-resize-nw {
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 11;
}

.chatbot-window.open {
  display: flex;
}

.chatbot-header {
  background: #1a73e8;
  color: #fff;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  cursor: move;
  user-select: none;
}

.chatbot-window.maximized .chatbot-header {
  cursor: default;
}

.chatbot-header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-maximize,
.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.85;
}

.chatbot-maximize:hover,
.chatbot-close:hover {
  opacity: 1;
}

.chatbot-close {
  font-size: 20px;
}

.chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: #e3f2fd;
  color: #1a1a1a;
  border-bottom-right-radius: 4px;
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: #f5f5f5;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.bot p {
  margin: 0 0 8px 0;
}

.chatbot-msg.bot p:last-child {
  margin-bottom: 0;
}

.chatbot-msg.bot strong {
  font-weight: 600;
}

.chatbot-msg.bot table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  width: 100%;
}

.chatbot-msg.bot th,
.chatbot-msg.bot td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: left;
}

.chatbot-msg.bot th {
  background: #e8e8e8;
}

.chatbot-msg.bot code {
  background: #e8eaed;
  color: #1a1a1a;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12.5px;
  font-family: ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

.chatbot-code {
  position: relative;
  margin: 8px 0;
}

.chatbot-code pre {
  background: #1e1e1e;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 10px 12px;
  padding-right: 56px;
  overflow-x: auto;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.45;
  margin: 0;
}

.chatbot-msg.bot .chatbot-code pre code {
  background: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.chatbot-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfcfcf;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.chatbot-code:hover .chatbot-copy,
.chatbot-copy:focus {
  opacity: 1;
}

.chatbot-copy:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.chatbot-copy.copied {
  opacity: 1;
  background: #2e7d32;
  color: #fff;
  border-color: transparent;
}

.chatbot-typing {
  align-self: flex-start;
  background: #f5f5f5;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: #888;
}

.chatbot-input-area {
  display: flex;
  border-top: 1px solid #e0e0e0;
  padding: 10px;
  gap: 8px;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.chatbot-input:focus {
  border-color: #1a73e8;
}

.chatbot-send {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.chatbot-send:hover {
  background: #1557b0;
}

.chatbot-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 120px);
    right: 8px;
    bottom: 80px;
    border-radius: 8px;
  }
}
