/* チャットボットコンテナ */
#chatbot-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 768px〜1360pxでのチャットボット位置調整 */
@media (min-width: 769px) and (max-width: 1360px) {
  #chatbot-container {
    bottom: 140px;
    right: 20px;
  }
  
  .chatbot-window {
    bottom: 140px;
  }
}

/* チャットボットボタン */
.chatbot-button {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  color: white;
  z-index: 10000;
  position: relative;
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chatbot-button:active {
  transform: scale(0.95);
}

/* チャットボットウィンドウ */
.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* チャットボットヘッダー */
.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

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

.chatbot-clear {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.chatbot-clear:hover {
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 1;
  transform: scale(1.1);
}

.chatbot-clear:active {
  transform: scale(0.95);
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* メッセージエリア */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

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

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

/* メッセージスタイル */
.message {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 14px;
}

.message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  padding: 0 4px;
}

/* メッセージ提案ボタン */
.message-suggestion {
  margin-top: 8px;
  padding: 0 4px;
}

.suggestion-btn {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.suggestion-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.suggestion-btn:active {
  transform: translateY(0);
}

.suggestion-btn svg {
  width: 14px;
  height: 14px;
}

/* ユーザーメッセージ */
.user-message {
  align-items: flex-end;
}

.user-message .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 6px;
}

.user-message .message-time {
  text-align: right;
}

/* ボットメッセージ */
.bot-message {
  align-items: flex-start;
}

.bot-message .message-content {
  background: white;
  color: #333;
  border: 1px solid #e1e5e9;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bot-message .message-time {
  text-align: left;
}

/* 入力エリア */
.chatbot-input-container {
  padding: 15px 20px;
  background: white;
  border-radius: 0 0 15px 15px;
  border-top: 1px solid #e1e5e9;
  display: flex;
  align-items: center;
  gap: 10px;
}

#chatbot-input {
  flex: 1;
  border: 1px solid #e1e5e9;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

#chatbot-input:focus {
  border-color: #667eea;
}

#chatbot-input:disabled {
  background-color: #f8f9fa;
  color: #6c757d;
}

.chatbot-send {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-send:hover:not(:disabled) {
  transform: scale(1.1);
}

.chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ローディングスピナー */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* レスポンシブデザイン */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 40px);
    height: 60vh;
    bottom: 80px;
    right: 20px;
  }
  
  .chatbot-button {
    width: 50px;
    height: 50px;
  }
  
  .chatbot-button svg {
    width: 20px;
    height: 20px;
  }
  
  .chatbot-header-buttons {
    gap: 6px;
  }
  
  .chatbot-clear {
    width: 26px;
    height: 26px;
    padding: 5px;
  }
  
  .chatbot-clear svg {
    width: 14px;
    height: 14px;
  }
}

/* アニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  animation: fadeInUp 0.3s ease-out;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .chatbot-window {
    background: #2d3748;
    color: white;
  }
  
  .chatbot-messages {
    background: #1a202c;
  }
  
  .bot-message .message-content {
    background: #4a5568;
    color: white;
    border-color: #2d3748;
  }
  
  #chatbot-input {
    background: #4a5568;
    color: white;
    border-color: #2d3748;
  }
  
  #chatbot-input:focus {
    border-color: #667eea;
  }
  
  #chatbot-input:disabled {
    background-color: #2d3748;
    color: #a0aec0;
  }
  
  .chatbot-clear:hover {
    background-color: rgba(255, 255, 255, 0.15);
  }
} 