/* =========================================
   Chatbot CSS (WordPress埋め込み用)
   ========================================= */
.comchat {
    /* 色の統一（変数化） */
    --color-bg: #f5f5f5;
    --color-user: #dadaf1;
    --color-bot: #eeeeee;
    --color-text: #333333;
    --color-primary: #5365aa;
    --color-border: #cccccc;

    /* 影・角丸・サイズ */
    --radius: 10px;
    --radius-bubble: 16px;
    --shadow: 0 0 15px rgba(0,0,0,0.3);

    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--color-bg);
}
.comchat.color1{
    --color-user: #dbe5da;
    --color-primary: #68A060;
}

.comchat.color2{
    --color-user: #f1dcda;
    --color-primary: #d56161;
}

/* チャット本体 */
.comchat .chat-container {
    width: 500px;
    max-width: 95vw;

    height: 700px;
    max-height: 85vh;

    position: fixed;
    bottom: 20px;
    right: 15px;

    background-color: var(--color-bg);
    border-radius: var(--radius);

    display: none;
    flex-direction: column;
    overflow: hidden;

    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;

    z-index: 999;
}

/* ヘッダー */
.comchat .chat-header {
    background-color: var(--color-primary);
    color: var(--color-bg);

    padding: 15px;
    font-size: 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* メッセージ領域 */
.comchat .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;

    display: flex;
    flex-direction: column;
}

/* メッセージ一覧（idに合わせる） */
#chat_messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* 吹き出し共通 */
.comchat .message {
    padding: 10px 14px;
    border-radius: var(--radius-bubble);
    max-width: 75%;

    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    color: var(--color-text);
}

/* ユーザー */
.comchat .user {
    background-color: var(--color-user);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

/* Bot */
.comchat .bot {
    background-color: var(--color-bot);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* 入力欄 */
.comchat .chat-input {
    display: flex;
    border-top: 1px solid var(--color-border);
}

.comchat .chat-input input {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 14px;
}

.comchat .chat-input button {
    width: 80px;
    border: none;
    background-color: var(--color-primary);
    color: var(--color-bg);
    cursor: pointer;
    transition: 0.2s;
}

.comchat .chat-input button:hover {
    opacity: 0.8;
}

/* 開閉ボタン */
.comchat .chat-toggle {
    width: 60px;
    height: 60px;

    position: fixed;
    bottom: 80px;
    right: 20px;

    background-color: var(--color-primary);
    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    color: var(--color-bg);
    font-size: 30px;
    cursor: pointer;

    box-shadow: 0 0 10px rgba(0,0,0,0.3);

    z-index: 1000;
}

.comchat .chat-icon {
    width: 40px;
    height: 40px;
    margin: 0;
    border: none;
}

/* 閉じるボタン */
.comchat .close-button {
    background: none;
    border: none;
    color: var(--color-bg);
    font-size: 24px;
    cursor: pointer;
}

/* 開くアニメーション */
@keyframes fadeIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
