/* Chat Widget CSS */
#acs-chat-widget {
    position: fixed;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* bottom / right / left はPHPインラインスタイルで制御 */
}

#acs-chat-bubble {
    width: 60px;
    height: 60px;
    background-color: #0073aa;
    /* WordPress Blue */
    border-radius: 50%;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

#acs-chat-bubble:hover {
    transform: scale(1.1);
}

#acs-chat-bubble .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

/* アバター画像バブル：基本スタイル（形状・シャドウはPHPインラインスタイルで制御） */
#acs-chat-bubble.acs-bubble-avatar {
    padding: 0;
    overflow: hidden;
}

#acs-bubble-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#acs-chat-window {
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    transition: all 0.3s ease;
}

#acs-chat-header {
    background-color: var(--acs-accent, #0073aa);
    color: var(--acs-accent-text, #ffffff);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#acs-chat-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--acs-accent-text, #ffffff);
}

.acs-header-actions {
    display: flex;
    align-items: center;
}

#acs-close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    margin-left: 10px;
}

#acs-support-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px 10px;
    margin-right: 10px;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
}

#acs-support-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

#acs-support-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

#acs-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.acs-message {
    margin-bottom: 12px;
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.acs-user-msg {
    background-color: var(--acs-accent, #0073aa);
    color: var(--acs-accent-text, #ffffff);
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.acs-ai-msg {
    background-color: #e5e5ea;
    color: black;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.acs-support-msg {
    background-color: #ffeeba;
    color: #856404;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid #ffeeba;
}

/* Avatar styling if used */
.acs-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

#acs-chat-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: white;
    display: flex;
}

#acs-user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
}

#acs-send-btn {
    background-color: var(--acs-accent, #0073aa);
    color: var(--acs-accent-text, #ffffff);
    border: none;
    padding: 0 15px;
    border-radius: 20px;
    cursor: pointer;
}

#acs-send-btn:hover {
    background-color: var(--acs-accent-dark, #005177);
}

/* Predefined options */
.acs-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.acs-option-btn {
    background-color: white;
    border: 1px solid var(--acs-accent, #0073aa);
    color: var(--acs-accent, #0073aa);
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.acs-option-btn:hover {
    background-color: #eff6ff;
}

/* Loader */
.acs-typing-indicator {
    padding: 10px;
    font-style: italic;
    color: #888;
    font-size: 12px;
}

/* =============================================
   プレチャットフォーム
   ============================================= */
#acs-prechat-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#acs-prechat-submit {
    background-color: var(--acs-accent, #0073aa) !important;
    color: var(--acs-accent-text, #fff) !important;
}

/* =============================================
   10 デザインパターン（色は --acs-accent で共通制御）
   ============================================= */

/* -----------------------------------------------
   1. standard  ― 定番・丸みのあるモダンスタイル
----------------------------------------------- */
/* ベースCSSがそのまま適用。追加指定なし */

/* -----------------------------------------------
   2. bubble  ― ふわっと大きな丸み、LINEライク
----------------------------------------------- */
.acs-design-bubble #acs-chat-window {
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.acs-design-bubble #acs-chat-header  { border-radius: 22px 22px 0 0; }
.acs-design-bubble .acs-ai-msg       { border-radius: 4px 20px 20px 20px; }
.acs-design-bubble .acs-user-msg     { border-radius: 20px 4px 20px 20px; }
.acs-design-bubble #acs-user-input   { border-radius: 24px; }
.acs-design-bubble #acs-send-btn     { border-radius: 24px; }
.acs-design-bubble .acs-option-btn   { border-radius: 20px; }

/* -----------------------------------------------
   3. flat  ― シャドウなし・シャープエッジ
----------------------------------------------- */
.acs-design-flat #acs-chat-window {
    border-radius: 0;
    box-shadow: none;
    border: 2px solid var(--acs-accent, #0073aa);
}
.acs-design-flat #acs-chat-header    { border-radius: 0; }
.acs-design-flat .acs-ai-msg         { border-radius: 0 8px 8px 8px; }
.acs-design-flat .acs-user-msg       { border-radius: 8px 0 8px 8px; }
.acs-design-flat #acs-user-input     { border-radius: 0; border: 2px solid var(--acs-accent, #0073aa); }
.acs-design-flat #acs-send-btn       { border-radius: 0; }
.acs-design-flat .acs-option-btn     { border-radius: 0; border-width: 2px; }

/* -----------------------------------------------
   4. glass  ― すりガラス・透明感
----------------------------------------------- */
.acs-design-glass #acs-chat-window {
    border-radius: 16px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.acs-design-glass #acs-chat-header {
    border-radius: 14px 14px 0 0;
    opacity: 0.92;
}
.acs-design-glass #acs-chat-messages { background: rgba(248,250,255,0.6); }
.acs-design-glass .acs-ai-msg {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200,210,255,0.4);
}
.acs-design-glass #acs-chat-input-area {
    background: rgba(255,255,255,0.7);
    border-top: 1px solid rgba(200,210,255,0.4);
}
.acs-design-glass #acs-user-input {
    background: rgba(255,255,255,0.8);
    border-color: rgba(200,210,255,0.6);
}
.acs-design-glass #acs-prechat-form { background: rgba(255,255,255,0.6); }

/* -----------------------------------------------
   5. neon  ― ダーク背景・グロー発光
----------------------------------------------- */
.acs-design-neon #acs-chat-window {
    background: #0d0d1a;
    border: 1px solid var(--acs-accent, #0073aa);
    box-shadow: 0 0 20px color-mix(in srgb, var(--acs-accent, #0073aa) 50%, transparent),
                inset 0 0 20px color-mix(in srgb, var(--acs-accent, #0073aa) 8%, transparent);
    border-radius: 12px;
}
.acs-design-neon #acs-chat-header {
    background: #1a1a2e;
    border-bottom: 1px solid var(--acs-accent, #0073aa);
}
.acs-design-neon #acs-chat-messages { background: #0d0d1a; }
.acs-design-neon .acs-ai-msg {
    background: #1e1e30;
    color: #d0d0ee;
    border: 1px solid color-mix(in srgb, var(--acs-accent, #0073aa) 40%, transparent);
}
.acs-design-neon .acs-user-msg { color: #fff; }
.acs-design-neon #acs-chat-input-area { background: #1a1a2e; border-top-color: var(--acs-accent, #0073aa); }
.acs-design-neon #acs-user-input { background: #1e1e30; border-color: var(--acs-accent, #0073aa); color: #d0d0ee; }
.acs-design-neon #acs-support-btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.acs-design-neon #acs-prechat-form { background: #0d0d1a; color: #d0d0ee; }
.acs-design-neon #acs-prechat-form label { color: #b0b0cc; }
.acs-design-neon #acs-prechat-form input { background: #1e1e30; border-color: var(--acs-accent); color: #d0d0ee; }
.acs-design-neon #acs-prechat-form p { color: #b0b0cc; }

/* -----------------------------------------------
   6. retro  ― オフセットシャドウ・レトロ印刷風
----------------------------------------------- */
.acs-design-retro #acs-chat-window {
    border-radius: 2px;
    border: 2.5px solid #333;
    box-shadow: 6px 6px 0 #333;
    background: #fffef5;
}
.acs-design-retro #acs-chat-header  { border-radius: 0; border-bottom: 2.5px solid #333; }
.acs-design-retro #acs-chat-messages { background: #fffef5; }
.acs-design-retro .acs-ai-msg {
    border-radius: 2px;
    border: 2px solid #333;
    background: #fffef5;
    color: #222;
}
.acs-design-retro .acs-user-msg {
    border-radius: 2px;
    border: 2px solid #333;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}
.acs-design-retro #acs-chat-input-area { background: #fffef5; border-top: 2.5px solid #333; }
.acs-design-retro #acs-user-input { border-radius: 0; border: 2px solid #333; background: #fffef5; }
.acs-design-retro #acs-send-btn { border-radius: 0; border: 2px solid #333; box-shadow: 2px 2px 0 #333; }
.acs-design-retro #acs-send-btn:hover { box-shadow: 1px 1px 0 #333; transform: translate(1px,1px); }
.acs-design-retro .acs-option-btn { border-radius: 0; border-width: 2px; }

/* -----------------------------------------------
   7. minimal  ― 余白重視・極限にシンプル
----------------------------------------------- */
.acs-design-minimal #acs-chat-window {
    border-radius: 6px;
    border: 1px solid #e2e2e2;
    box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}
.acs-design-minimal #acs-chat-header  { border-radius: 4px 4px 0 0; }
.acs-design-minimal #acs-chat-messages { background: #ffffff; }
.acs-design-minimal .acs-ai-msg {
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
}
.acs-design-minimal .acs-user-msg { border-radius: 6px; }
.acs-design-minimal #acs-user-input { border-radius: 4px; }
.acs-design-minimal #acs-send-btn   { border-radius: 4px; }
.acs-design-minimal .acs-option-btn { border-radius: 4px; }

/* -----------------------------------------------
   8. elevated  ― マテリアル風・強めのエレベーション
----------------------------------------------- */
.acs-design-elevated #acs-chat-window {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.28), 0 6px 18px rgba(0,0,0,0.16);
}
.acs-design-elevated #acs-chat-header { border-radius: 14px 14px 0 0; }
.acs-design-elevated .acs-ai-msg {
    border-radius: 0 16px 16px 16px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    color: #333;
}
.acs-design-elevated .acs-user-msg   { border-radius: 16px 0 16px 16px; }
.acs-design-elevated #acs-user-input { border-radius: 24px; box-shadow: inset 0 1px 4px rgba(0,0,0,0.08); }
.acs-design-elevated #acs-send-btn   { border-radius: 24px; }
.acs-design-elevated .acs-option-btn { border-radius: 20px; }

/* -----------------------------------------------
   9. messenger  ― WhatsApp / iMessage ライク
----------------------------------------------- */
.acs-design-messenger #acs-chat-window {
    border-radius: 10px;
    box-shadow: 0 3px 20px rgba(0,0,0,0.16);
}
.acs-design-messenger #acs-chat-messages { background: #ece5dd; }
.acs-design-messenger .acs-ai-msg {
    border-radius: 0 18px 18px 18px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    color: #111;
}
.acs-design-messenger .acs-user-msg  { border-radius: 18px 0 18px 18px; }
.acs-design-messenger #acs-chat-input-area { background: #f0f0f0; }
.acs-design-messenger #acs-user-input {
    border-radius: 20px;
    background: #ffffff;
    border-color: transparent;
}
.acs-design-messenger #acs-send-btn {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* -----------------------------------------------
   10. corporate  ― 白ヘッダー・トップアクセントライン
----------------------------------------------- */
.acs-design-corporate #acs-chat-window {
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
    border-top: 4px solid var(--acs-accent, #0073aa);
}
.acs-design-corporate #acs-chat-header {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    border-radius: 0;
}
.acs-design-corporate #acs-chat-header h3 { color: var(--acs-accent, #0073aa); }
.acs-design-corporate #acs-close-chat    { color: #666; }
.acs-design-corporate #acs-support-btn  {
    background: transparent;
    border-color: var(--acs-accent, #0073aa);
    color: var(--acs-accent, #0073aa);
}
.acs-design-corporate #acs-support-btn:hover { background: rgba(0,0,0,0.04); }
.acs-design-corporate #acs-chat-messages { background: #f8f9fa; }
.acs-design-corporate .acs-ai-msg {
    border-radius: 2px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-left: 3px solid var(--acs-accent, #0073aa);
    color: #333;
}
.acs-design-corporate .acs-user-msg  { border-radius: 2px; }
.acs-design-corporate #acs-user-input { border-radius: 2px; }
.acs-design-corporate #acs-send-btn   { border-radius: 2px; }
.acs-design-corporate .acs-option-btn { border-radius: 2px; }