/* ==========================================================================
   MOCAL チャットボット — 採用サイト配色準拠
   Primary Blue: #2592c7 / #2490c6
   UI Blue: #2c7be5
   CTA: #8B1A2B
   Text: #333 / #555
   ========================================================================== */

/* ---------- reCAPTCHA v3 バッジ非表示（フッターにクレジット記載で代替） ---------- */
.grecaptcha-badge { visibility: hidden !important; }

/* ---------- FABボタン ---------- */
#mocal-chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    height: 72px;
    padding: 0 28px;
    border-radius: 36px;
    background: #2592c7;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 146, 199, 0.3), 0 2px 6px rgba(37, 146, 199, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#mocal-chatbot-fab-label {
    font-family: 'YakuHanMP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.3;
}

#mocal-chatbot-fab:hover {
    opacity: 0.85;
}

#mocal-chatbot-fab:active {
    transform: scale(0.95);
}

/* ---------- チャットウィンドウ ---------- */
#mocal-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    height: 620px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* ---------- ヘッダー ---------- */
#mocal-chatbot-header {
    background: #2592c7;
    color: #fff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#mocal-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#mocal-chatbot-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#mocal-chatbot-header-text {
    display: flex;
    flex-direction: column;
}

#mocal-chatbot-header-title {
    font-family: 'YakuHanMP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

#mocal-chatbot-header-subtitle {
    font-family: 'YakuHanMP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
    font-weight: 400;
}

#mocal-chatbot-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mocal-chatbot-close:hover {
    color: #fff;
}

/* ---------- メッセージエリア ---------- */
#mocal-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fbff;
}

/* スクロールバー */
#mocal-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

#mocal-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#mocal-chatbot-messages::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 9999px;
}

/* ---------- メッセージバブル ---------- */
.mocal-chatbot-msg {
    max-width: 82%;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.8;
    word-break: break-word;
    white-space: pre-wrap;
    letter-spacing: 0.02em;
    font-family: 'YakuHanMP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

.mocal-chatbot-msg--bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-radius: 4px 20px 20px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mocal-chatbot-msg--user {
    align-self: flex-end;
    background: #2592c7;
    color: #fff;
    border-radius: 20px 4px 20px 20px;
}

/* ---------- サジェストボタン ---------- */
.mocal-chatbot-suggests {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
}

.mocal-chatbot-suggest-btn {
    background: #fff;
    border: 1px solid #d0d0d0;
    color: #333;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mocal-chatbot-suggest-btn:hover {
    background: #f0f7fb;
    border-color: #2592c7;
    color: #2592c7;
}

/* ---------- タイピングインジケーター ---------- */
.mocal-chatbot-typing {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    align-self: flex-start;
    background: #fff;
    border-radius: 4px 20px 20px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mocal-chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #2592c7;
    opacity: 0.4;
    animation: mocal-chatbot-pulse 1.4s infinite ease-in-out;
}

.mocal-chatbot-typing span:nth-child(1) { animation-delay: 0s; }
.mocal-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.mocal-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mocal-chatbot-pulse {
    0%, 60%, 100% { opacity: 0.4; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.2); }
}

/* ---------- 入力エリア ---------- */
#mocal-chatbot-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}

#mocal-chatbot-input {
    flex: 1;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.45;
    resize: none;
    outline: none;
    max-height: 80px;
    font-family: 'YakuHanMP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: #f5f5f5;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#mocal-chatbot-input:focus {
    border-color: #2c7be5;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.12);
    background: #fff;
}

#mocal-chatbot-input::placeholder {
    color: #999;
}

#mocal-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #2592c7;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

#mocal-chatbot-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#mocal-chatbot-send:not(:disabled):hover {
    opacity: 0.85;
}

/* ---------- パワードバイ ---------- */
#mocal-chatbot-footer {
    padding: 8px 20px;
    background: #fff;
    text-align: center;
    flex-shrink: 0;
}

#mocal-chatbot-footer span {
    font-size: 10px;
    color: #999;
    letter-spacing: 0.05em;
}

/* ---------- 吹き出し ---------- */
#mocal-chatbot-bubble {
    position: fixed;
    bottom: 32px;
    right: 160px;
    background: #fff;
    color: #333;
    padding: 10px 32px 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-family: 'YakuHanMP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.02em;
    z-index: 9998;
    animation: mocal-chatbot-bubble-in 0.4s ease;
    white-space: nowrap;
}

#mocal-chatbot-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #fff;
    border-right: none;
}

#mocal-chatbot-bubble-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

#mocal-chatbot-bubble-close:hover {
    color: #333;
}

@keyframes mocal-chatbot-bubble-in {
    0% { opacity: 0; transform: translateX(10px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ---------- スマホ表示 ---------- */
@media (max-width: 767.98px) {
    #mocal-chatbot-fab {
        bottom: 16px;
        right: 16px;
        height: 48px;
        padding: 0 16px;
        border-radius: 24px;
    }

    #mocal-chatbot-fab-label {
        font-size: 12px;
    }

    #mocal-chatbot-bubble {
        bottom: 24px;
        right: 140px;
        font-size: 11px;
    }

    #mocal-chatbot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        z-index: 10000;
    }

    #mocal-chatbot-header {
        padding: 16px 20px;
    }

    .mocal-chatbot-msg {
        max-width: 88%;
    }
}
