/* Chatbot Widget Styles - Optimized for TLCS Design System */
.chatbot-widget {
  position: fixed;
  bottom: 25px;
  left: 25px; /* 左下に配置して右下のreCAPTCHAバッジとの干渉を回避 */
  z-index: 1000;
  font-family: 'Manrope', 'Noto Sans JP', sans-serif;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  /* プレミアムグラデーション配色 */
  background: linear-gradient(135deg, #0d7ff2 0%, #4da3f5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* 浮き上がるようなプレミアムな影 */
  box-shadow: 0 10px 25px -5px rgba(13, 127, 242, 0.4), 0 8px 16px -6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chatbot-toggle:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px -5px rgba(13, 127, 242, 0.5), 0 10px 20px -6px rgba(0, 0, 0, 0.15);
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  left: 0; /* 左端に揃える */
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 1.25rem; /* よりモダンな丸み */
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 10px 20px -10px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.chatbot-header {
  background: linear-gradient(135deg, #0d7ff2 0%, #4da3f5 100%);
  color: white;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.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 ease;
}

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

.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8fafc;
}

.message {
  margin-bottom: 16px;
  display: flex;
}

.user-message {
  justify-content: flex-end;
}

.bot-message {
  justify-content: flex-start;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 1.25rem;
  font-size: 13.5px;
  line-height: 1.5;
}

.user-message .message-content {
  background: #0d7ff2; /* ユーザーメッセージはTLCSプライマリカラー */
  color: white;
  border-bottom-right-radius: 4px; /* 会話吹き出し風のディテール */
}

.bot-message .message-content {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px; /* 会話吹き出し風のディテール */
}

.chatbot-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
}

.chatbot-input-area input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chatbot-input-area input:focus {
  border-color: #0d7ff2;
}

.chatbot-input-area button {
  background: #0d7ff2;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chatbot-input-area button:hover {
  background: #0a62bd;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
  .chatbot-window {
    width: 300px;
    height: 450px;
  }
  
  .chatbot-widget {
    bottom: 15px;
    left: 15px; /* モバイル環境でも左側に収める */
  }
  
  .chatbot-toggle {
    width: 52px;
    height: 52px;
  }
}

/* スクロールバーのスタイル */
.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Tooltip Speech Bubble Styles */
.chatbot-tooltip {
  position: absolute;
  bottom: 75px;
  left: 5px;
  background: #1e293b; /* シックなダークグレー */
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  letter-spacing: 0.02em;
}

/* Tooltip Arrow (しっぽ) */
.chatbot-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 20px; /* 左側に寄せる（起動ボタンの真上あたりに合わせる） */
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

/* Hover effect */
.chatbot-toggle:hover .chatbot-tooltip {
  opacity: 1;
  transform: translateY(0);
}
