/* ==========================================================================
   Argha Ai Bot - Base Root Layout Configuration
   ========================================================================== */
#argha-bot-root {
    position: fixed;
    bottom: 25px;
    font-family: var(--argha-bot-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    z-index: 999999;
}

#argha-bot-root *,
#argha-bot-root *::before,
#argha-bot-root *::after {
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.argha-bot-pos-right { right: 25px; left: auto; }
.argha-bot-pos-left { left: 25px; right: auto; }

/* Launcher & Tooltip Layout */
.argha-bot-launcher-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.argha-bot-pos-right .argha-bot-launcher-wrapper { flex-direction: row; }
.argha-bot-pos-left .argha-bot-launcher-wrapper { flex-direction: row-reverse; }

.argha-bot-tooltip {
    background: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: calc(var(--argha-bot-font-size) * 0.95) !important;
    font-weight: 600 !important;
    color: #333333 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap;
    animation: arghaBotBounce 2s infinite ease-in-out;
}

@keyframes arghaBotBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

#argha-bot-launcher {
    width: 60px !important;
    height: 60px !important;
    background: var(--argha-bot-theme) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease;
}
#argha-bot-launcher:hover { transform: scale(1.08); }

/* ==========================================================================
   Main Chat Window Layout Container (Hidden by default)
   ========================================================================== */
#argha-bot-container {
    display: none;
    width: 360px !important;
    height: 540px !important;
    background: var(--argha-bot-body-bg) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
    position: absolute !important;
    bottom: 80px !important;
    flex-direction: column !important;
}

.argha-bot-pos-right #argha-bot-container { right: 0; left: auto; }
.argha-bot-pos-left #argha-bot-container { left: 0; right: auto; }

/* Header Interface Structure */
.argha-bot-header {
    background: var(--argha-bot-header-bg) !important;
    color: var(--argha-bot-header-text) !important;
    padding: 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}
.bot-profile { display: flex !important; align-items: center !important; gap: 10px !important; }
.bot-avatar { font-size: calc(var(--argha-bot-font-size) * 1.5) !important; }
.bot-custom-img-logo { width: 34px !important; height: 34px !important; border-radius: 50% !important; object-fit: cover !important; }
.bot-profile h4 { margin: 0 !important; font-size: calc(var(--argha-bot-font-size) * 1.2) !important; font-weight: 600 !important; color: var(--argha-bot-header-text) !important; line-height: 1.2 !important; }
.bot-profile p { margin: 0 !important; font-size: calc(var(--argha-bot-font-size) * 0.85) !important; color: var(--argha-bot-theme) !important; }
#argha-bot-close { cursor: pointer; opacity: 0.8; font-size: calc(var(--argha-bot-font-size) * 1.1) !important; padding: 5px !important; color: var(--argha-bot-header-text) !important; font-weight: bold !important; }
#argha-bot-close:hover { opacity: 1; }
#argha-bot-clear-chat { cursor: pointer; opacity: 0.75; font-size: calc(var(--argha-bot-font-size) * 1.05) !important; padding: 5px !important; line-height: 1 !important; transition: opacity 0.15s ease, transform 0.15s ease; }
#argha-bot-clear-chat:hover { opacity: 1; transform: scale(1.08); }

/* ==========================================================================
   Contact Us Wrapper Zone
   ========================================================================== */
.argha-bot-contact-wrapper-zone {
    background: #ffffff !important;
    border-bottom: 1px solid #eeeeee !important;
    padding: 15px !important;
    flex-shrink: 0 !important;
}
.argha-bot-direct-contacts {
    display: flex !important;
    gap: 10px !important;
}
.direct-btn {
    flex: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: calc(var(--argha-bot-font-size) * 0.95) !important;
    font-weight: 700 !important;
    padding: 10px 0 !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    transition: background-color 0.2s ease;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
}
.btn-wa { background: #25D366 !important; }
.btn-wa:hover { background: #1ebe57 !important; }
.btn-email { background: var(--argha-bot-theme) !important; opacity: 0.95; }
.btn-email:hover { opacity: 1; }

/* ==========================================================================
   Chat Flow Thread Content
   ========================================================================== */
.argha-bot-body {
    flex: 1 !important;
    padding: 15px !important;
    background: var(--argha-bot-body-bg) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}
.msg-row { display: flex !important; width: 100% !important; flex-shrink: 0 !important; }
.msg-row.bot { justify-content: flex-start !important; }
.msg-row.user { justify-content: flex-end !important; }

.msg-bubble {
    max-width: 85% !important;
    padding: 11px 15px !important;
    border-radius: 14px !important;
    font-size: var(--argha-bot-font-size) !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: anywhere !important;
    display: inline-block !important;
}
.msg-row.bot .msg-bubble {
    background: var(--argha-bot-bot-msg-bg) !important;
    color: var(--argha-bot-bot-msg-text) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03) !important;
}
.msg-row.user .msg-bubble {
    background: var(--argha-bot-theme) !important;
    color: var(--argha-bot-user-msg-text) !important;
}

/* Bold text inside bot messages */
.msg-row.bot .msg-bubble strong {
    font-weight: 700 !important;
    color: inherit !important;
}

/* ==========================================================================
   Bot Links - Bold + Clearly Clickable
   ========================================================================== */
#argha-bot-chat-flow .msg-bubble a,
#argha-bot-chat-flow a.argha-bot-link,
.msg-row.bot .msg-bubble a,
.msg-row.bot .msg-bubble a.argha-bot-link {
    color: var(--argha-bot-theme, #00a699) !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    cursor: pointer !important;
    transition: opacity 0.15s ease, color 0.15s ease !important;
    box-shadow: none !important;
}

#argha-bot-chat-flow .msg-bubble a:hover,
#argha-bot-chat-flow a.argha-bot-link:hover,
.msg-row.bot .msg-bubble a:hover,
.msg-row.bot .msg-bubble a.argha-bot-link:hover {
    opacity: 0.85 !important;
    text-decoration: underline !important;
}

#argha-bot-chat-flow .msg-bubble a:visited,
.msg-row.bot .msg-bubble a:visited {
    color: var(--argha-bot-theme, #00a699) !important;
}

/* User bubble links (rare, but keep readable on theme bg) */
.msg-row.user .msg-bubble a {
    color: var(--argha-bot-user-msg-text, #ffffff) !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}

/* ==========================================================================
   Quick Action Response Pills
   ========================================================================== */
.argha-bot-quick-replies {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 5px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}
.quick-btn {
    background: #ffffff !important;
    border: 1.5px solid var(--argha-bot-theme) !important;
    color: var(--argha-bot-theme) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: calc(var(--argha-bot-font-size) * 0.9) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.quick-btn:hover {
    background: var(--argha-bot-theme) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Input Controls Footer Layout Section
   ========================================================================== */
.argha-bot-footer {
    display: flex !important;
    align-items: center !important;
    border-top: 1px solid #eeeeee !important;
    padding: 10px 15px !important;
    background: var(--argha-bot-body-bg) !important;
    flex-shrink: 0 !important;
    gap: 12px !important;
    position: relative !important;
}
#argha-bot-mic-btn {
    position: static !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: calc(var(--argha-bot-font-size) * 1.3) !important;
    outline: none !important;
    color: var(--argha-bot-theme) !important;
    z-index: 10 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}
#argha-bot-input-field {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    padding: 8px 0 !important;
    font-size: var(--argha-bot-font-size) !important;
    background: transparent !important;
    color: var(--argha-bot-bot-msg-text) !important;
}
.argha-bot-action-btns {
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    z-index: 10 !important;
    padding: 0 !important;
}
#argha-bot-send-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    outline: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}
#argha-bot-send-btn svg {
    width: calc(var(--argha-bot-font-size) * 1.4) !important;
    height: calc(var(--argha-bot-font-size) * 1.4) !important;
}

.argha-bot-credit {
    text-align: center !important;
    font-size: calc(var(--argha-bot-font-size) * 0.75) !important;
    color: #999999 !important;
    background: var(--argha-bot-body-bg) !important;
    padding: 2px 0 8px 0 !important;
    flex-shrink: 0 !important;
}
.argha-bot-credit a {
    color: inherit !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

/* Typing loader subtle look */
.msg-row.id-loader .msg-bubble {
    opacity: 0.75 !important;
    font-style: italic !important;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 480px) {
    #argha-bot-root { bottom: 15px; width: auto; }
    .argha-bot-pos-right { right: 15px !important; left: auto !important; }
    .argha-bot-pos-left { left: 15px !important; right: auto !important; }
    #argha-bot-container {
        width: calc(100vw - 30px) !important;
        max-width: 330px;
        height: 70vh;
        max-height: 460px;
        bottom: 75px;
        border-radius: 16px;
    }
}