/* BeeTruck Chat Style (Vue Edition - LP Color Match) */

:root {
    /* メインカラー定義 */
    --bee-highlight-yellow: #FFF100; /* 強調色（黄色） */
    --bee-brand-blue: #0D7E8F;       /* ティール青 */
    --bee-accent-orange: #FF5500;    /* オレンジ */
    --bee-accent-red: #E64B4B;       /* 赤 */
    --bee-text-black: #333333;       /* テキスト黒 */
    --bee-text-white: #FFFFFF;       /* テキスト白 */
    --bee-bg-gray: #f0f2f5;          /* 背景用薄いグレー */
}

/* Vue App Container */
#bee-chat-app {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

/* 起動ボタン */
.bee-chat-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bee-highlight-yellow);
    color: var(--bee-text-black);
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s, box-shadow 0.3s;
    /* アニメーション */
    animation: bee-bounce 3s infinite;
    border: 2px solid #fff; /* 境界線を強調 */
}

.bee-chat-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

.bee-chat-trigger-icon {
    font-size: 26px;
}

.bee-chat-trigger-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.bee-main-text {
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 0.05em;
}

.bee-sub-text {
    font-size: 11px;
    font-weight: bold;
    color: var(--bee-brand-blue);
}

@keyframes bee-bounce {
    0%, 100% { transform: translateY(0); }
    10% { transform: translateY(-5px); }
    20% { transform: translateY(0); }
}

/* モーダル全体 */
.bee-chat-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: 90%;
    height: 600px;
    max-height: 80vh;
    background: var(--bee-text-white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd;
}

/* ヘッダー */
.bee-chat-header {
    background: var(--bee-brand-blue);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--bee-text-white);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
    font-size: 16px;
    position: relative; /* プログレスバーの基準 */
}

.bee-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bee-chat-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--bee-text-white);
    padding: 0;
    line-height: 1;
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.bee-chat-close:hover {
    opacity: 1;
}

/* プログレスバー */
.bee-progress-container {
    height: 6px;
    background: #eee;
    width: 100%;
    position: relative;
}

.bee-progress-bar {
    height: 100%;
    background: var(--bee-accent-orange); /* オレンジで進行感 */
    width: 0%;
    transition: width 0.5s ease-out;
    border-radius: 0 3px 3px 0;
}

/* メッセージエリア */
.bee-chat-body {
    flex: 1;
    padding: 20px;
    background: var(--bee-bg-gray);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    /* 入力エリアに最後のメッセージが潜り込まないよう下に余白を確保 */
    padding-bottom: calc(20px + 110px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(20px + 110px + env(safe-area-inset-bottom));
}

.bee-msg {
    max-width: 85%;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    word-break: break-word;
}

.bee-msg-content {
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Botメッセージ */
.bee-msg.bot {
    align-self: flex-start;
}

.bee-msg.bot .bee-msg-content {
    background: var(--bee-text-white);
    color: var(--bee-text-black);
    border-bottom-left-radius: 4px;
    border: 1px solid #e5e5e5;
}

/* ユーザーメッセージ */
.bee-msg.user {
    align-self: flex-end;
}

.bee-msg.user .bee-msg-content {
    background: var(--bee-highlight-yellow);
    color: var(--bee-text-black);
    border-bottom-right-radius: 4px;
    font-weight: bold;
    border: 1px solid #e6d800; /* 少し濃い黄色で境界線 */
}

/* 入力エリア */
.bee-chat-input-area {
    padding: 16px;
    background: var(--bee-text-white);
    border-top: 1px solid #eee;
    min-height: 70px;
    display: flex;
    align-items: flex-end;
}

/* 入力モードごとのスタイル */
.input-mode-container {
    width: 100%;
}

/* ボタン選択肢 */
.bee-options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start; /* 左寄せに変更 */
}

.bee-option-btn {
    background: var(--bee-text-white);
    border: 1px solid var(--bee-brand-blue);
    color: var(--bee-brand-blue);
    padding: 10px 18px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
    outline: none;
    box-shadow: 0 2px 0 rgba(13, 126, 143, 0.1);
}

.bee-option-btn:hover {
    background: var(--bee-brand-blue);
    color: var(--bee-text-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(13, 126, 143, 0.2);
}

/* セレクト・テキスト入力 */
.bee-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.bee-input-text, .bee-input-select {
    flex: 1;
    /* flex内で横幅を縮められるようにする（送信ボタンが押し出されるのを防止） */
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
}

.bee-input-text:focus, .bee-input-select:focus {
    border-color: var(--bee-brand-blue);
    background: #fff;
}

.bee-submit-btn {
    background: var(--bee-brand-blue);
    color: var(--bee-text-white);
    border: none;
    padding: 0 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    /* 右側の送信ボタンは縮ませず、常に見えるようにする */
    flex: 0 0 auto;
    transition: background 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.bee-submit-btn:hover {
    background: #0a6573; /* 少し濃いティール */
}

.bee-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* 連絡先フォーム */
.bee-contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bee-contact-form .bee-input-text {
    width: 100%;
    box-sizing: border-box;
}

/* 最後の送信ボタンはオレンジで強調 */
.bee-contact-form .bee-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--bee-accent-orange);
    color: #fff;
    margin-top: 8px;
    font-size: 16px;
}
.bee-contact-form .bee-submit-btn:hover {
    background: #e64d00;
}

/* Vue Transitions */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s, transform 0.3s;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
    transform: translateY(20px);
}

.list-enter-active {
    transition: all 0.4s ease;
}
.list-enter-from {
    opacity: 0;
    transform: translateY(10px);
}

.input-enter-active, .input-leave-active {
    transition: opacity 0.2s;
}
.input-enter-from, .input-leave-to {
    opacity: 0;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .bee-chat-modal {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .bee-chat-trigger {
        bottom: 15px;
        right: 15px;
    }
    /* 入力UIが詰まらないよう縦積み（戻る/指定なしボタンが増えたため） */
    .bee-chat-input-area {
        padding: 12px;
        align-items: stretch;
    }
    .bee-chat-body {
        padding: 16px;
    }
    .bee-input-row {
        flex-direction: column;
    }
    .bee-input-row .bee-submit-btn {
        width: 100%;
        padding: 12px 14px;
        height: 44px;
    }
    .bee-input-text, .bee-input-select {
        font-size: 16px; /* iOSズーム抑制 */
    }
    .bee-option-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    .bee-option-btn.small-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    .bee-back-btn {
        height: 44px;
    }
}

/* 追加：テキスト入力＋ボタン用スタイル */
.bee-input-group-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.bee-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
    /* 子要素がはみ出すケースの対策 */
    min-width: 0;
}

.bee-extra-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start; /* 左寄せに変更 */
}

.small-btn {
    padding: 6px 14px;
    font-size: 12px;
}

/* 戻るボタン（分かりやすさ優先の専用デザイン） */
.bee-back-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f5f6f8;
    border: 1px solid #cfd6dd;
    color: #333;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.bee-back-btn:hover {
    background: #eef1f4;
    border-color: #b9c3cc;
}

.bee-back-btn:active {
    transform: translateY(1px);
}
