/* ==========================================================================
   デモ用チャットボット ウィジェット
   ========================================================================== */

.chatbot-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--blue-600) 0%, var(--blue-700) 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.25), 0 8px 10px -6px rgb(0 0 0 / 0.2);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.2s ease;
}

.chatbot-fab:hover {
    transform: scale(1.06);
}

.chatbot-fab-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background-color: var(--red-500);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.2);
}

.chatbot-window {
    position: fixed;
    right: 20px;
    bottom: 92px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 140px);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
}

.chatbot-window.open {
    display: flex;
}

.chatbot-header {
    background: linear-gradient(180deg, var(--slate-900) 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--blue-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-header-text {
    line-height: 1.3;
}

.chatbot-header-title {
    font-size: 13px;
    font-weight: 700;
}

.chatbot-header-sub {
    font-size: 10px;
    color: #cbd5e1;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.chatbot-demo-notice {
    background-color: #fef3c7;
    color: #92400e;
    font-size: 11px;
    text-align: center;
    padding: 5px 10px;
    line-height: 1.5;
}

.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background-color: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-msg {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.chatbot-msg-bot {
    background-color: #ffffff;
    color: var(--slate-800);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.chatbot-msg-user {
    background-color: var(--blue-600);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.chatbot-option-btn {
    background-color: #ffffff;
    border: 1px solid var(--blue-600);
    color: var(--blue-600);
    font-size: 12.5px;
    font-weight: 600;
    padding: 9px 12px;
    border-radius: 9999px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.chatbot-option-btn:hover {
    background-color: var(--blue-600);
    color: #ffffff;
}

.chatbot-option-btn.cta {
    border-color: var(--emerald-600);
    color: var(--emerald-700);
    font-weight: 700;
}

.chatbot-option-btn.cta:hover {
    background-color: var(--emerald-600);
    color: #ffffff;
}

.chatbot-typing {
    align-self: flex-start;
    background-color: #ffffff;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
    display: flex;
    gap: 4px;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #94a3b8;
    animation: chatbot-blink 1.2s infinite ease-in-out;
}

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

@keyframes chatbot-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

@media (max-width: 420px) {
    .chatbot-window {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 88px;
    }
}
