/* 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: flex-start;
    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;
    /* 長い URL を強制改行してはみ出し防止 */
    overflow-wrap: anywhere;      /* 新ブラウザ用 */
    word-break: break-all;        /* 旧ブラウザ用 */

    box-sizing: border-box;
    max-width: 100%;
    font-size: 14px;
    /* テーマ側の text-transform を打ち消し（小文字保持） */
    text-transform: none !important;
}

#cc-chatbot-overlay .message-content {
    text-transform: none !important;
}

.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;
    align-self: flex-end; /* 下端基準 */
    transform: translateY(-4px); /* 下端から 4px だけ上方向へ */
}

/* 画像メッセージ */
.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;

    /* 上下 6px・左右 10px に絞って 1 行 40px に収める */
    padding: 6px 10px !important;
    box-sizing: border-box !important;

    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #f5f5f5;
    outline: none;
    font-size: 16px;

    /* 右の送信ボタンとの間隔を少しだけ確保 */
    margin-right: 7px;

    /* 高さ関連 */
    line-height: 20px !important;   /* 16px フォント ×1.25 = 20px */
    height: 40px;                   /* 初期表示は 1 行 */
    min-height: 40px !important;    /* 1 行分以下には縮まない */
    max-height: 150px !important;   /* 伸縮上限（調整可） */

    overflow-y: auto;
    resize: none;
}

/* 画像送信ボタン */
#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: 36px !important;    /* テーマ側の上書きを無効化 */
    height: 36px !important;
    aspect-ratio: 1 / 1;       /* 横潰れ防止 */
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;            /* Flex で圧縮されないように */
    margin-right: 5px;
}

/* BOT アイコン幅を固定して圧縮させない */
.message-icon {
    flex: 0 0 36px;   /* 幅 36px で shrink=0 */
}

/* 日付行 (.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); }
}

/* トークン障害時に過去メッセージをぼかす */
#cc-chat-messages.cc-blur {
    filter: blur(4px);
    pointer-events: none;
}

/* ---------- プロフィールオーバーレイ ---------- */
/* 既存 */
#cc-info-overlay{
    position:fixed;inset:0;z-index:2500;
    background:#fff;display:none;flex-direction:column;
    align-items:center;text-align:center;
    padding:40px 20px 120px;      /* ★下に 120px 余白を確保 */
    font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;
}

/* × ボタン */
#cc-info-close{
    position:absolute;top:20px;right:20px;
    background:none;border:none;
    font-size:40px;
    line-height:1;cursor:pointer;
}

/* 顔アイコン */
#cc-info-icon{
    width:90px;height:90px;
    border-radius:50%;object-fit:cover;
    margin:30px 0 18px;
}

#cc-info-title{font-size:24px;font-weight:900;margin:0;} /* 太く */

#cc-info-friends,
#cc-info-hours,
#cc-info-company,
#cc-info-account{font-weight:500;}              /* 全て太く */

#cc-info-friends{margin-block:8px; font-size: 12px; color: #888;}
#cc-info-hours{margin:0 0 45px; font-size: 14px; font-weight: 600;}

/* トーク丸 */
#cc-info-talk{
    display:flex;flex-direction:column;justify-content:center;align-items:center;
    color:#000;font-weight:600;cursor:pointer;
}
#cc-info-talk i{color:#000;margin-bottom:4px;}  /* アイコンも黒 */
#cc-info-talk p{font-size: 14px; margin-block: 0;}


/* 画面下部に固定 */
#cc-info-bottom{                                
    position:absolute;bottom:0;left:0;width:100%;
    display:flex;flex-direction:column;align-items:center;
}
.bg-gray{
    background:#f1f1f1;
    width: 100vw;
    padding-block: 25px;
}
#cc-info-company,
#cc-info-account{color:#888;font-size:14px; font-weight: 600;}
#cc-info-company{margin:0;}
#cc-info-account{margin-block: 0 35px;}

#cc-info-copyright{font-size:13px;font-weight:600;margin:0; color: #888;}
#cc-info-report{font-size:14px;font-weight:600;color:#000;margin:6px 0 0;}

/* ---------- 通報オーバーレイ ---------- */
#cc-report-overlay{
    position:fixed;inset:0;z-index:2600;
    background:#fff;display:none;overflow-y:auto;
    padding:20px 24px 50px;             /* 下を広めに */
    font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;
}
.cc-report-overlay-wrap{width: 100%;}
#cc-report-close{
    position:absolute;top:20px;right:20px;
    background:none;border:none;font-size:34px;line-height:1;cursor:pointer;
}
#cc-report-form{width:100%;max-width:720px;margin:0 auto;}

.cc-rp-title{font-size:14px;font-weight:700;margin:60px 0 20px;color:#666; text-align: left;}

.cc-rp-radio{display:flex;align-items:end;gap:10px;font-size:15px;font-weight:600;
             margin:0 0 20px;cursor:pointer;}
#cc-report-form textarea{
    width:100%;height:200px;padding:14px;font-size:15px;
    border:none;border-radius:6px;resize:none;color:#444;
    background:#f1f1f1;box-sizing: border-box;
}

.cc-rp-note{font-size:13px;line-height:1.6;color:#666;margin-bottom:60px; text-align:left;}

#cc-report-send{
    width:100%;padding:16px 0;font-size:17px;font-weight:700;border:none;
    border-radius:8px;cursor:pointer;
    background:#9d9d9d;color:#fff;          /* disabled 色 */
}
#cc-report-send.enabled{background:#06c755;} /* 有効時 (LINE 緑) */

/* ---------- ラジオボタン共通 ---------- */
#cc-report-overlay .cc-rp-radio input[type="radio"]{
    appearance: auto !important;         /* ネイティブに戻す               */
    opacity: 1 !important;               /* 透明にする を打ち消す          */
    position: static !important;         /* 位置はデフォルトで OK          */
    accent-color: #000000;               /* LINE 緑（変更可）              */
    width: 18px;
    height: 18px;
    vertical-align: -2px;                /* ↓テキストと高さを揃える微調整 */
    margin-right: 6px;                   /* 余白                           */
}
