/* webchat-agentkit — estilos del widget de chat */

#tgs-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0b6b3a;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  font-size: 28px;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

#tgs-chat-launcher:hover {
  transform: scale(1.06);
}

#tgs-chat-bubble {
  position: fixed;
  bottom: 34px;
  right: 96px;
  max-width: 220px;
  background: #fff;
  color: #1a1a1a;
  padding: 10px 30px 10px 14px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  z-index: 999997;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#tgs-chat-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#tgs-chat-bubble::after {
  content: "";
  position: absolute;
  bottom: 14px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px -2px 3px rgba(0, 0, 0, 0.04);
}

#tgs-chat-bubble-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: #999;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

#tgs-chat-bubble-close:hover {
  color: #333;
}

@media (max-width: 480px) {
  #tgs-chat-bubble {
    right: 90px;
    max-width: 170px;
  }
}

#tgs-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#tgs-chat-window.open {
  display: flex;
}

#tgs-chat-header {
  background: #0b6b3a;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#tgs-chat-header .title {
  font-weight: 600;
  font-size: 15px;
}

#tgs-chat-header .subtitle {
  font-size: 12px;
  opacity: 0.85;
}

#tgs-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

#tgs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f5f7f6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tgs-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tgs-msg a {
  color: inherit;
  text-decoration: underline;
}

.tgs-msg.user {
  align-self: flex-end;
  background: #0b6b3a;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.tgs-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e2e5e3;
  border-bottom-left-radius: 3px;
}

.tgs-msg.typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e5e3;
  color: #888;
  font-style: italic;
}

#tgs-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e5e3;
  background: #fff;
}

#tgs-chat-input {
  flex: 1;
  border: 1px solid #d7dbd8;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
}

#tgs-chat-input:focus {
  border-color: #0b6b3a;
}

#tgs-chat-send {
  background: #0b6b3a;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}

#tgs-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}
