/* Chatbot Widget Styles */
#gm-chatbot-widget {
  position: fixed;
  bottom: 110px;
  right: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/**
 * =========================================================
 *  AI Chatbot Assistant Widget - Stylesheet
 *  Designed & Developed by Vision4Reality
 *  https://vision4reality.com
 * =========================================================
 */
#gm-chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #0056b3; /* GM Electronics Blue */
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  position: relative;
}

#gm-online-indicator {
  position: absolute;
  top: 0;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #4CAF50;
  border-radius: 50%;
  border: 2px solid white;
  animation: gm-pulse-green 2s infinite;
}

@keyframes gm-pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#gm-chatbot-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
}

#gm-chatbot-button svg {
  width: 36px !important;
  height: 36px !important;
  fill: white;
  transition: transform 0.3s ease;
}

#gm-chatbot-button.gm-open .gm-icon-open {
  display: none;
}

#gm-chatbot-button.gm-open .gm-icon-close {
  display: block !important;
  transform: rotate(90deg);
}

#gm-chatbot-button.gm-open #gm-online-indicator {
  display: none;
}

#gm-chatbot-window {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex-direction: column;
}

#gm-chatbot-window.gm-open {
  display: flex;
  animation: gm-slide-up 0.3s ease;
}

@keyframes gm-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#gm-chatbot-header {
  background-color: #0056b3;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gm-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-avatar {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gm-chatbot-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff !important;
}

#gm-chatbot-header span {
  font-size: 11px;
  opacity: 0.9;
  color: #ffffff !important;
}

#gm-chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: #f9f9f9;
}

.gm-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

#gm-chatbot-window .gm-message ul, 
#gm-chatbot-window .gm-message ol {
  margin-left: 0 !important;
  padding-left: 25px !important;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
  list-style-position: outside !important;
}

#gm-chatbot-window .gm-message li {
  margin-bottom: 4px !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.gm-message.gm-user {
  background-color: #e3f2fd;
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.gm-message.gm-bot {
  background-color: #ffffff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid #e0e0e0;
}

.gm-message.gm-loading {
  background-color: transparent;
  border: none;
  padding: 0;
}

.gm-dots {
  display: flex;
  gap: 4px;
  padding: 10px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  width: fit-content;
}

.gm-dot {
  width: 8px;
  height: 8px;
  background-color: #ccc;
  border-radius: 50%;
  animation: gm-bounce 1.4s infinite ease-in-out both;
}

.gm-dot:nth-child(1) { animation-delay: -0.32s; }
.gm-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes gm-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

#gm-chatbot-input-area {
  padding: 12px;
  background-color: #f0f2f5;
  border-top: 1px solid #ddd;
  display: flex;
  align-items: flex-end; /* Align to bottom so button stays down when textarea grows */
  gap: 8px;
  position: relative;
}

#gm-chatbot-input {
  flex: 1;
  padding: 12px 45px 12px 15px !important;
  border: 1px solid #ccc !important;
  border-radius: 24px !important;
  outline: none !important;
  font-size: 14px !important;
  font-family: inherit !important;
  background-color: white !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  min-height: 54px !important;
  max-height: 120px !important;
  height: 54px; /* default starting height */
  resize: none !important;
  overflow-y: auto !important;
  line-height: 1.5 !important;
}

#gm-chatbot-input:focus {
  border-color: #0056b3;
}

#gm-chatbot-send {
  position: absolute;
  right: 14px;
  bottom: 17px;
  background-color: #0056b3 !important;
  color: white !important;
  border: none !important;
  border-radius: 50% !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s, background-color 0.2s;
  box-shadow: none !important;
}

#gm-chatbot-send:hover {
  background-color: #004494;
  transform: scale(1.05);
}

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

#gm-chatbot-send svg {
  width: 18px !important;
  height: 18px !important;
  fill: #ffffff !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

#gm-chatbot-send svg path {
  fill: #ffffff !important;
}

/* Responsive for mobile */
@media (max-width: 480px) {
  #gm-chatbot-window {
    width: calc(100vw - 40px);
    height: 60vh;
  }
}
