/* ============================================================
   L会員証 AIチャット ウィジェット（外部サイト用）
   全クラス .lc-chat- プレフィクス
   ============================================================ */

:root {
    --lc-chat-primary: #2563eb;
    --lc-chat-primary-hover: #1d4ed8;
    --lc-chat-bg: #f7f8fa;
    --lc-chat-font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* reCAPTCHA v3 バッジ: 普段は隠し、ホバーで表示（Google規約準拠） */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* フローティングボタン（右下・スティッキーバーと重ならないよう上寄せ） */
.lc-chat-button-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 99998;
    transition: bottom 0.28s ease;
}

.lc-chat-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--lc-chat-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    line-height: 1.3;
    font-family: var(--lc-chat-font);
}

.lc-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.lc-chat-button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* チャットウィンドウ */
.lc-chat-window {
    display: none;
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 180px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    z-index: 99999;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--lc-chat-font);
}

.lc-chat-window.open {
    display: flex;
}

/* ヘッダー */
.lc-chat-header {
    background: var(--lc-chat-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lc-chat-header-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.lc-chat-header-text {
    flex: 1;
}

.lc-chat-header-title {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.3;
}

.lc-chat-header-sub {
    font-size: 11px;
    opacity: 0.85;
}

.lc-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.8;
}

.lc-chat-close:hover {
    opacity: 1;
}

/* メッセージエリア */
.lc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--lc-chat-bg);
}

.lc-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.lc-chat-msg.user {
    align-self: flex-end;
    background: var(--lc-chat-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.lc-chat-msg.assistant {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.lc-chat-msg a {
    color: inherit;
    text-decoration: underline;
}

.lc-chat-msg.user a {
    color: #fff;
}

/* 入力中インジケーター */
.lc-chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.lc-chat-typing span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: lcChatTyping 1.4s infinite;
}

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

@keyframes lcChatTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* ウェルカムメッセージ */
.lc-chat-welcome {
    text-align: center;
    padding: 20px 16px 8px;
}

.lc-chat-welcome svg {
    width: 48px;
    height: 48px;
    color: var(--lc-chat-primary);
    margin-bottom: 8px;
}

.lc-chat-welcome p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* 入力エリア */
.lc-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
    flex-shrink: 0;
}

.lc-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}

.lc-chat-input:focus {
    border-color: var(--lc-chat-primary);
}

.lc-chat-input::placeholder {
    color: #aaa;
}

.lc-chat-send {
    background: var(--lc-chat-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.lc-chat-send:hover {
    background: var(--lc-chat-primary-hover);
}

.lc-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.lc-chat-send svg {
    width: 18px;
    height: 18px;
}

/* エラー表示 */
.lc-chat-error {
    align-self: center;
    background: #fff3f3;
    color: #c62828;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    text-align: center;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .lc-chat-window {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .lc-chat-button {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* ============================================================
   全画面モード（iframe埋め込み用）
   ============================================================ */
.lc-chat-fullpage {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--lc-chat-font);
}

.lc-chat-fullpage .lc-chat-messages {
    flex: 1;
}

/* iframe埋め込みページ用: body全体をチャットで埋める */
.lc-chat-embed-body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}
