/* --- チャット全体 --- */
#my-chat-container {
    position: fixed;
    bottom: 120px;
    right: 40px;
    z-index: 1000;
}

/* --- チャットアイコン --- */
#chat-icon {
    width: 60px;
    height: 60px;
    background-color: #f46109; /* WordPressの青 */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}
#chat-icon:hover {
    transform: scale(1.1);
}
#chat-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* --- チャットウィンドウ --- */
#chat-window {
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ヘッダー */
#chat-header {
    background-color: #f46109;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
#chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

/* メッセージエリア */
#chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #fff;
}

/* メッセージの行 */
.chat-message-row {
    display: flex; /* ★追加 */
    align-items: flex-end; /* ★追加 */
    margin-bottom: 12px;
}
.chat-message-row.is-bot {
    justify-content: flex-start;
}
.chat-message-row.is-user {
    justify-content: flex-end;
}

/* メッセージの吹き出し */
.chat-message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
}
.chat-message-row.is-bot .chat-message-bubble {
    background-color: #e9e9eb;
    color: #333;
    border-top-left-radius: 4px;
}
.chat-message-row.is-user .chat-message-bubble {
    background-color: #f46109;
    color: white;
    border-top-right-radius: 4px;
}

/* 選択肢ボタン */
.chat-options-container {
    margin-top: 10px;
}
.chat-option {
    display: block;
    width: 100%;
    background-color: #fff;
    border: 1px solid #f46109
    color: #f46109;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background-color 0.2s, color 0.2s;
}
.chat-option:hover {
    background-color: #f46109;
    color: white;
}

/* ローディング表示 */
.chat-loading {
    display: flex;
    align-items: center;
}
.chat-loading::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #888;
    animation: loading-dot 1.2s infinite ease-in-out;
    animation-delay: 0s;
    box-shadow: 12px 0 0 #888, 24px 0 0 #888;
}
@keyframes loading-dot {
    0%, 80%, 100% {
        box-shadow: 12px 0 0 -5px #888, 24px 0 0 -5px #888;
    }
    40% {
        box-shadow: 12px 0 0 0 #888, 24px 0 0 -5px #888;
    }
    60% {
        box-shadow: 12px 0 0 0 #888, 24px 0 0 0 #888;
    }
}

/* --- ここからアイコン用のスタイルを追加 --- */

/* ボットアイコンのラッパー */
.chat-icon-wrapper {
    width: 40px;
    height: 40px;
    flex-shrink: 0; /* アイコンが縮まないように */
    margin-right: 10px;
}

/* アイコン画像 */
.chat-icon-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* アイコンを円形にする */
    object-fit: cover; /* 画像の比率を保ったままトリミング */
    background-color: #f0f0f0; /* 画像読み込み中の背景色 */
}

/* ユーザー側の吹き出しに少しマージンを持たせる（任意） */
.chat-message-row.is-user .chat-message-bubble {
    max-width: calc(80% - 50px); /* アイコン分のスペースを考慮 */
}

/* --- ここまで追加 --- */