/* チャットウィジェット - スマホ対応版 */

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

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-button-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* チャットウィンドウ - デスクトップ */
.chat-window {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 40px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
}

/* スマホ対応 - 全画面表示 */
@media (max-width: 768px) {
  .chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  
  .chat-button {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

/* ヘッダー */
.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-content {
  flex: 1;
}

.chat-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.chat-status {
  font-size: 13px;
  opacity: 0.9;
}

/* ヘッダーボタン */
.chat-refresh,
.chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.chat-refresh:hover,
.chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.chat-refresh:active,
.chat-close:active {
  transform: scale(0.95);
}

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

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

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

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

/* メッセージ */
.chat-message {
  display: flex;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.6;
  word-wrap: break-word;
}

.bot-message .message-content {
  background: white;
  color: #2d3748;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

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

/* タイピングインジケーター */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e0;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* クイック返信 - 縦並び（最初） */
.quick-replies-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* クイック返信 - 横スライド（2回目以降） */
.quick-replies-horizontal {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.quick-replies-horizontal::-webkit-scrollbar {
  height: 4px;
}

.quick-replies-horizontal::-webkit-scrollbar-track {
  background: #f7fafc;
}

.quick-replies-horizontal::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 2px;
}

.quick-replies-label {
  font-size: 13px;
  color: #718096;
  font-weight: 500;
  margin-bottom: 4px;
}

/* 縦並びボタン */
.quick-reply-button {
  background: white;
  border: 1.5px solid #667eea;
  color: #667eea;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  text-align: left;
}

.quick-reply-button:hover {
  background: #667eea;
  color: white;
  transform: translateX(4px);
}

/* 横スライドボタン */
.quick-reply-button-horizontal {
  background: white;
  border: 1.5px solid #667eea;
  color: #667eea;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-reply-button-horizontal:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* 入力エリア上部の横スライドクイック返信 */
.quick-access-bar {
  padding: 8px 12px;
  background: #f8f9fa;
  border-top: 1px solid #e2e8f0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  max-height: 48px;
}

.quick-access-bar::-webkit-scrollbar {
  height: 3px;
}

.quick-access-bar::-webkit-scrollbar-track {
  background: transparent;
}

.quick-access-bar::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 2px;
}

/* 控えめな小さいボタン */
.quick-access-button {
  background: white;
  border: 1px solid #e2e8f0;
  color: #4a5568;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-access-button:hover {
  background: #f7fafc;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
}

.quick-access-button:active {
  transform: translateY(0);
}

/* カテゴリボタン用アイコン */
.quick-access-icon {
  font-size: 14px;
}

/* 入力エリア */
.chat-input-container {
  padding: 10px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-input-label {
  font-size: 11px;
  font-weight: 600;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input:disabled {
  background: #f7fafc;
  cursor: not-allowed;
}

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

.chat-send:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* フッター - 3つのボタン */
.chat-footer {
  padding: 12px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.footer-link {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

/* 公式サイト・FAQ - 淡いピンク */
.footer-link:nth-child(1) {
  background: #ffe0e6;
  color: #c7254e;
}

.footer-link:nth-child(1):hover {
  background: #ffccd5;
  transform: translateY(-2px);
}

/* ご予約 - オレンジ */
.footer-link:nth-child(2) {
  background: #ff9147;
  color: white;
}

.footer-link:nth-child(2):hover {
  background: #ff7a2e;
  transform: translateY(-2px);
}

/* 公式LINE - LINEの緑 */
.footer-link:nth-child(3) {
  background: #06C755;
  color: white;
}

.footer-link:nth-child(3):hover {
  background: #05b04b;
  transform: translateY(-2px);
}

/* スマホでのフッター調整 */
@media (max-width: 480px) {
  .chat-footer {
    padding: 10px 12px;
    gap: 6px;
  }
  
  .footer-link {
    padding: 10px 6px;
    font-size: 12px;
  }
}

/* === FAQ階層構造用スタイル === */

/* カテゴリボタン */
.category-button {
  text-align: left !important;
  padding: 14px 16px !important;
}

.category-button:hover {
  background: #f0f4ff !important;
  border-color: #667eea !important;
  color: #2d3748 !important;
}

/* 検索ボタン */
.search-button {
  background: #f0f9ff !important;
  border-color: #0ea5e9 !important;
  color: #0ea5e9 !important;
}

.search-button:hover {
  background: #0ea5e9 !important;
  color: white !important;
}

/* AIボタン */
.ai-button {
  background: #f0fdf4 !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
}

.ai-button:hover {
  background: #10b981 !important;
  color: white !important;
}

/* FAQセクション */
.faq-section {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #718096;
  margin-bottom: 4px;
  padding-left: 4px;
}

/* 質問ボタン */
.faq-question-button {
  background: white;
  border: 1.5px solid #e2e8f0;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.faq-question-button:hover {
  background: #f8fafc;
  border-color: #667eea;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.faq-q-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.faq-q-text {
  flex: 1;
  color: #2d3748;
  font-size: 14px;
  line-height: 1.5;
}

/* サブカテゴリボタン */
.faq-subcategory-button {
  background: white;
  border: 1.5px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
  color: #2d3748;
  font-size: 14px;
  width: 100%;
}

.faq-subcategory-button:hover {
  background: #fef5ff;
  border-color: #764ba2;
  transform: translateX(4px);
}

/* 回答スタイル */
.answer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f4ff;
}

.faq-a-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.answer-category {
  font-size: 12px;
  color: #667eea;
  background: #f0f4ff;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 12px;
}

.answer-text {
  color: #2d3748;
  line-height: 1.8;
  font-size: 14px;
}

/* 戻るボタンコンテナ */
.back-button-container {
  margin: 12px 0;
  display: flex;
  justify-content: center;
}

.back-button {
  background: white;
  border: 1.5px solid #cbd5e0;
  color: #718096;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.back-button:hover {
  background: #f7fafc;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

/* スマホ対応 */
@media (max-width: 480px) {
  .faq-question-button,
  .faq-subcategory-button {
    padding: 10px 12px;
    font-size: 13px;
  }

  .faq-q-icon,
  .faq-a-icon {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .answer-text {
    font-size: 13px;
  }
}