/* ====================================
   ベーススタイル (画面追従)
   ==================================== */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

/* ====================================
   トグルボタン (💬)
   ==================================== */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background-color: #2196F3;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 60px;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    display: block;
}
.chatbot-toggle:hover {
    background-color: #0b7dda;
}

/* ====================================
   チャットウィンドウ
   ==================================== */
.chatbot-window {
    width: 300px;
    height: 400px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-header {
    background-color: #2196F3;
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

/* 検索フォーム (非表示) */
.chatbot-search-form {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    display: none;
}

.chatbot-search-input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 本文エリア */
.chatbot-body {
    flex-grow: 1;
    overflow-y: auto; /* 通常のスクロールを維持 */
    position: relative; 
}

/* 戻るボタン */
.chatbot-back-button {
    /* 【最終修正】位置を上部に固定 */
    position: sticky;
    top: 0;
    background-color: #f4f4f4;
    padding: 8px 15px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

/* リスト・カテゴリ */
#sfb-chatbot-list {
    min-height: 100%;
}

.chatbot-list-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    user-select: none;
}
.chatbot-list-item:hover {
    background-color: #f9f9f9;
}

/* 回答エリア */
.chatbot-answer {
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
    background-color: #fdfdfd;
}
.chatbot-answer p {
    margin: 0 0 10px 0;
}

/* ====================================
   フィードバック・問い合わせボタン
   ==================================== */

/* フィードバックボタンのベーススタイル */
.sfb-feedback-button {
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    user-select: none;
}

/* 解決したボタンのスタイル */
.sfb-resolved {
    background-color: #4CAF50; /* 緑 */
    color: white;
    margin-right: 5px;
}

/* 未解決ボタンのスタイル */
.sfb-unresolved {
    background-color: #f44336; /* 赤 */
    color: white;
}

/* 問い合わせ画面のコンテナ */
#sfb-operator-contact p {
    margin: 5px 0;
}

/* 問い合わせボタンのセンタリング */
.sfb-contact-link-button {
    display: block; 
    width: 90%;
    max-width: 250px;
    margin: 10px auto; /* 左右マージンautoで左右中央寄せ */
    padding: 10px 15px;
    background-color: #2196F3;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sfb-contact-link-button:hover {
    background-color: #0b7dda;
}