/* ==========================================================================
   Premium AI Chatbot (Mastige AI Theme) - CSS Style
   ========================================================================== */

/* Main Chatbot Wrapper */
#ai-chatbot-wrapper {
    font-family: 'Outfit', 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    position: fixed;
    bottom: var(--char-bottom, 25px) !important;
    right: var(--char-right, 25px) !important;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    
    /* Dynamic Theme CSS Variables */
    --chatbot-theme-color: #8b5cf6;
}

/* Floating Avatar Controller */
#ai-chatbot-video-container {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video Frame Button Trigger */
#ai-chatbot-toggle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    background-color: var(--chatbot-theme-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#ai-chatbot-toggle:hover {
    transform: scale(1.06) translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

/* Video/SVG sizing inside avatar */
#ai-chatbot-toggle video {
    width: 100%;
    height: 100%;
    object-fit: fill; /* contain→fill: 불필요한 상하 여백 제거 */
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    
    /* Hardware acceleration & anti-aliasing workaround for webm transparent boundary 1px border issue */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.ai-chatbot-default-avatar-circle {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--chatbot-theme-color);
}

.ai-chatbot-default-avatar-circle svg {
    width: 65%;
    height: 65%;
}

/* Sound Controller Switch */
#ai-chatbot-sound-toggle {
    position: absolute;
    top: var(--sound-top, 10px) !important;
    left: var(--sound-left, 50%) !important;
    transform: var(--sound-transform, translateX(65px)) !important;
    z-index: 110 !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #1e1b4b;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    outline: none;
}

#ai-chatbot-sound-toggle:hover {
    background-color: var(--chatbot-theme-color);
    transform: var(--sound-transform, translateX(65px)) scale(1.15) !important;
}

#ai-chatbot-sound-toggle svg {
    width: 15px;
    height: 15px;
}

/* Premium Chatbot Window Layout (Horizontal/ 챗봇 대화창 */
#ai-chatbot-window {
    width: 1200px;
    height: 800px;
    max-width: 95vw;
    max-height: 90vh;
    background-color: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: row; /* Horizontal 2-pane configuration */
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
}

/* Wrapper state for display toggle */
#ai-chatbot-wrapper.open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

#ai-chatbot-wrapper.open #ai-chatbot-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#ai-chatbot-wrapper.open #ai-chatbot-video-container {
    display: none !important;
}

/* ==========================================================================
   Left Sidebar Layout (Brand Visual Panel)
   ========================================================================== */
.ai-chatbot-sidebar {
    width: 280px;
    background: var(--chatbot-theme-color) !important;
    color: #ffffff;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Decorative background light in sidebar */
.ai-chatbot-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Sidebar Avatar */
.ai-chatbot-sidebar-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.ai-chatbot-sidebar-avatar video,
.ai-chatbot-sidebar-avatar svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ai-chatbot-sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.ai-chatbot-sidebar-name {
    font-size: 22px;
    font-weight: 850;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #f3e8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-chatbot-sidebar-status {
    font-size: 12px;
    color: #e9d5ff;
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.95;
}

/* Sidebar welcome area */
.ai-chatbot-sidebar-welcome {
    z-index: 2;
    background: rgba(255, 255, 255, 0.08);
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
    box-sizing: border-box;
}

.sidebar-welcome-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #f3e8ff;
}

.sidebar-welcome-text {
    font-size: 13px;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.4;
    word-break: keep-all;
}

/* Sidebar quick buttons list */
.ai-chatbot-sidebar-quick {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    z-index: 2;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.ai-chatbot-sidebar-quick::-webkit-scrollbar {
    width: 4px;
}
.ai-chatbot-sidebar-quick::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chatbot-sidebar-quick::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 10px;
}
.ai-chatbot-sidebar-quick::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.55);
}

.ai-chatbot-sidebar-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.ai-chatbot-sidebar-btn:hover {
    background: #ffffff;
    color: var(--chatbot-theme-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Right Main Pane (Chat Dialogue Interface)
   ========================================================================== */
.ai-chatbot-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Main Header */
.ai-chatbot-main-header {
    padding: 22px 28px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    z-index: 10;
    flex-shrink: 0;
}

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

.main-header-icon {
    font-size: 18px;
}

.main-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.ai-chatbot-main-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chatbot-main-close:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    transform: rotate(90deg);
}

.ai-chatbot-main-close svg {
    width: 18px;
    height: 18px;
}

/* Chat Body Log */
.ai-chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 28px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Scrollbar customization */
.ai-chat-body::-webkit-scrollbar {
    width: 6px;
}
.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 10px;
}
.ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

/* Chat Message Rows */
.ai-chat-message-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 80%;
    animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-chat-message-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-chat-message-row.bot {
    align-self: flex-start;
}

/* Bot Icon Graphic */
.ai-chat-message-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--chatbot-theme-color);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.15);
}

/* Message Bubble */
.ai-chat-bubble {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}

.ai-chat-message-row.user .ai-chat-bubble {
    background: var(--chatbot-theme-color);
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
}

.ai-chat-message-row.bot .ai-chat-bubble {
    background-color: #ffffff;
    color: #1e293b;
    border-radius: 20px 20px 20px 4px;
    border: 1px solid #e2e8f0;
}

/* Loading Spinner Bubble */
.ai-chat-message-row.loading .ai-chat-bubble {
    background-color: #ffffff;
    border-radius: 20px 20px 20px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 22px;
    border: 1px solid #e2e8f0;
}

.ai-chat-dot {
    width: 6px;
    height: 6px;
    background-color: var(--chatbot-theme-color);
    border-radius: 50%;
    animation: ai-chat-bounce 1.4s infinite ease-in-out both;
}

.ai-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-chat-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* ==========================================================================
   Horizontal Quick Action Chip Cards (Sliders)
   ========================================================================== */
.ai-chatbot-horizontal-quick-wrap {
    padding: 12px 28px;
    background-color: #f8fafc;
    border-top: 1px solid #f1f5f9;
    z-index: 5;
    overflow: hidden;
    flex-shrink: 0;
}

.ai-chatbot-horizontal-quick-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: auto;
    padding: 4px 0;
    cursor: grab;
}

/* Hide webkit scrollbars but allow swiping */
.ai-chatbot-horizontal-quick-list::-webkit-scrollbar {
    display: none;
}
.ai-chatbot-horizontal-quick-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Modern Rounded Chip Card */
.ai-chatbot-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.ai-chatbot-chip:hover {
    transform: translateY(-2px);
    border-color: var(--chatbot-theme-color);
    background: #ffffff;
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.12);
}

.chip-icon {
    font-size: 16px;
}

.chip-texts {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.chip-title {
    font-size: 13px;
    font-weight: 650;
    color: #334155;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.ai-chatbot-chip:hover .chip-title {
    color: var(--chatbot-theme-color);
}

.chip-badge {
    font-size: 10px;
    background-color: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ai-chatbot-chip:hover .chip-badge {
    background-color: var(--chatbot-theme-color);
    color: #ffffff;
}

/* ==========================================================================
   Footer Input Box
   ========================================================================== */
.ai-chatbot-main-footer {
    padding: 16px 28px 24px 28px;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    z-index: 10;
    flex-shrink: 0;
}

.ai-chat-input-container {
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    border-radius: 28px;
    padding: 5px 8px 5px 20px;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.ai-chat-input-container:focus-within {
    background-color: #ffffff;
    border-color: var(--chatbot-theme-color);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.12);
}

/* Mic Decorative Button */
.ai-chat-mic-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.ai-chat-mic-btn:hover {
    color: var(--chatbot-theme-color);
}

.ai-chat-mic-btn svg {
    width: 18px;
    height: 18px;
}

/* Field Input */
.ai-chat-input-field {
    flex-grow: 1;
    border: none;
    background: none;
    height: 38px;
    font-size: 14px;
    color: #0f172a;
    outline: none;
    padding: 0;
}

.ai-chat-input-field::placeholder {
    color: #94a3b8;
}

/* Send Button */
.ai-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #cbd5e1;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-send-btn.active {
    background: var(--chatbot-theme-color);
    box-shadow: 0 6px 14px rgba(139, 92, 246, 0.22);
}

.ai-chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform: translate(1px, 0);
}

/* ==========================================================================
   Responsive Viewports Configuration (Mobile Optimization)
   ========================================================================== */
@media (max-width: 900px) {
    #ai-chatbot-window {
        width: 720px;
    }
    .ai-chatbot-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    #ai-chatbot-wrapper {
        bottom: 0px !important;
        right: 0px !important;
        width: 100% !important;
        height: 100% !important;
        align-items: flex-end !important; /* 모바일 하단 시트 모달화 */
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    #ai-chatbot-video-container {
        position: fixed !important;
        bottom: var(--char-bottom, 15px) !important;
        right: var(--char-right, 15px) !important;
        transform: scale(var(--char-mobile-scale, 0.5)) !important;
        transform-origin: bottom right !important;
    }

    #ai-chatbot-window.premium-chatbot-modal {
        width: 100% !important;
        height: 82% !important; /* 높이를 82%로 제한하여 상단 노치 영역의 X버튼 잘림을 원천 방지 */
        max-height: 82vh !important;
        border-radius: 28px 28px 0 0 !important; /* 위쪽 모서리만 프리미엄 둥글기 적용 */
        margin: 0 !important;
        border: none !important;
        border-top: 1px solid rgba(226, 232, 240, 0.9) !important;
        flex-direction: column !important;
        transform: translateY(110%) !important; /* 100%보다 넉넉하게 110%로 지정하여 모바일 브라우저 툴바 여백에 의한 노출 차단 */
        visibility: hidden !important; /* 닫힌 상태에서 윗부분 노출 완벽 차단 */
        transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.38s ease !important;
        opacity: 1 !important;
        z-index: 1000;
    }

    #ai-chatbot-wrapper.open #ai-chatbot-window.premium-chatbot-modal {
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Hide sidebar completely on mobile viewport */
    .ai-chatbot-sidebar {
        display: none !important;
    }

    /* Adjust padding for touch friendly controls */
    .ai-chatbot-main-header {
        padding: 18px 24px !important;
    }

    .ai-chat-body {
        padding: 22px !important;
    }

    .ai-chat-message-row {
        max-width: 88% !important;
    }

    .ai-chatbot-horizontal-quick-wrap {
        padding: 10px 24px !important;
    }

    .ai-chatbot-main-footer {
        padding: 14px 24px 34px 24px !important; /* 모바일 하단 물리 바 여백 고려 */
    }

    /* Force hide character avatar when chatbot is open in mobile sheet */
    #ai-chatbot-wrapper.open #ai-chatbot-video-container {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Custom Character No-Circle Rendering Styles (Enlarged Scale & Dynamic JSON Sizing) */
#ai-chatbot-video-container.no-circle {
    width: var(--char-width, 220px) !important;
    height: var(--char-height, 220px) !important;
}

#ai-chatbot-toggle.no-circle {
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
}

.ai-chatbot-sidebar-avatar.no-circle {
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: var(--char-sidebar-width, 150px) !important;
    height: var(--char-sidebar-height, 150px) !important;
}

/* ==========================================================================
   AI Chatbot Action Elements Style (CTA & Collect Info & Kakao Connect)
   ========================================================================== */
.ai-action-block {
    margin: 10px 0;
    padding-left: 48px; /* Bot icon indent alignment */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    text-align: center;
    border: none;
    outline: none;
}

/* 1. Link Button */
.ai-action-link {
    background-color: var(--chatbot-theme-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.18);
    max-width: 260px;
}
.ai-action-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
    filter: brightness(1.08);
}

/* 2. Customer Info Form */
.ai-action-form {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    max-width: 320px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.ai-action-form-consent {
    font-size: 12.5px;
    color: #475569;
    margin-bottom: 12px;
    font-weight: 600;
}
.ai-action-form-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}
.ai-action-form-consent input[type="checkbox"] {
    margin-top: 2.5px;
    cursor: pointer;
}
.ai-action-form-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-action-input {
    width: 100%;
    height: 38px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}
.ai-action-input:focus {
    border-color: var(--chatbot-theme-color);
    background-color: #ffffff;
}
.ai-action-submit {
    background-color: #0f172a;
    color: #ffffff !important;
    font-weight: 700;
    width: 100%;
    margin-top: 4px;
}
.ai-action-submit:hover {
    background-color: var(--chatbot-theme-color);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* 3. Kakao & Phone Connect */
.ai-action-connect {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.ai-action-connect-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.ai-action-kakao {
    background-color: #fee500;
    color: #191919 !important;
    font-weight: 700;
}
.ai-action-kakao:hover {
    background-color: #fdd835;
    transform: translateY(-2px);
}
.ai-action-phone {
    background-color: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}
.ai-action-phone:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

/* PC Viewport Optimization: Restore dimmed background and keep floating character visible */
@media (min-width: 769px) {
    #ai-chatbot-wrapper.open {
        background-color: rgba(15, 23, 42, 0.45) !important;
        backdrop-filter: blur(4px) !important;
        pointer-events: auto !important; /* Block background interaction */
    }
    #ai-chatbot-window {
        box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22) !important;
    }
    /* Keep floating character button visible on PC when open */
    #ai-chatbot-wrapper.open #ai-chatbot-video-container {
        display: block !important;
        position: absolute !important;
        bottom: var(--char-bottom, 25px) !important;
        right: var(--char-right, 25px) !important;
        z-index: 9999 !important;
    }
}

/* Default Robot Avatar Styles (Redesign from ai.html) */
#ai-chatbot-video-container.default-avatar-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 120px !important;
    height: auto !important;
    overflow: visible !important;
}

#ai-chatbot-toggle.default-avatar-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    position: relative;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 120px !important;
    height: 120px !important;
    overflow: visible !important;
}

/* 외곽 레이더 애니메이션 */
@keyframes radarPulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

.radar-ring {
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    border: 2.5px solid var(--chatbot-theme-color);
    opacity: 0.4;
    pointer-events: none;
    animation: radarPulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.radar-ring-2 {
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    border: 2.5px solid var(--chatbot-theme-color);
    opacity: 0.2;
    pointer-events: none;
    animation: radarPulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    animation-delay: 1s;
}

/* 호버 인터랙션 (아이콘 자체 스케일 확대) */
#ai-chatbot-toggle.default-avatar-type:hover {
    transform: translateY(-4px) scale(1.05);
}

#ai-chatbot-toggle.default-avatar-type:active {
    transform: translateY(-1px) scale(0.97);
}

/* 초대형 로봇 아바타 래퍼 */
.ai-chatbot-avatar-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: transparent !important;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: none !important;
}

#ai-chatbot-toggle.default-avatar-type:hover .ai-chatbot-avatar-wrapper {
    background: transparent !important;
    box-shadow: none !important;
}

/* 로봇 눈 깜빡임 */
@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.eye-element {
    transform-origin: center;
    animation: blink 4s infinite;
}

/* 미세 플로팅 애니메이션 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.ai-chatbot-avatar-wrapper svg {
    animation: float 3s ease-in-out infinite;
}


/* 상태 표시등 */
.live-dot-pulse {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 16px;
    height: 16px;
    background-color: var(--chatbot-theme-color);
    border: 3px solid #ffffff;
    border-radius: 50%;
}

.live-dot-pulse::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--chatbot-theme-color);
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* 로봇 위의 가독성 높은 텍스트 레이아웃 */
.chatbot-text-above {
    color: #FFFFFF !important;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    line-height: 1.45;
    background: var(--bubble-bg, rgba(15, 23, 42, 0.88)) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    padding: 7px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    animation: textFloat 4s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

/* 말풍선 꼬리 */
.chatbot-text-above::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--bubble-bg, rgba(15, 23, 42, 0.88)) transparent !important;
    display: block;
    width: 0;
}

@keyframes textFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}


/* ------------------------------------------------------------------ */
/* [FIX] chatbot-wrapper overlay click-block (2026-07-05)             */
/* 닫힌 #ai-chatbot-window(1200x800)가 display:none 없이 레이아웃을 차지 */
/* -> position:fixed 래퍼 박스가 1200x930으로 커지고, 투명한데도       */
/*    pointer-events:auto(기본) 라 그 영역 페이지 클릭을 막던 문제.    */
/* 빈 래퍼는 이벤트 통과, 실제 조작요소(아바타/열린배경)만 클릭 수신.  */
#ai-chatbot-wrapper { pointer-events: none; }
#ai-chatbot-video-container { pointer-events: auto; }
#ai-chatbot-wrapper.open { pointer-events: auto; }
/* ------------------------------------------------------------------ */
