/* css/chatbot.css */

/* オーバーレイ全体を覆う */
#cc-chatbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    padding: 0;
    margin: 0;
}

/* チャットボットコンテナのスタイル */
#cc-chatbot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    border: 0;
    box-shadow: none;
    animation: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: 0;
    margin: 0;
}

/* ヘッダー */
#cc-chatbot-header {
    background-color: #8cabd8;
    font-size: 16px;
    font-weight: bold;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ボディ部分 */
#cc-chatbot-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
    background-color: #e5ddd5; /* LINEのチャット背景色 */
    height: calc(100% - 60px - 60px);
}

/* メッセージエリア */
#cc-chat-messages {
    flex-grow: 1;
    margin-bottom: 0;
    /* 入力欄の後ろに隠れないよう、下を50px程度あける */
    padding: 10px 10px 50px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* メッセージバブル */
.message {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.message.user {
    align-self: flex-end;
    justify-content: flex-end;
    max-width: 85%;
}

.message.bot {
    align-self: flex-start;
    justify-content: flex-start;
    max-width: 100%;
}

/* メッセージ内容 */
.message .message-content {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 10px;
    word-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
    font-size: 14px;
}

.message.user .message-content {
    background-color: #9de693;
    border-top-right-radius: 0;
}

.message.bot .message-content {
    background-color: #ffffff;
    border-top-left-radius: 0;
}

/* タイムスタンプ */
.message-timestamp {
    font-size: 11px;
    color: #202020;
    margin: 0 5px;
    white-space: nowrap;
}

/* 画像メッセージ */
.message img.cc-chatbot-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    cursor: pointer;
}

/* 入力コンテナ */
#cc-chat-input-container {
    display: flex;
    border-top: 1px solid #ccc;
    padding: 5px;
    background-color: #ffffff;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
}

/* メッセージ入力欄 */
#cc-chat-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #f5f5f5;
    outline: none;
    font-size: 16px;
    /* 右のボタンが大きいので margin-right を少なく */
    margin-right: 7px;
}

/* 画像送信ボタン */
#cc-send-image-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* 画像自体が69x69なので追加のpadding不要 */
    margin-right: 10px; /* 入力欄との隙間を少しだけ確保 */
}
#cc-send-image-button img {
    /* ▼▼▼ 69x69の大きさで表示しています
       もし小さくしたいときは width/height を変更してください ▼▼▼ */
    width: 27px;
    height: 27px;
    margin-left: 9px;
}

/* 送信ボタン */
#cc-send-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* 画像が69x69 */
}
#cc-send-button img {
    /* ▼▼▼ 69x69の大きさで表示しています
       もし小さくしたいときは width/height を変更してください ▼▼▼ */
    width: 30px;
    height: 30px;
    margin-right: 7px;
}

/* モーダルウィンドウ */
.cc-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.cc-modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    border-radius: 10px;
}
#cc-modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}
.cc-close-modal {
    position: absolute;
    top: 30px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.cc-close-modal:hover,
.cc-close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* レスポンシブ対応 */
@media only screen and (max-width: 700px) {
    .cc-modal-content {
        width: 90%;
    }
}

/* Botアイコンの固定サイズ＆丸形に */
.message-icon img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
}

/* 日付行 (.message-date) のデザイン */
.message-date {
    font-size: 12px;
    color: white;
    text-align: center;
    background-color: #7791B7;
    border-radius: 12px;
    padding: 4px 10px;
    margin: 8px auto;
    display: inline-block;
}

/* ローディング表示オーバーレイ */
#cc-loading-overlay {
    display: none;
    position: fixed;
    z-index: 3000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
}
.cc-loading-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #ccc;
    border-top: 4px solid #888;
    border-radius: 50%;
    animation: cc-spin 0.8s linear infinite;
}
@keyframes cc-spin {
    100% { transform: rotate(360deg); }
}
