﻿/* --- PC表示スタイル（769px以上） --- */

/* ランチャーボタン（PC表示：横長カプセル型） */
.ai-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  background-color: #004098; /* 町田商工会議所カラー */
  color: #ffffff !important;
  border: 2px solid #ffffff;
  border-radius: 60px;
  padding: 10px 24px 10px 14px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.ai-chat-launcher:hover {
  background-color: #002d6b;
  transform: translateY(-3px);
}

/* PC用画像 */
.ai-chat-img-pc {
  display: block !important;
  height: 52px;
  width: auto;
  margin-right: 12px;
  object-fit: contain;
  flex-shrink: 0;
}

.ai-chat-launcher-text {
  color: #ffffff !important;
  font-size: 17px;
  font-weight: bold;
  display: inline-block;
}

/* スマホ用正円要素はPCでは非表示 */
.ai-chat-sp-circle-content {
  display: none !important;
}

/* PC表示用 チャットウィジェット */
.ai-chat-widget {
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 400px;
  height: 620px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
}

.ai-chat-widget.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ai-chat-header {
  background-color: #004098;
  color: #ffffff !important;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
}

.ai-chat-header span {
  color: #ffffff !important;
}

.ai-chat-close-btn {
  background: none;
  border: none;
  color: #ffffff !important;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.ai-chat-body {
  flex: 1;
  width: 100%;
  height: 100%;
}

.ai-chat-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.ai-chat-launcher-text {
color: #fff;
}

/* --- スマホ表示スタイル（画面幅 768px 以下） --- */
@media screen and (max-width: 768px) {
  /* ランチャー本体：特大丸アイコン（直径 130px） */
  .ai-chat-launcher {
    bottom: 20px !important;
    right: 16px !important;
    width: 130px !important;
    height: 130px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background-color: #004098 !important;
    border: 3.5px solid #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    justify-content: center !important;
    align-items: center !important;
    position: fixed !important;
    overflow: hidden !important;
  }

  /* PC表示要素を非表示 */
  .ai-chat-img-pc,
  .ai-chat-launcher-text {
    display: none !important;
  }

  /* スマホ専用構造 */
  .ai-chat-sp-circle-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
  }

  /* 中央キャラクター画像：文字と被らないよう上寄りに配置(Y軸-57%) */
  .ai-chat-sp-avatar {
    position: absolute !important;
    top: 43% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    background-color: #ffffff !important;
    object-fit: contain !important; /* イラスト全体を綺麗に収める */
    padding: 3px !important;
    box-sizing: border-box !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25) !important;
    z-index: 1 !important;
  }

  /* SVG円周テキスト用のコンテナ */
  .ai-chat-sp-svg {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  /* 文字サイズを大きく強調した下部アーチテキスト */
  .ai-chat-sp-svg text {
    font-size: 9.8px !important; /* 文字を大きく拡大 */
    font-weight: 900 !important;
    fill: #ffffff !important;
    letter-spacing: 0.8px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95) !important;
  }

  /* スマホ画面：チャットルームを画面中央配置 */
  .ai-chat-widget {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -45%);
    width: 92vw;
    height: 80vh;
    max-width: 400px;
    max-height: 650px;
    border-radius: 16px;
  }

  .ai-chat-widget.is-open {
    transform: translate(-50%, -50%);
  }
}