/* Plus AI Chatbot Widget Styles */
/* Scoped via distinct ID #chatbot-plus-ai if needed, but here reusing #chatbot-container structure with new colors */

#chatbot-container {
  position: fixed;
  bottom: 155px; /* BackToTop(90px)の上に配置 */
  right: 20px; /* Positioned to the right of content */
  z-index: 2000;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN',
    'Hiragino Sans', Meiryo, sans-serif;
}

#chatbot-container * {
  box-sizing: border-box;
}

/* Toggle Button */
#chatbot-container .chatbot-toggle {
  width: 60px;
  height: 60px;
  /* Plus AI Dark Blue Gradient */
  background: linear-gradient(135deg, #0a36b0 0%, #2a5fd8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(10, 54, 176, 0.4);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 0;
}

#chatbot-container .chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(13, 202, 240, 0.6);
}

#chatbot-container .chatbot-toggle svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* Chat Window */
#chatbot-container .chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

#chatbot-container .chatbot-window.open {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
#chatbot-container .chatbot-header {
  /* Plus AI Gradient */
  background: linear-gradient(135deg, #0a36b0 0%, #2a5fd8 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#chatbot-container .chatbot-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

#chatbot-container .chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#chatbot-container .chatbot-close:hover {
  opacity: 1;
}

/* Messages Area */
#chatbot-container .chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#chatbot-container .message {
  display: flex;
  max-width: 100%;
}

#chatbot-container .message.user {
  justify-content: flex-end;
}

#chatbot-container .message.bot {
  justify-content: flex-start;
}

#chatbot-container .message-content {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#chatbot-container .message.user .message-content {
  /* Plus AI Gradient for User */
  background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

#chatbot-container .message.bot .message-content {
  background: white;
  color: #333;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
#chatbot-container .typing-indicator {
  display: flex;
  justify-content: flex-start;
}

#chatbot-container .typing-indicator .message-content {
  background: white;
  color: #666;
  border: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

#chatbot-container .typing-dot {
  width: 6px;
  height: 6px;
  background: #adb5bd;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

#chatbot-container .typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
#chatbot-container .typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Input Area */
#chatbot-container .chatbot-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

#chatbot-container .chatbot-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #ced4da;
  border-radius: 24px;
  background: #f8f9fa;
  color: #333;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

#chatbot-container .chatbot-input:focus {
  border-color: #0dcaf0;
  background: white;
}

#chatbot-container .chatbot-input::placeholder {
  color: #adb5bd;
}

#chatbot-container .chatbot-send {
  background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
  color: white;
  border: none;
  padding: 0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(13, 202, 240, 0.3);
}

#chatbot-container .chatbot-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 202, 240, 0.4);
}

#chatbot-container .chatbot-send:disabled {
  background: #e9ecef;
  color: #adb5bd;
  cursor: not-allowed;
  box-shadow: none;
}

#chatbot-container .chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  margin-left: 2px; /* Visual balance */
}

/* Responsive */
@media (max-width: 480px) {
  #chatbot-container .chatbot-window {
    width: 300px;
    height: 80vh; /* Taller on mobile */
    bottom: 70px;
    right: -10px; /* Slight offset */
  }
}
