@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap');
* {
    box-sizing: border-box;
}
#chat-container {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  /* 初期状態では非表示にする */
  display: none; /* これが最終的な初期display値になるように調整 */
  position: fixed;
  bottom: 30px;
  right: 20px;
  height: 73vh;
  width: 32vw;
  min-width: 380px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  flex-direction: column; /* flex-direction は保持 */
  font-family: "Noto Sans JP", sans-serif!important;
  z-index: 9999;
}
#wpfooter{position: relative!important;}
#chat-container.show {
  opacity: 1;
  transform: translateY(0);
  /* showクラスが付与されたらflex表示にする */
  display: flex;
}
.diagnosis-option-btn{
display: block;
text-align: left;
background: #fff;
    color: #2d8bd0;
    padding: 0.3rem;
    border-radius: 5px;
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 0.8rem;
    border: solid 1px #0788c1;
}

    .progress-container {
        width: 100%;
        background-color: #e0e0e0;
        border-radius: 12px;
        overflow: hidden;
        margin: 10px 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        position: relative;
        height: 24px;
    }

    .progress-bar {
        height: 100%;
        background: linear-gradient(to right, #4CAF50, #8BC34A);
        border-radius: 12px;
        text-align: right;
        transition: width 1.5s ease-in-out;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    }

    .progress-text {
        position: absolute;
        width: 100%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #333;
        font-weight: bold;
        font-size: 14px;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
        text-align: center;
    }

    /* アニメーションの追加 */
    .progress-bar-start {
        width: 0%;
    }


/* .quick-link の見た目調整 */
#quick-questions {
  margin: 5px 0;
}

.faq-link {
  width: 100%;
  background: #fff;
  color: #2d8bd0;
  text-align: center;
  padding: 0.3rem;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 0.8rem;
  border: solid 1px #0788c1;
}

#chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: white;
  padding: 0;
  border-radius: 24px;
  cursor: pointer;
  font-weight: bold;
  z-index: 9999;
  font-family: sans-serif;
  max-width: 150px;
}

#chat-header {
  background: #273A60;
  color: white;
  padding: 10px 14px;
  font-weight: bold;
  position: relative;
  display: flex; /* ヘッダー内の要素をflexで配置 */
  align-items: center; /* 垂直方向中央揃え */
  justify-content: space-between; /* 要素を左右に配置 */
}

/* ヘッダー内のボタンの基本スタイル */
#chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 14px; /* 通常のボタンのフォントサイズ */
  cursor: pointer;
  margin-left: 8px; /* 各ボタン間にスペース */
  padding: 4px 8px;
  border-radius: 4px;
}

/* ヘッダー内のクローズボタン */
#chat-header #close-btn {
  font-size: 18px; /* クローズボタンは少し大きく */
  margin-left: auto; /* 右端に寄せる */
}

#chat-container.recruit-mode {
  background-color: #fff;
}

#chat-container.recruit-mode #chat-header {
  background: #DE223F;
}

#chat-container.recruit-mode input,
#chat-container.recruit-mode textarea {
  background-color: #f9f4f5;
  border-color: #DE223F;
}

/* #chat-close は #close-btn に変更されたので、このセレクタは削除済み */

#chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.from-user {
  flex-direction: row-reverse;
}

.diagnosis-options{
	margin-top: 10px;
}
.chat-bubble {
  max-width: 80%;
  font-size: clamp(1.4rem, 1.5vw, 1.5rem);
  background-color: #e7f0f6;
  padding: 1.2rem 1.5rem;
  font-size: 14px;
  line-height: 1.66;
  position: relative;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
}
.chat-btn-blue{
width: 100%;
  background: #fff;
  color: #2d8bd0;
  text-align: center;
  padding: 0.3rem;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 0.8rem;
  border: solid 1px #0788c1;
}

.chat-link-btn{
	color: #0d6efd;
}

.chat-link-bosyu-btn{
	width: 80%;
    display: inline-block;
    padding: 12px 24px;
    margin-top: 15px; /* 上のテキストとの間隔を空ける */
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    background-color: #5B7BFF; /* 青色系のブランドカラー */
    border: none;
    border-radius: 50px; /* 角丸を強調 */
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 影で立体感を出す */
}

.chat-link-bosyu-btn:hover {
    background-color: #0056b3; /* 色を少し濃くする */
    transform: translateY(-3px); /* 少し上に浮き上がらせる */
    box-shadow: 0 7px 10px rgba(0, 0, 0, 0.15); /* 影を強くする */
}

/* クリック時のスタイル */
.chat-link-bosyu-btn:active {
    background-color: #004085;
    transform: translateY(0); /* 元の位置に戻す */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chat-btn-shindan{
	width: 80%;
    display: inline-block;
    padding: 12px 24px;
    margin-top: 15px; /* 上のテキストとの間隔を空ける */
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    background-color: #04AF7A; /* 青色系のブランドカラー */
    border: none;
    border-radius: 50px; /* 角丸を強調 */
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 影で立体感を出す */
}



.user-bubble {
  background: #FFEDED;
  box-shadow: 2px 2px 10px 4px rgba(0, 0, 0, 0.05);
  border-radius: 16px 16px 0px;
}

.bot-bubble {
  background-color: #e7f0f6;
  box-shadow: 2px 2px 10px 4px rgba(0, 0, 0, 0.05);
  border-radius: 16px 16px 16px 0;
}

.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
}

#chat-input {
  /* 初期状態では非表示にする */
  display: none; /* これが最終的な初期display値になるように調整 */
  padding: 10px;
  background: white;
  border-top: 1px solid #ccc;
  flex-direction: row; /* flex-direction は保持 */
}

#chat-input input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#chat-input button {
  margin-left: 6px;
  padding: 8px 14px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.faq-links {
  color: #0788c1;
  text-decoration: underline;
}

.feedback-row {
  margin-left: 56px;
}

.chat-btn-red {
  margin: 4px 4px 0 0;
  padding: 4px;
  width: 60px;
  color: #fff;
  background: rgb(255, 102, 116);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  border: none;
}

.chat-btn-green {
  margin: 4px 4px 0 0;
  padding: 4px;
  width: 60px;
  color: #fff;
  background: rgb(76, 175, 80);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  border: none;
}

.feedback-btn:hover {
  background-color: #d0e9ff;
}

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

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

.faq-example-btn {
  color: rgb(13, 110, 253);
  text-decoration: underline;
  text-align: left;
  background: none;
  border: none;
  line-height: 1.66;
}

.example-block small {
  font-size: 0.6rem;
}
.privacy-policy-link {
    font-size: 0.6rem;
    margin-top: 5px;
    margin-bottom: 5px;
    display: inline-block;
    color: #1976d2;
    text-decoration: none;
}

#chat-footer{text-align: center; margin: 0 auto; padding: 2px 10px;}
#set-patient-button-in-chat, #set-recruit-button-in-chat{font-size: 12px; padding: 2px; border:solid 1px #dedede; background: #fff;}

/* chat-link-btn のスタイル（既存） */
.chat-link-btn {
  width: 100%;
  background: #fff;
  color: #2d8bd0;
  text-align: center;
  padding: 0.3rem;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 0.8rem;
  border: solid 1px #0788c1;
}
.chat-link-btn:hover {
    background-color: #0788c1;
    color: white;
}

/* recruit-contactフローのボタンのスタイル */
.chat-row.feedback-row .chat-bubble button {
    /* 既存のチャットボタンのスタイルを上書きまたは追加 */
    margin-top: 10px; /* ボタン同士の間隔 */
    width: 100%; /* 全幅にするなど調整 */
    box-sizing: border-box; /* パディングやボーダーを含めて幅を計算 */
}

/* 画像が埋め込まれるメッセージのスタイル */
.chat-bubble img {
    max-width: 100%; /* 親要素に収まるように */
    height: auto; /* アスペクト比を維持 */
    display: block; /* 画像の下の余白をなくす */
    margin: 10px 0; /* 上下のマージン */
    border-radius: 5px; /* 角を丸くする */
}


/* ----------------------------------------------- */
/* ★★★ ここからが「入力中...」のアニメーションに関する修正です ★★★ */
/* ----------------------------------------------- */

/* 不要なセレクタとアニメーションを削除 */
/*
.chat-row.api-typing-indicator-row .chat-bubble.api-typing-indicator-bubble {
  font-style: italic;
  opacity: 0.7;
  position: relative;
  overflow: hidden;
  min-width: 60px;
  white-space: nowrap;
}

.chat-row.api-typing-indicator-row .chat-bubble.api-typing-indicator-bubble::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-weight: bold;
  animation: typingDots 1.5s infinite steps(1, end);
}

@keyframes typingDots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
  100% { content: '.'; }
}
*/

/* 新しいローディングメッセージ用のスタイル (これを使用します) */
.chat-bubble.typing-loader-bubble { /* .chat-rowは不要で、バブル自体に直接適用 */
    background-color: #e0e0e0; /* ローダー用の背景色 */
    color: #e0e0e0; /* ローダー用の文字色 */
    border-radius: 20px; /* 角丸はそのまま */
    padding: 8px 15px;
    font-size: 14px;
    max-width: 70%;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    display: inline-flex; /* ドットを横並びにする */
    align-items: center;
    justify-content: center;
    /* 必要に応じて、ロード中のバブルの最小幅を設定 */
    min-width: 50px; 
}

/* タイピングインジケーターのCSS (ドットアニメーション) */
.typing-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #666;
    border-radius: 50%;
    animation: bounce 1s infinite ease-in-out;
    margin: 0 2px;
    opacity: 0.7;
}
/* 各ドットのアニメーション開始タイミングをずらす */
.chat-bubble .typing-indicator:nth-child(1) { animation-delay: 0s; }
.chat-bubble .typing-indicator:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble .typing-indicator:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}



/* ----------------------------------------------- */
/* ★★★ CSS修正ここまで ★★★ */
/* ----------------------------------------------- */

@media screen and (min-width: 480px) and (max-width: 767px){

	
}
@media screen and (max-width: 480px) {
  #chat-container {
    bottom: 0px;
    right: 0px;
    width: 100vw;
    height: 100dvh;
  }

  #chat-launcher {
    max-width: 120px;
  }
}


/* 固定ボタンコンテナ */
#fixed-buttons-container {
    position: fixed;
    bottom: -100px; /* 最初は画面外に隠す */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* PC版で中央に配置 */
    gap: 15px; /* ボタン間の隙間 */
    padding: 10px;
    box-sizing: border-box;
    z-index: 1000; /* 他の要素より手前に表示 */
    transition: bottom 0.5s ease-out, transform 0.5s ease-out; /* アニメーション用 */
    flex-wrap: wrap; /* スマホでボタンが多すぎる場合に折り返す */
    padding: 15px;
}

/* ポップアップ時の表示状態 */
#fixed-buttons-container.show {
    bottom: 0;
    transform: translateY(0);
}

/* スクロールで隠れる状態（少しだけ下にずらす） */
#fixed-buttons-container.hide {
    bottom: -100px;
    transform: translateY(20px); /* 少し下に移動して隠れる */
}

/* 個々のボタン */
.fixed-button {
    flex: 1; /* スマホで横幅いっぱいに広がるように */
    max-width: 48%; /* スマホで2つ並べるための幅。gapを考慮して調整 */
    display: flex;
    column-gap: 8px;
    flex-direction: row; /* アイコンとテキストを縦に並べる */
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    background-color: #007bff; /* ボタンの色 */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-align: center;
    font-family: "Noto Sans JP", sans-serif;
}

.fixed-button:hover {
    background-color: #0056b3;
    /*transform: translateY(-3px); sホバーで少し浮き上がる */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.fixed-button:active {
    transform: translateY(0); /* クリックで元に戻る */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.button-icon {
    width: 30px; /* アイコンのサイズ */
    height: 30px;

}
.btn-kyuujin p,.btn-kanjya p{margin-bottom: 0;}
.btn-kyuujin {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: none;
  background-color: #fff;
  color: #E75785;
  border: 0.08rem solid #E75785;
  line-height: 1.1;
}

.btn-kanjya {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: none;
  background-color: #fff;
  color: #1ca987;
  border: 0.08rem solid #1ca987;
  line-height: 1.1;
}

.btn-kanjya:hover {background: #1ca987; color: #fff;}
.btn-kyuujin:hover {background: #E75785; color: #fff;}
.btn-kanjya-text{font-size: 12px; background:#1ca987; color:#fff; padding: 2px 10px; display: inline; margin-bottom: 3px; position:absolute; top:6px;}
.btn-kyuujin-text{font-size: 12px; background:#E75785; color:#fff; padding: 2px 10px; display: inline; margin-bottom: 3px; position: absolute; top:6px;}

/* PC版のスタイル調整 */
@media (min-width: 768px) {
    #fixed-buttons-container {
        justify-content: center; /* 中央揃えを維持 */
    }

    .fixed-button {
        flex: none; /* 横幅いっぱいにしない */
        /*width: 280px; /* PC版のボタン幅を固定 */
        font-size: 15px;
        padding: 15px 30px;
        flex-direction: row; /* アイコンとテキストを横に並べる */
    }

    .button-icon {
        margin-right: 10px; /* アイコンとテキストの間のスペース */
        margin-bottom: 0;
    }
}

