/* Container positioned over standard page layers */
#gravity-chatbot-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Floating Action Circle Button */
#chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1e88e5;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    float: right;
    transition: transform 0.2s ease;
}
#chatbot-toggle-btn:hover { transform: scale(1.05); }

/* Main Chat Frame styling */
#chatbot-window-box {
    width: 320px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

/* Chat Header Branding block */
.chatbot-window-header {
    flex-shrink: 0; 
    background: #1e88e5;
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky !important;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.chatbot-window-header h4 { margin: 0; font-size: 19px; font-weight: 600; }
.header_sub_title { font-size: 15px; }
.bot-avatar { font-size: 24px; }
.status-indicator { font-size: 11px; opacity: 0.85; display: block; }
.gsection_title {
    text-align: center;
}
/* Scrollable message tray body */
.chatbot-window-body {
    height: calc(550px - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f7f9fb;
}

/* Initial Open States & Animations */
.chat-widget-open #chatbot-window-box {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: botWindowSlideIn 0.4s ease-out forwards;
}
.chat-widget-closed #chatbot-window-box {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
    height: 0;
    margin-bottom: 0;
}

@keyframes botWindowSlideIn {
    from { opacity: 0; transform: translateY(40px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Redesigning Gravity Forms components into Chat Bubbles */
#chatbot-window-box .gform_wrapper { margin: 0; padding: 0; }
#chatbot-window-box .gfield { margin-bottom: 14px !important; }

/* Input fields resemble message input boxes */
#chatbot-window-box input[type="text"], 
#chatbot-window-box input[type="email"], 
#chatbot-window-box textarea {
    width: 100% !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
}

/* Action button matches submission standard */
#chatbot-window-box .gform_footer { margin: 10px 0 0 0 !important; padding: 0 !important; }
#chatbot-window-box .gform_button {
    width: 100% !important;
    background: #1e88e5 !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    border: none !important;
    padding: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(30,136,229,0.3) !important;
}

.chatbot-window-close {
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-icon {
    width: 30px !important;
    height: 30px !important;
    cursor: pointer;
}

.chat-replace-btn {
    color: white;
    width: 30px;
    height: 30px;
    border: none;
    margin-right: 10px;
    cursor: pointer;
}

.chat-replace-btn:hover {
    background-color: none !important;
}

[type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover {
    background-color: none !important;
}

/* ==========================================================================
   ADVANCED CHATBOT UI OVERRIDES FOR GRAVITY FORMS
   ========================================================================== */

/* Remove default form padding and borders */
#chatbot-window-box .gform_wrapper {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}
#chatbot-window-box .gform_heading,
#chatbot-window-box .gform_required_legend {
    display: none !important; /* Hide titles and legends */
}
#chatbot-window-box .gfield {
    margin-bottom: 20px !important;
    border: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

/* 1. THE BOT'S GREETING BUBBLE (Form Field Labels) */
#chatbot-window-box .gfield_label {
    display: inline-block !important;
    background: #1E497719 !important;
    color: #2d3748 !important;
    padding: 12px 16px !important;
    border-radius: 24px 24px 24px 3px !important; /* Round bubble format */
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    max-width: 85% !important;
    margin: 0 0 10px 0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
    /* align-self: flex-start;  */


     align-self: flex-end !important;
    margin-left: auto !important;
    text-align: left !important;
}

/* 2. CHAT TEXT INPUT BOXES (At the bottom of the body) */
#chatbot-window-box input[type="text"], 
#chatbot-window-box input[type="email"], 
#chatbot-window-box input[type="tel"],
#chatbot-window-box textarea {
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    border-radius: 24px !important; /* Fully pills shaped */
    padding: 14px 20px !important;
    font-size: 14px !important;
    color: #334155 !important;
    box-sizing: border-box !important;
    margin-top: 5px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
#chatbot-window-box input:focus, 
#chatbot-window-box textarea:focus {
    border-color: #1e88e5 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15) !important;
}

/* 3. TRANSFORMING RADIO BUTTONS INTO CLICKABLE BOT OPTION BARS */
#chatbot-window-box .gfield_radio {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 5px 0 0 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Hide the actual generic radio circle input icon */
#chatbot-window-box .gfield_radio input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Style the text labels to match the dark blue option buttons from the screenshot */
#chatbot-window-box .gfield_radio label {
    display: block !important;
    background: #11375c !important; /* Deep dark blue matching your screenshot */
    color: #ffffff !important;
    padding: 14px 16px !important;
    border-radius: 8px !important; /* Clean rectangular sleek borders */
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    cursor: pointer !important;
    margin: 0 !important;
    transition: background 0.2s ease, transform 0.1s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Hover effects for options */
#chatbot-window-box .gfield_radio label:hover {
    background: #1a4f80 !important;
    transform: translateY(-1px) !important;
}

/* Style changes dynamically if user clicks/selects an option block */
#chatbot-window-box .gfield_radio input[type="radio"]:checked + label {
    background: #1e88e5 !important; /* Brighter blue highlighted state */
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1e88e5 !important;
}

/* 4. CHAT FOOTER SUBMIT ACTIONS BUTTON */
#chatbot-window-box .gform_footer {
    margin: 15px 0 0 0 !important;
    padding: 0 !important;
    clear: both !important;
}
#chatbot-window-box .gform_button {
    width: 100% !important;
    background: #1e88e5 !important;
    color: #ffffff !important;
    border-radius: 24px !important;
    border: none !important;
    padding: 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 3px 8px rgba(30,136,229,0.25) !important;
    transition: background 0.2s ease !important;
}
#chatbot-window-box .gform_button:hover {
    background: #1565c0 !important;
}

/* 5. SUCCESS CONFIRMATION SCREEN ADJUSTMENTS */
#chatbot-window-box .gform_confirmation_message {
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #2d3748 !important;
    background: #ffffff !important;
    padding: 16px !important;
    border-radius: 4px 16px 16px 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
    margin-top: 10px !important;
    display: inline-block !important;
}

/* ==========================================================================
   UPDATED CHATBOT RADIO BUTTON TO PILLS LAYOUT (STEP 2 COMPATIBLE)
   ========================================================================== */

/* 1. FLEXIBLE RADIO CONTAINER - Allows options to flow horizontally */
#chatbot-window-box .gfield_radio {
    display: flex !important;
    flex-direction: row !important; /* Forces side-by-side layout like Step 1 */
    flex-wrap: wrap !important;     /* Safely wraps options if they are too long */
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 8px 0 15px 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Ensure individual choice wrapper list items don't break flex rules */
#chatbot-window-box .gfield_radio li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Hide the native browser circle radio icon */
#chatbot-window-box .gfield_radio input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* 2. CHIP BUTTON LAYOUT - Clean rounded capsule button shapes */
#chatbot-window-box .gfield_radio label {
    display: inline !important;
    background: #ffffff !important;   /* Default unselected state background */
    color: #4a5568 !important;       /* Slate text color */
    padding: 10px 20px !important;   /* Spacing for pill format */
    border-radius: 20px !important;  /* Perfect oval capsule ends */
    font-size: 13px !important;
    font-weight: 500 !important;
    text-align: center !important;
    cursor: pointer !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    white-space: nowrap !important;  /* Prevents bad linebreaks inside pills */
}

/* Hover effects for options */
#chatbot-window-box .gfield_radio label:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* 3. SELECTED ACTIVE STATE - Shifting right and turning solid blue */
#chatbot-window-box .gfield_radio input[type="radio"]:checked + label {
    background: #1e4670 !important;  /* Dark premium blue matching your screen */
    color: #ffffff !important;
    border-color: #1e4670 !important;
    box-shadow: 0 4px 10px rgba(30,70,112,0.2) !important;
    
    /* Pushes the selected item to the right side to mimic chat submission history */
    float: right !important;
    margin-left: auto !important;
}

/* 4. VERTICAL STACKING FALLBACK FOR BOTTOM INPUTS (Myself / Someone Else) */
/* If you have a specific field row that needs to take up the full bottom width, add 'stack-options' class to field in Gravity Forms settings */
#chatbot-window-box .stack-options .gfield_radio {
    flex-direction: column !important;
}
#chatbot-window-box .stack-options .gfield_radio label {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #1e4670 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 14px !important;
}


.chatbot-window-header {
    height: 70px;
    min-height: 70px;
    flex: 0 0 70px;
}

#chatbot-window-box .gform_wrapper,
#chatbot-window-box form,
#chatbot-window-box .gform_body {
    max-height: none !important;
    overflow: visible !important;
}

.chat-widget-closed #chatbot-window-box {
    display: none !important;
}

.chat-widget-open #chatbot-window-box {
    display: flex !important;
}













