/* ==========================================================================
   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;
    z-index: 999999;
}

/* Force clean box sizing model across all inner child elements */
#argha-bot-root *, 
#argha-bot-root *::before, 
#argha-bot-root *::after {
    box-sizing: border-box;
    box-shadow: none;
}

/* Precise viewport anchor alignment properties */
.argha-bot-pos-right { right: 25px; left: auto; }
.argha-bot-pos-left { left: 25px; right: auto; }

/* ==========================================================================
   Launcher & Dynamic Tooltip Positioning
   ========================================================================== */
.argha-bot-launcher-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tooltip on LEFT when bot container is aligned to the RIGHT */
.argha-bot-pos-right .argha-bot-launcher-wrapper {
    flex-direction: row;
}

/* Tooltip on RIGHT when bot container is aligned to the LEFT */
.argha-bot-pos-left .argha-bot-launcher-wrapper {
    flex-direction: row-reverse;
}

/* Tooltip (Need help?) Element Styles */
.argha-bot-tooltip {
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    animation: arghaBotBounce 2s infinite ease-in-out;
}

@keyframes arghaBotBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Launcher Floating Action Button */
#argha-bot-launcher {
    width: 60px;
    height: 60px;
    background: var(--argha-bot-theme);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
#argha-bot-launcher:hover { transform: scale(1.08); }

/* ==========================================================================
   Main Chat Window Layout Container
   ========================================================================== */
#argha-bot-container {
    width: 360px;
    height: 540px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    display: flex;
    flex-direction: column;
}

.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 (Dynamically accepts background color) */
.argha-bot-header {
    background: var(--argha-bot-header-bg);
    color: #ffffff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.bot-profile { display: flex; align-items: center; gap: 10px; }
.bot-avatar { font-size: 24px; }
.bot-custom-img-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.bot-profile h4 { margin: 0; font-size: 15px; font-weight: 600; color: #ffffff; line-height: 1.2; }
.bot-profile p { margin: 0; font-size: 11px; color: var(--argha-bot-theme); }
#argha-bot-close { cursor: pointer; opacity: 0.7; font-size: 14px; padding: 5px; color: #ffffff; }
#argha-bot-close:hover { opacity: 1; }

/* Contact Us Wrapper Zone & Overhead Title Label */
.argha-bot-contact-wrapper-zone {
    background: #fcfcfc;
    border-bottom: 1px solid #eeeeee;
    padding: 8px 15px 12px 15px;
    flex-shrink: 0;
}
.contact-overhead-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #888888;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Direct Contact Call-To-Action Layout Rows */
.argha-bot-direct-contacts {
    display: flex;
    gap: 10px;
}
.direct-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 6px;
    color: #ffffff;
    transition: background-color 0.2s ease;
}
.btn-wa { background: #25D366; }
.btn-wa:hover { background: #1ebe57; }
.btn-email { background: var(--argha-bot-theme); opacity: 0.95; }
.btn-email:hover { opacity: 1; }

/* ==========================================================================
   Chat Flow Thread Context Messaging Elements
   ========================================================================== */
.argha-bot-body {
    flex: 1;
    padding: 15px;
    background: #f8f9fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.msg-row { 
    display: flex; 
    width: 100%; 
    flex-shrink: 0; 
}
.msg-row.bot { justify-content: flex-start; }
.msg-row.user { justify-content: flex-end; }

.msg-bubble {
    max-width: 85%;
    padding: 11px 15px;
    border-radius: 14px;
    font-size: var(--argha-bot-font-size);
    line-height: 1.5;
    word-wrap: break-word;
    height: auto;
    display: inline-block;
}
.msg-row.bot .msg-bubble { background: #ffffff; color: #333333; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.msg-row.user .msg-bubble { background: var(--argha-bot-theme); color: #ffffff; }

/* Quick Action Automated Response Pill Elements */
.argha-bot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    width: 100%;
    flex-shrink: 0;
}
.quick-btn {
    background: #ffffff;
    border: 1px solid var(--argha-bot-theme);
    color: var(--argha-bot-theme);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.quick-btn:hover { background: var(--argha-bot-theme); color: #ffffff; }

/* ==========================================================================
   Input Controls Footer Layout Section
   ========================================================================== */
.argha-bot-footer {
    display: flex;
    border-top: 1px solid #eeeeee;
    padding: 10px;
    background: #ffffff;
    align-items: center;
    flex-shrink: 0;
}
#argha-bot-input-field {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px;
    font-size: var(--argha-bot-font-size);
    background: transparent;
}
#argha-bot-send-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Developer Credit Footer Section
   ========================================================================== */
.argha-bot-credit {
    text-align: center;
    font-size: 10px;
    color: #999999;
    background: #ffffff;
    padding: 2px 0 8px 0;
    flex-shrink: 0;
}

/* ==========================================================================
   Advanced Fluid Mobile Viewport Breakpoints (Updated for Size & Position)
   ========================================================================== */
@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-pos-right .argha-bot-launcher-wrapper {
        flex-direction: row;
    }
    .argha-bot-pos-left .argha-bot-launcher-wrapper {
        flex-direction: row-reverse;
    }

    #argha-bot-container {
        width: calc(100vw - 30px) !important;
        max-width: 330px; /* Made smaller for mobile */
        height: 70vh; /* Reduced height */
        max-height: 460px; /* Cap max height to make it compact */
        bottom: 75px;
        margin: 0;
        border-radius: 16px;
    }
    
    .argha-bot-pos-right #argha-bot-container {
        right: 0 !important;
        left: auto !important;
    }
    .argha-bot-pos-left #argha-bot-container {
        left: 0 !important;
        right: auto !important;
    }
}