/**
 * AwesomeBot Frontend Styles
 * Styles for the chat widget and embedded console.
 *
 * @since 1.0.0
 * @version 1.1.2
 * @package AwesomeBot
 */

/* --- Base Wrapper & Icon --- */
.awesomebot-wrapper {
    position: fixed;
    bottom: 90px; /* Distance from bottom edge */
    right: 20px; /* Distance from right edge */
    width: 360px; /* Increased width slightly */
    max-width: calc(100vw - 40px); /* Ensure stays within viewport */
    z-index: 9999; /* High z-index */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: none; /* Hidden by default */
    opacity: 0;
    transform: translateY(15px) scale(0.98); /* Start slightly lower and smaller */
    transform-origin: bottom right;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    box-sizing: border-box;
}

.awesomebot-wrapper.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1); /* Animate into place */
}

/* Position modifiers for wrapper and launcher */
.awesomebot-wrapper.pos-bottom-right { right: 20px; left: auto; bottom: 90px; transform-origin: bottom right; }
.awesomebot-wrapper.pos-bottom-left { left: 20px; right: auto; bottom: 90px; transform-origin: bottom left; }
.awesomebot-icon.pos-bottom-right { right: 20px; left: auto; bottom: 20px; }
.awesomebot-icon.pos-bottom-left { left: 20px; right: auto; bottom: 20px; }

/* --- Messenger-like Modern Redesign --- */
/* General container */
.awesomebot-wrapper {
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    background: #f4f6fb;
    border: none;
}

.awesomebot-chat-container {
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    background: #fff;
    border: none;
    padding: 0;
}

/* Header */
.awesomebot-chat-header {
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    border-radius: 18px 18px 0 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.awesomebot-chat-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.awesomebot-close-button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    padding: 6px;
    transition: background 0.2s;
}
.awesomebot-close-button:hover {
    background: rgba(255,255,255,0.12);
}

/* Floating Icon */
.awesomebot-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa; /* Default WP Blue */
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    border: none;
    padding: 0;
    z-index: 10000; /* Above widget */
    outline: none;
}
.awesomebot-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.awesomebot-icon svg {
    width: 28px; /* Slightly smaller icon */
    height: 28px;
    fill: currentColor; /* Use color property */
    stroke: currentColor; /* Ensure stroke matches */
}
/* Hide icon when widget is active */
.awesomebot-wrapper.active + .awesomebot-icon {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Launcher icon centering and clarity */
.awesomebot-icon { display: flex !important; align-items: center !important; justify-content: center !important; line-height: 0 !important; }
.awesomebot-icon svg { width: 27px !important; height: 27px !important; display: block !important; }
.awesomebot-launcher-svg *[stroke] { stroke: currentColor !important; vector-effect: non-scaling-stroke; }
.awesomebot-launcher-svg { width: 27px !important; height: 27px !important; }
.awesomebot-launcher-svg *[stroke-width] { stroke-width: 1.75 !important; }
.awesomebot-launcher-svg { shape-rendering: geometricPrecision; }
.awesomebot-icon svg [fill="none"] { fill: none !important; }
/* Ensure crisp edges */
.awesomebot-icon svg path, .awesomebot-icon svg circle, .awesomebot-icon svg rect, .awesomebot-icon svg line, .awesomebot-icon svg polyline, .awesomebot-icon svg polygon { shape-rendering: geometricPrecision; }

/* --- Chat Header --- */
.awesomebot-chat-header {
    padding: 10px 15px;
    background-color: #f1f1f1;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center; /* Center title by default */
    position: relative; /* Relative for positioning context IF needed, but buttons now relative to inner-container */
    min-height: 50px;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent header from shrinking */
    color: #333;
}
.awesomebot-chat-header-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    /* Adjust padding to make space for absolutely positioned buttons */
    padding-left: 45px; /* Space for Reset */
    padding-right: 65px; /* Space for Transcript + Close */
    box-sizing: border-box;
    justify-content: center; /* Center the title container */
}
.awesomebot-chat-header-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    flex-grow: 1; /* Allow title to take available space */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit; /* Inherit color from header */
}

/* Header Buttons Common */
.awesomebot-header-button {
    background: none; border: none; padding: 5px; cursor: pointer; color: #646970;
    line-height: 0; position: absolute; top: 50%; transform: translateY(-50%);
    border-radius: 50%; transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 1; /* Above header bg */
}
.awesomebot-header-button:hover { background-color: rgba(0, 0, 0, 0.07); color: #1d2327; }
.awesomebot-header-button svg { display: block; width: 18px; height: 18px; }

/* Close Button Positioning */
.awesomebot-close-button {
    background: none; border: none; padding: 8px; cursor: pointer;
    color: #646970; line-height: 1; position: absolute;
    top: 4px; /* Position near top edge */
    right: 4px; /* Position near right edge */
    transform: none; /* Remove vertical centering */
    z-index: 2; /* Above other header elements */
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.awesomebot-close-button:hover { color: #1d2327; background-color: rgba(0, 0, 0, 0.07); }
.awesomebot-close-button svg { width: 14px; height: 14px; display: block; }

/* Other Header Buttons Specific Positioning */
.awesomebot-reset-button { left: 10px; /* Consistent padding */ }
.awesomebot-transcript-button { right: 35px; /* Position left of close button */ }

/* Messages area */
.awesomebot-chat-message-container, .awesomebot-chat-messages {
    background: #f4f6fb;
    flex: 1;
    padding: 18px 14px 12px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Message bubbles */
.bot-message, .awesomebot-message-bot .awesomebot-message-content {
    align-self: flex-start;
    background: #fff;
    color: #222;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 12px 16px;
    max-width: 80%;
    font-size: 15px;
    margin-bottom: 2px;
    position: relative;
}
.user-message, .awesomebot-message-user .awesomebot-message-content {
    align-self: flex-end;
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 12px 16px;
    max-width: 80%;
    font-size: 15px;
    margin-bottom: 2px;
    position: relative;
}

/* Timestamps */
.awesomebot-message-time {
    font-size: 12px;
    color: #a0a0a0;
    margin: 2px 0 8px 4px;
}

/* Typing indicator */
.awesomebot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0 0 2px;
    height: 22px;
}
.awesomebot-typing-dot {
    width: 7px;
    height: 7px;
    background: #b3d1ff;
    border-radius: 50%;
    animation: awesomebot-typing-bounce 1.2s infinite both;
}
.awesomebot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.awesomebot-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes awesomebot-typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.7; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* Formatting inside Bot Messages */
.bot-message p,
.bot-message ul,
.bot-message ol { margin: 0.6em 0; font-size: inherit; }
.bot-message p:first-child { margin-top: 0; }
.bot-message p:last-child { margin-bottom: 0; }
.bot-message ul, .bot-message ol { padding-left: 22px; margin-left: 0; }
.bot-message li { margin-bottom: 0.4em; }
.bot-message a { color: #0073aa; text-decoration: underline; }
.bot-message a:hover { color: #005177; }
.bot-message b, .bot-message strong { font-weight: 600; }
.bot-message i, .bot-message em { font-style: italic; }
.bot-message br { content: ""; display: block; margin-bottom: 0.6em; } /* Treat single newline as <br> */

/* Message Footer (Ratings & Source Indicator) */
.bot-message-footer {
    position: absolute;
    bottom: 6px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between indicator and rating */
}
.rating {
    display: flex;
    gap: 6px;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease-in-out;
}
.bot-message:hover .rating { opacity: 0.7; } /* Show on hover */
.rating:hover { opacity: 1; } /* Full opacity when hovering rating itself */
.rating svg {
    cursor: pointer;
    width: 18px; height: 18px;
    fill: #777;
    transition: fill 0.2s ease, transform 0.2s ease;
}
.rating svg:hover { fill: #333; transform: scale(1.1); }
.rating.rated svg { cursor: default; } /* Disable pointer events once rated */
.rating.rated svg.rated { fill: #0073aa; /* Highlight selected */ }
.rating.rated svg:not(.rated) { opacity: 0.3; } /* Dim the unselected */
.rating.processing svg { opacity: 0.5; cursor: wait; } /* Indicate processing */

.awesomebot-source-indicator {
    font-size: 10px;
    color: #777;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background-color: rgba(0, 0, 0, 0.04);
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: default;
    font-weight: 500;
}
.awesomebot-source-indicator svg { /* Style for the brain icon */
    width: 10px; height: 10px; fill: currentColor; opacity: 0.8;
}

/* Input area */
.awesomebot-chat-input, .awesomebot-chat-input-container {
    background: #f4f6fb;
    border-top: 1px solid #e0e0e0;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Make input form full-width and expand textarea */
.awesomebot-chat-input-form { width: 100%; display: flex; align-items: center; gap: 8px; margin: 0; }
.awesomebot-chat-input { flex: 1 1 auto; }
.awesomebot-chat-textarea {
    flex: 1;
    border: none;
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 15px;
    background: #fff;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    resize: none;
    min-height: 38px;
    max-height: 90px;
    outline: none;
    transition: box-shadow 0.2s;
}
.awesomebot-chat-textarea:focus {
    box-shadow: 0 0 0 2px #0078ff33;
}
.awesomebot-chat-submit {
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.awesomebot-chat-submit:hover {
    background: linear-gradient(90deg, #005fd9 0%, #00aaff 100%);
}

/* Quick replies */
.awesomebot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0 0;
}
.awesomebot-quick-reply {
    background: #eaf3ff;
    color: #0078ff;
    border: none;
    border-radius: 14px;
    padding: 7px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.awesomebot-quick-reply:hover {
    background: #d2eaff;
    color: #005fd9;
}

/* --- Embedded Console Styles --- */
.awesomebot-console {
    border: 1px solid #e0e0e0; border-radius: 8px; background-color: #fff;
    overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    height: 65vh; max-height: 700px; min-height: 400px; width: 100%; margin: 20px 0;
}
.awesomebot-console .console-header {
    padding: 16px 24px; border-bottom: 1px solid #e0e0e0; background-color: #f9f9f9;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; flex-shrink: 0;
}
.awesomebot-console .console-title-wrap h2 { margin: 0 0 2px 0; font-size: 20px; font-weight: 600; line-height: 1.3; color: #1d2327; }
.awesomebot-console .console-title-wrap .console-subtitle { margin: 0; font-size: 14px; color: #646970; }
.awesomebot-console .console-messages {
    flex-grow: 1; height: 0; padding: 24px; background: #ffffff; overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
}
/* Console message bubbles inherit general styles but can be overridden */
.awesomebot-console .user-message { background: var(--ab-console-primary, #0073aa) !important; color: #ffffff !important; align-self: flex-end; border-radius: 18px 18px 4px 18px; box-shadow: 0 1px 1px rgba(0,0,0,0.05); padding: 10px 14px; max-width: 85%; line-height: 1.5; transition: filter 0.12s ease; }
.awesomebot-console .user-message:hover { filter: brightness(0.94); }
.awesomebot-console .bot-message { background: #f6f7f7; color: #1d2327; border: 1px solid #e5e7eb; align-self: flex-start; border-radius: 4px 18px 18px 18px; padding: 10px 14px; max-width: 85%; line-height: 1.5; box-shadow: 0 1px 1px rgba(0,0,0,0.05); padding-bottom: 28px; } /* Ensure padding for footer */
/* Console Message Formatting, Footer, Rating, Indicator (Shares styles with widget) */
.awesomebot-console .bot-message p, .awesomebot-console .bot-message ul, .awesomebot-console .bot-message ol { margin: 0.5em 0; font-size: inherit; } .awesomebot-console .bot-message p:first-child { margin-top: 0; } .awesomebot-console .bot-message p:last-child { margin-bottom: 0; } .awesomebot-console .bot-message ul, .awesomebot-console .bot-message ol { padding-left: 22px; margin-left: 0;} .awesomebot-console .bot-message li { margin-bottom: 0.4em; } .awesomebot-console .bot-message a { color: #0073aa; } .awesomebot-console .bot-message a:hover { color: #005a87; } .awesomebot-console .bot-message b, .awesomebot-console .bot-message strong { font-weight: 600; } .awesomebot-console .bot-message i, .awesomebot-console .bot-message em { font-style: italic; }
.awesomebot-console .bot-message-footer { position: absolute; bottom: 6px; right: 12px; display: flex; align-items: center; gap: 10px; }
.awesomebot-console .rating { display: flex; gap: 6px; opacity: 0; transition: opacity 0.2s ease; } /* Hidden by default */
.awesomebot-console .bot-message:hover .rating { opacity: 0.7; } /* Show on hover */
.awesomebot-console .rating:hover { opacity: 1; }
.awesomebot-console .rating svg { width: 16px; height: 16px; cursor: pointer; fill: #888888; transition: fill 0.2s ease, transform 0.2s ease; } .awesomebot-console .rating svg:hover { fill: #555555; transform: scale(1.1); } .awesomebot-console .rating svg.rated { fill: #0073aa; transform: scale(1.0); } .awesomebot-console .rating.rated svg:not(.rated) { cursor: default; opacity: 0.3; }
.awesomebot-console .awesomebot-source-indicator { font-size: 10px; color: #777; display: inline-flex; align-items: center; gap: 3px; background-color: rgba(0,0,0,0.04); padding: 1px 5px; border-radius: 3px; line-height: 1.2; white-space: nowrap; cursor: default; font-weight: 500; } .awesomebot-console .awesomebot-source-indicator svg { width: 10px; height: 10px; fill: currentColor; opacity: 0.8; }
/* Console Input */
.awesomebot-console .console-input { padding: 16px 24px; border-top: 1px solid #e0e0e0; background: #fcfcfc; display: flex; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.awesomebot-console .console-input textarea { flex-grow: 1; padding: 10px 16px; border: 1px solid #ccd0d4; border-radius: 20px; font-size: 14px; resize: none; min-height: 44px; max-height: 150px; background: #FFFFFF; box-shadow: none; line-height: 1.5; overflow-y: auto; font-family: inherit; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.awesomebot-console .console-input textarea:focus { outline: none; border-color: #007cba; box-shadow: 0 0 0 1px #007cba; }
.awesomebot-console .console-button { padding: 6px 14px; cursor: pointer; font-size: 13px; line-height: normal; border-radius: 3px; text-decoration: none; white-space: nowrap; transition: background 0.1s ease-in-out, border-color 0.1s ease-in-out, color 0.1s ease-in-out, box-shadow 0.1s ease-in-out; }
.awesomebot-console button#console-submit { background: #0073aa; color: #FFFFFF; border: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.awesomebot-console button#console-submit svg { width: 20px; height: 20px; fill: #FFFFFF; }
.awesomebot-console button#console-submit:hover { background: #005a87; }
.awesomebot-console button#console-submit:disabled { background: #cccccc; cursor: not-allowed; }
.awesomebot-console button#console-transcript { background: #f6f7f7; color: #50575e; border: 1px solid #dcdcde; }
.awesomebot-console button#console-transcript:hover { background: #f0f0f1; border-color: #cacccd; color: #1d2327; }
.awesomebot-console button#console-transcript:disabled { opacity: 0.7; cursor: not-allowed; }


/* --- THEME OVERRIDES --- */

/* -- Widget: Dark Theme -- */
.theme-dark .awesomebot-chat-container { background: #2c3338; border-color: #444; }
.theme-dark .awesomebot-chat-header { background: #1e2428; color: #e0e0e0; border-bottom-color: #444; }
.theme-dark .awesomebot-chat-header-title { color: #f0f0f0 !important; /* Ensure override */ }
.theme-dark .awesomebot-header-button,
.theme-dark .awesomebot-close-button { color: #a0a0a0; }
.theme-dark .awesomebot-header-button:hover,
.theme-dark .awesomebot-close-button:hover { background-color: rgba(255, 255, 255, 0.1); color: #fff;}
.theme-dark .awesomebot-chat-message-container { background-color: #2c3338; }
.theme-dark .user-message { background: #007AFF; color: #FFFFFF; } /* Keep user message distinct */
.theme-dark .bot-message { background: #3a4146; color: #e0e0e0; }
.theme-dark .awesomebot-chat-input-container { background: #333a40; border-top-color: #444; }
.theme-dark .awesomebot-chat-input { background: #444c52; color: #e0e0e0; border-color: #555; }
.theme-dark .awesomebot-chat-input:focus { border-color: #007AFF; box-shadow: 0 0 0 1px #007AFF; }
.theme-dark .awesomebot-chat-btn-send { background: #007AFF; } .theme-dark .awesomebot-chat-btn-send:hover { background: #005fd9; }
.theme-dark .awesomebot-icon { background: #1e2428; color: #e0e0e0;} /* Set icon color too */
.theme-dark .rating svg { fill: #777; } .theme-dark .rating svg:hover { fill: #aaa; }
.theme-dark .rating svg.rated { fill: #007AFF; } .theme-dark .rating.rated svg:not(.rated) { opacity: 0.4; }
.theme-dark .bot-message a { color: #58a6ff; } .theme-dark .bot-message a:hover { color: #80baff; }
.theme-dark .awesomebot-source-indicator { background-color: rgba(255, 255, 255, 0.1); color: #aaa; }

/* -- Widget: Minimal Theme -- */
.theme-minimal .awesomebot-chat-container { background: #FFFFFF; border-color: #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.theme-minimal .awesomebot-chat-header { background: #FFFFFF; color: #1d2327; border-bottom-color: #e5e7eb; }
.theme-minimal .awesomebot-chat-header-title { color: #1d2327; }
.theme-minimal .awesomebot-header-button,
.theme-minimal .awesomebot-close-button { color: #50575e; }
.theme-minimal .awesomebot-header-button:hover,
.theme-minimal .awesomebot-close-button:hover { background-color: rgba(0, 0, 0, 0.05); }
.theme-minimal .awesomebot-chat-message-container { background-color: #fff; }
.theme-minimal .user-message { background: #f0f0f1; color: #1d2327; box-shadow: none; }
.theme-minimal .bot-message { background: #f6f7f7; color: #1d2327; box-shadow: none; border: 1px solid #e5e7eb;}
.theme-minimal .awesomebot-chat-input-container { background: #FFFFFF; border-top-color: #e5e7eb; }
.theme-minimal .awesomebot-chat-input { background: #f6f7f7; color: #1d2327; border-color: #e5e7eb; }
.theme-minimal .awesomebot-chat-input:focus { border-color: #0073aa; box-shadow: 0 0 0 1px #0073aa; }
.theme-minimal .awesomebot-chat-btn-send { background: #0073aa; }
.theme-minimal .awesomebot-chat-btn-send:hover { background: #005a87; }
.theme-minimal .awesomebot-icon { background: #0073aa; }
.theme-minimal .rating svg { fill: #999; } .theme-minimal .rating svg:hover { fill: #666; }
.theme-minimal .rating svg.rated { fill: #0073aa; } .theme-minimal .rating.rated svg:not(.rated) { opacity: 0.5; }
.theme-minimal .bot-message a { color: #0073aa; } .theme-minimal .bot-message a:hover { color: #005a87; }
.theme-minimal .awesomebot-source-indicator { background-color: #f0f0f1; color: #50575e; }

/* Add other widget theme overrides similarly... */

/* Primary color and alignment customizations */
.awesomebot-wrapper .awesomebot-chat-btn-send {
    background: var(--ab-primary, #0078ff) !important;
}
.awesomebot-wrapper .awesomebot-chat-btn-send:hover {
    filter: brightness(0.92);
}
.awesomebot-wrapper .awesomebot-chat-input {
    border: 1px solid #e0e0e0 !important;
}
.awesomebot-wrapper .awesomebot-chat-input:focus {
    border-color: var(--ab-primary, #0078ff) !important;
    box-shadow: 0 0 0 2px rgba(0, 120, 255, 0.18);
}
.awesomebot-wrapper .awesomebot-chat-header-title {
    color: var(--ab-primary, #0078ff) !important;
}
.awesomebot-wrapper .awesomebot-transcript-button,
.awesomebot-wrapper .awesomebot-close-button {
    color: var(--ab-primary, #0078ff);
}
/* Ensure transcript SVG inherits color */
.awesomebot-wrapper .awesomebot-transcript-button svg,
.awesomebot-wrapper .awesomebot-transcript-button svg path { fill: currentColor !important; }
/* Ensure header buttons align and match size */
.awesomebot-close-button {
    position: absolute;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2;
}
.awesomebot-transcript-button {
    position: absolute !important;
    top: 50% !important;
    right: 36px !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2;
}

/* Minimize button style and position */
.awesomebot-wrapper .awesomebot-minimize-button { position: absolute !important; top: 50% !important; right: 68px !important; transform: translateY(-50%) !important; width: 28px !important; height: 28px !important; color: var(--ab-primary, #0078ff) !important; display: flex !important; align-items: center !important; justify-content: center !important; z-index: 2; }
.awesomebot-wrapper .awesomebot-minimize-button svg, .awesomebot-wrapper .awesomebot-minimize-button svg path { fill: currentColor !important; }

/* --- Elfsight/Dribbble Inspired Theme --- */
.theme-elfsight .awesomebot-chat-container {
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    background: #fff;
    border: none;
    padding: 0;
    overflow: hidden;
}
.theme-elfsight .awesomebot-chat-header {
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    border-radius: 22px 22px 0 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 18px 22px 18px 18px;
    gap: 14px;
}
.theme-elfsight .awesomebot-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-right: 10px;
}
.theme-elfsight .awesomebot-header-avatar svg {
    width: 28px;
    height: 28px;
    display: block;
}
.theme-elfsight .awesomebot-chat-header-title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin-left: 0;
}
.theme-elfsight .awesomebot-close-button {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    padding: 7px;
    transition: background 0.2s;
}
.theme-elfsight .awesomebot-close-button:hover {
    background: rgba(255,255,255,0.12);
}
.theme-elfsight .awesomebot-chat-message-container, .theme-elfsight .awesomebot-chat-messages {
    background: #f4f8fd;
    flex: 1;
    padding: 20px 16px 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.theme-elfsight .bot-message, .theme-elfsight .awesomebot-message-bot .awesomebot-message-content {
    align-self: flex-start;
    background: #fff;
    color: #0078ff;
    border-radius: 18px 18px 18px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 13px 18px;
    max-width: 82%;
    font-size: 15.5px;
    margin-bottom: 2px;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.theme-elfsight .user-message, .theme-elfsight .awesomebot-message-user .awesomebot-message-content {
    align-self: flex-end;
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    border-radius: 18px 18px 6px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 13px 18px;
    max-width: 82%;
    font-size: 15.5px;
    margin-bottom: 2px;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.theme-elfsight .awesomebot-message-time {
    font-size: 12px;
    color: #a0a0a0;
    margin: 2px 0 8px 4px;
}
.theme-elfsight .awesomebot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0 0 2px;
    height: 22px;
}
.theme-elfsight .awesomebot-typing-dot {
    width: 7px;
    height: 7px;
    background: #b3d1ff;
    border-radius: 50%;
    animation: awesomebot-typing-bounce 1.2s infinite both;
}
.theme-elfsight .awesomebot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.theme-elfsight .awesomebot-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes awesomebot-typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.7; }
    40% { transform: scale(1.2); opacity: 1; }
}
.theme-elfsight .awesomebot-chat-input, .theme-elfsight .awesomebot-chat-input-container {
    background: #f4f8fd;
    border-top: 1px solid #e0e0e0;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.theme-elfsight .awesomebot-chat-textarea {
    flex: 1;
    border: none;
    border-radius: 16px;
    padding: 11px 15px;
    font-size: 15.5px;
    background: #fff;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    resize: none;
    min-height: 38px;
    max-height: 90px;
    outline: none;
    transition: box-shadow 0.2s;
}
.theme-elfsight .awesomebot-chat-textarea:focus {
    box-shadow: 0 0 0 2px #0078ff33;
}
.theme-elfsight .awesomebot-chat-submit {
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.theme-elfsight .awesomebot-chat-submit:hover {
    background: linear-gradient(90deg, #005fd9 0%, #00aaff 100%);
}
.theme-elfsight .awesomebot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 10px 0 0 0;
}
.theme-elfsight .awesomebot-quick-reply {
    background: #eaf3ff;
    color: #0078ff;
    border: none;
    border-radius: 15px;
    padding: 8px 18px;
    font-size: 14.5px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.theme-elfsight .awesomebot-quick-reply:hover {
    background: #d2eaff;
    color: #005fd9;
}
.theme-elfsight .awesomebot-wrapper,
.theme-elfsight .awesomebot-chat-container {
    min-height: 600px;
    height: 600px;
    max-height: 90vh;
    box-sizing: border-box;
}
.theme-elfsight .awesomebot-chat-inner-container {
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
}
.theme-elfsight .awesomebot-chat-header {
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.theme-elfsight .awesomebot-chat-message-container {
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 18px;
    padding-bottom: 0;
    margin: 0;
    overflow-y: auto;
}
.theme-elfsight .awesomebot-chat-input-container {
    padding: 0;
    margin: 0;
    border-radius: 0 0 22px 22px;
    background: #f4f8fd;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
    height: 64px;
}
.theme-elfsight .awesomebot-chat-input-form {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    height: 100%;
}
.theme-elfsight .awesomebot-chat-input {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    border-radius: 18px 0 0 18px;
    padding: 0 18px;
    font-size: 15.5px;
    background: #fff;
    color: #222;
    min-height: 44px;
    height: 44px;
    max-height: 44px;
    outline: none;
    resize: none;
    margin: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
}
.theme-elfsight .awesomebot-chat-btn-send {
    border: none;
    border-radius: 0 18px 18px 0;
    margin: 0;
    height: 44px;
    min-width: 56px;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    background: linear-gradient(90deg, #0078ff 0%, #00c6ff 100%);
    color: #fff;
    box-shadow: none;
    transition: background 0.2s;
    position: relative;
    right: 0;
    top: 0;
}
.theme-elfsight .awesomebot-chat-btn-send:hover {
    background: linear-gradient(90deg, #005fd9 0%, #00aaff 100%);
}
@media (max-width: 600px) {
    .theme-elfsight .awesomebot-wrapper, .theme-elfsight .awesomebot-chat-container {
        min-height: 90vh;
        height: 90vh;
        max-height: 100vh;
    }
    .theme-elfsight .awesomebot-chat-input-container {
        height: 56px;
    }
    .theme-elfsight .awesomebot-chat-input {
        border-radius: 12px 0 0 12px;
        padding: 0 12px;
        height: 36px;
        max-height: 36px;
    }
    .theme-elfsight .awesomebot-chat-btn-send {
        border-radius: 0 12px 12px 0;
        height: 36px;
        min-width: 44px;
        width: 44px;
    }
}


/* -- Console: Dark Theme -- */
.awesomebot-console.console-theme-dark { background: #1e1e1e; color: #dcdcdc; border-color: #3c3c3c; }
.awesomebot-console.console-theme-dark .console-header { background: #252526; border-bottom-color: #3c3c3c; }
.awesomebot-console.console-theme-dark .console-title-wrap h2 { color: #dcdcdc; }
.awesomebot-console.console-theme-dark .console-title-wrap .console-subtitle { color: #a0a0a0; }
.awesomebot-console.console-theme-dark .console-messages { background: #1e1e1e; }
.awesomebot-console.console-theme-dark .user-message { background: var(--ab-console-primary, #0e639c) !important; color: #ffffff !important; }
.awesomebot-console.console-theme-dark .bot-message { background: #252526; color: #dcdcdc; border-color: #3c3c3c; }
.awesomebot-console.console-theme-dark .console-input { background: #252526; border-top-color: #3c3c3c; }
.awesomebot-console.console-theme-dark .console-input textarea { background: #3c3c3c; color: #dcdcdc; border-color: #555; }
.awesomebot-console.console-theme-dark .console-input textarea:focus { border-color: #0e639c; box-shadow: 0 0 0 1px #0e639c; background: #3c3c3c; }
.awesomebot-console.console-theme-dark .console-button { background: #3c3c3c; border-color: #555; color: #ccc; }
.awesomebot-console.console-theme-dark .console-button:hover { background: #5f6368; border-color: #777; color: #fff; }
.awesomebot-console.console-theme-dark button#console-submit { background: #0e639c; }
.awesomebot-console.console-theme-dark button#console-submit:hover { background: #1c7ec3; }
.awesomebot-console.console-theme-dark .rating svg { fill: #888; } .awesomebot-console.console-theme-dark .rating svg:hover { fill: #ccc; } .awesomebot-console.console-theme-dark .rating svg.rated { fill: #0e639c; }
.awesomebot-console.console-theme-dark a { color: #60afff; } .awesomebot-console.console-theme-dark a:hover { color: #80bfff; }
.awesomebot-console.console-theme-dark .awesomebot-source-indicator { background-color: #444c52; color: #aaa; }

/* -- Console: Minimal Theme -- */
.awesomebot-console.console-theme-minimal { border: 1px solid #e0e0e0; border-radius: 0; background: #fff; box-shadow: none;}
.awesomebot-console.console-theme-minimal .console-header { background: transparent; border-bottom: 1px solid #eee; padding-left: 0; padding-right: 0;}
.awesomebot-console.console-theme-minimal .console-messages { background: #fff; padding: 15px; }
.awesomebot-console.console-theme-minimal .user-message, .awesomebot-console.console-theme-minimal .bot-message { border-radius: 5px; box-shadow: none; border: 1px solid #eee; }
.awesomebot-console.console-theme-minimal .user-message { background: var(--ab-console-primary, #0073aa) !important; color: #ffffff !important; }
.awesomebot-console.console-theme-minimal .bot-message { background: #ffffff; color: #1d2327; }
.awesomebot-console.console-theme-minimal .console-input { background: transparent; border-top: 1px solid #eee; padding: 16px 0; }
.awesomebot-console.console-theme-minimal .console-input textarea { border-color: #dcdcde; background: #f6f7f7; }
.awesomebot-console.console-theme-minimal .console-input textarea:focus { background: #fff; border-color: #007cba; box-shadow: 0 0 0 1px #007cba; }
.awesomebot-console.console-theme-minimal .console-button { background: #f6f7f7; border-color: #dcdcde; color: #50575e; }
.awesomebot-console.console-theme-minimal .console-button:hover { background: #eaeaec; border-color: #caccd0; color: #1d2327; }
.awesomebot-console.console-theme-minimal button#console-submit { background: #0073aa; }
.awesomebot-console.console-theme-minimal button#console-submit:hover { background: #005a87; }
.awesomebot-console.console-theme-minimal .rating svg { fill: #9ca1a6; } .awesomebot-console.console-theme-minimal .rating svg:hover { fill: #50575e; } .awesomebot-console.console-theme-minimal .rating svg.rated { fill: #0073aa; }
.awesomebot-console.console-theme-minimal a { color: #0073aa; } .awesomebot-console.console-theme-minimal a:hover { color: #005a87; }
.awesomebot-console.console-theme-minimal .awesomebot-source-indicator { background-color: #f0f0f1; color: #50575e; }

/* -- Console: Glass Theme -- */
.awesomebot-console.console-theme-glass { background: rgba(255,255,255,0.75); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); border: 1px solid rgba(200, 220, 255, 0.22); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.awesomebot-console.console-theme-glass .console-header { background: rgba(245,250,255,0.65); border-bottom: 1px solid rgba(200,220,255,0.22); }
.awesomebot-console.console-theme-glass .console-messages { background: transparent; }
.awesomebot-console.console-theme-glass .user-message { background: var(--ab-console-primary, #0073aa) !important; color: #ffffff !important; box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.awesomebot-console.console-theme-glass .bot-message { background: rgba(255,255,255,0.82); border: 1px solid rgba(220, 224, 230, 0.8); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.awesomebot-console.console-theme-glass .console-input { background: rgba(255,255,255,0.72); border-top: 1px solid rgba(200,220,255,0.22); }
.awesomebot-console.console-theme-glass .console-input textarea { background: rgba(255,255,255,0.92); }

/* -- Console: Gradient Theme -- */
.awesomebot-console.console-theme-gradient { background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 50%, #f9f0ff 100%); border: 1px solid #ececec; }
.awesomebot-console.console-theme-gradient .console-header { background: linear-gradient(90deg, var(--ab-console-primary, #0073aa), color-mix(in srgb, var(--ab-console-primary, #0073aa) 30%, #ffffff)); color: #fff; border-bottom: none; }
.awesomebot-console.console-theme-gradient .console-title-wrap h2, .awesomebot-console.console-theme-gradient .console-title-wrap .console-subtitle { color: #fff; }
.awesomebot-console.console-theme-gradient .console-messages { background: transparent; }
.awesomebot-console.console-theme-gradient .user-message { background: rgba(255,255,255,0.95) !important; color: #1d2327 !important; }
.awesomebot-console.console-theme-gradient .bot-message { background: rgba(255,255,255,0.9); border: 1px solid #e6e6e6; }
.awesomebot-console.console-theme-gradient button#console-submit { background: #ffffff; color: var(--ab-console-primary, #0073aa); }
.awesomebot-console.console-theme-gradient button#console-submit svg { fill: currentColor; }

/* -- Console: Neumorphic Theme -- */
.awesomebot-console.console-theme-neumorphic { background: #eef2f7; border: 1px solid #e6ebf0; box-shadow: 9px 9px 16px #c7cbd0, -9px -9px 16px #ffffff; }
.awesomebot-console.console-theme-neumorphic .console-header { background: #eef2f7; border-bottom: 1px solid #e6ebf0; }
.awesomebot-console.console-theme-neumorphic .console-messages { background: #eef2f7; }
.awesomebot-console.console-theme-neumorphic .user-message { background: var(--ab-console-primary, #0073aa) !important; color: #ffffff !important; box-shadow: inset 1px 1px 0 rgba(255,255,255,0.3), 6px 6px 12px rgba(0,0,0,0.08); }
.awesomebot-console.console-theme-neumorphic .bot-message { background: #f6f9fc; border: 1px solid #e6ebf0; box-shadow: inset 1px 1px 0 rgba(255,255,255,0.3), 6px 6px 12px rgba(0,0,0,0.06); }
.awesomebot-console.console-theme-neumorphic .console-input { background: #eef2f7; border-top: 1px solid #e6ebf0; }
.awesomebot-console.console-theme-neumorphic .console-input textarea { background: #f6f9fc; border-color: #e1e6eb; }

.awesomebot-connection-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
  min-height: 20px;
}
.connection-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
  background: #ccc;
}
.connection-dot.connected { background: #00a32a; }
.connection-dot.disconnected { background: #d63638; }
.connection-dot.connecting { background: #ffb900; }
.connection-label { margin-right: 10px; font-weight: 500; }

/* Suggested Questions Grid */
.awesomebot-suggested-questions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px 0 2px 0;
}
.awesomebot-suggested-questions-button {
    font-size: 13px;
    line-height: 1.3;
    padding: 8px 10px;
    background: color-mix(in srgb, var(--ab-console-primary, #0073aa) 12%, #ffffff);
    color: #1d2327;
    border: 1px solid color-mix(in srgb, var(--ab-console-primary, #0073aa) 30%, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}
.awesomebot-suggested-questions-button:hover {
    background: color-mix(in srgb, var(--ab-console-primary, #0073aa) 20%, #ffffff);
}

.awesomebot-welcome {
    grid-column: 1 / -1;
    margin: 2px 0 4px 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

/* --- SaaS Glassmorphism Theme (Dribbble-inspired) --- */
.theme-saas-glass .awesomebot-chat-container {
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1.5px solid rgba(200, 220, 255, 0.18);
    overflow: hidden;
    padding: 0;
}
.theme-saas-glass .awesomebot-chat-header {
    background: rgba(245, 250, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(200,220,255,0.18);
    color: #1a2340;
    border-radius: 22px 22px 0 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px 18px 18px;
    position: relative;
}
.theme-saas-glass .awesomebot-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px 0 #b3d1ff44, 0 0 0 3px #eaf3ff;
    margin-right: 10px;
    position: relative;
}
.theme-saas-glass .awesomebot-header-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background: #3ecf4a;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px #3ecf4a88;
}
.theme-saas-glass .awesomebot-chat-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a2340;
    margin-left: 0;
}
.theme-saas-glass .awesomebot-close-button {
    margin-left: auto;
    background: rgba(255,255,255,0.7);
    border: none;
    color: #1a2340;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    padding: 7px;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.theme-saas-glass .awesomebot-close-button:hover {
    background: #eaf3ff;
}
.theme-saas-glass .awesomebot-chat-message-container, .theme-saas-glass .awesomebot-chat-messages {
    background: transparent;
    flex: 1;
    padding: 20px 16px 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.theme-saas-glass .bot-message, .theme-saas-glass .awesomebot-message-bot .awesomebot-message-content {
    align-self: flex-start;
    background: rgba(245,250,255,0.85);
    color: #1a2340;
    border-radius: 18px 18px 18px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 13px 18px;
    max-width: 82%;
    font-size: 15.5px;
    margin-bottom: 2px;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    backdrop-filter: blur(6px) saturate(120%);
}
.theme-saas-glass .user-message, .theme-saas-glass .awesomebot-message-user .awesomebot-message-content {
    align-self: flex-end;
    background: linear-gradient(90deg, #4f8cff 0%, #7fd7ff 100%);
    color: #fff;
    border-radius: 18px 18px 6px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 13px 18px;
    max-width: 82%;
    font-size: 15.5px;
    margin-bottom: 2px;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    backdrop-filter: blur(4px) saturate(120%);
}
.theme-saas-glass .awesomebot-message-time {
    font-size: 12px;
    color: #a0a0a0;
    margin: 2px 0 8px 4px;
}
.theme-saas-glass .awesomebot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0 0 2px;
    height: 22px;
}
.theme-saas-glass .awesomebot-typing-dot {
    width: 7px;
    height: 7px;
    background: #b3d1ff;
    border-radius: 50%;
    animation: awesomebot-typing-bounce 1.2s infinite both;
}
.theme-saas-glass .awesomebot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.theme-saas-glass .awesomebot-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes awesomebot-typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.7; }
    40% { transform: scale(1.2); opacity: 1; }
}
.theme-saas-glass .awesomebot-chat-input-container {
    background: rgba(245,250,255,0.7);
    border-top: 1px solid rgba(200,220,255,0.18);
    padding: 0;
    margin: 0;
    border-radius: 0 0 22px 22px;
    display: flex;
    align-items: center;
    gap: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
    height: 64px;
}
.theme-saas-glass .awesomebot-chat-input-form {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    height: 100%;
}
.theme-saas-glass .awesomebot-chat-input {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    border-radius: 18px 0 0 18px;
    padding: 0 18px;
    font-size: 15.5px;
    background: rgba(255,255,255,0.95);
    color: #222;
    min-height: 44px;
    height: 44px;
    max-height: 44px;
    outline: none;
    resize: none;
    margin: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
}
.theme-saas-glass .awesomebot-chat-btn-send {
    border: none;
    border-radius: 0 18px 18px 0;
    margin: 0;
    height: 44px;
    min-width: 56px;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    background: linear-gradient(90deg, #4f8cff 0%, #7fd7ff 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s;
    position: relative;
    right: 0;
    top: 0;
}
.theme-saas-glass .awesomebot-chat-btn-send:hover {
    background: linear-gradient(90deg, #3a6fd9 0%, #5fcfff 100%);
}
@media (max-width: 600px) {
    .theme-saas-glass .awesomebot-wrapper, .theme-saas-glass .awesomebot-chat-container {
        min-height: 90vh;
        height: 90vh;
        max-height: 100vh;
    }
    .theme-saas-glass .awesomebot-chat-input-container {
        height: 56px;
    }
    .theme-saas-glass .awesomebot-chat-input {
        border-radius: 12px 0 0 12px;
        padding: 0 12px;
        height: 36px;
        max-height: 36px;
    }
    .theme-saas-glass .awesomebot-chat-btn-send {
        border-radius: 0 12px 12px 0;
        height: 36px;
        min-width: 44px;
        width: 44px;
    }
}

/* Thinking Indicator */
.thinking-indicator { opacity: 0.8; padding: 14px 15px !important; min-height: 1.5em; }
.thinking-indicator span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; background-color: currentColor; opacity: 0.6; border-radius: 50%; animation: awesomebot-dot-bounce 1.3s infinite ease-in-out both; }
.thinking-indicator span:nth-child(1) { animation-delay: -0.30s; }
.thinking-indicator span:nth-child(2) { animation-delay: -0.15s; }
.thinking-indicator span:nth-child(3) { animation-delay: 0s; }

/* Enhanced Thinking Indicator */
.enhanced-thinking {
    padding: 16px !important;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid #e0e8ff;
    border-radius: 12px;
    max-width: 90%;
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thinking-animation {
    display: flex;
    gap: 4px;
}

.thinking-animation span {
    width: 8px;
    height: 8px;
    background: #0078ff;
    border-radius: 50%;
    animation: awesomebot-thinking-bounce 1.4s infinite ease-in-out both;
}

.thinking-animation span:nth-child(1) { animation-delay: -0.32s; }
.thinking-animation span:nth-child(2) { animation-delay: -0.16s; }
.thinking-animation span:nth-child(3) { animation-delay: 0s; }

@keyframes awesomebot-thinking-bounce {
    0%, 80%, 100% { 
        transform: scale(0.7);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

.thinking-status {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.status-text {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
    flex: 1;
}

.status-time {
    font-size: 12px;
    color: #718096;
    font-weight: 400;
    padding: 2px 6px;
    background: rgba(0, 120, 255, 0.1);
    border-radius: 8px;
    min-width: 28px;
    text-align: center;
}

.cancel-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
    font-weight: bold;
}

.cancel-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Taking too long styling */
.taking-long {
    background: linear-gradient(135deg, #fff8f0 0%, #fff4e6 100%);
    border-color: #fed7aa;
}

.taking-long .status-text {
    color: #c2410c;
}

.taking-long .status-time {
    background: rgba(234, 88, 12, 0.15);
    color: #c2410c;
}

.taking-long .thinking-animation span {
    background: #ea580c;
}

/* Error Messages */
.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border: 1px solid #fecaca;
    color: #991b1b !important;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-icon {
    font-size: 20px;
    opacity: 0.8;
}

.error-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.retry-btn:hover {
    background: #b91c1c;
}

/* Cancelled Message */
.cancelled-message {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border: 1px solid #d1d5db;
    color: #6b7280 !important;
    font-style: italic;
    text-align: center;
    opacity: 0.8;
}

/* Toast */
.awesomebot-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 99999;
    font-size: 14px;
}
.awesomebot-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.awesomebot-toast.success { background: #065f46; }
.awesomebot-toast.error { background: #991b1b; }

/* --- FINAL OVERRIDES: Primary color + header alignment (highest priority) --- */
.awesomebot-wrapper .awesomebot-chat-btn-send { background: var(--ab-primary, #0078ff) !important; }
.awesomebot-wrapper .awesomebot-chat-btn-send:hover { filter: brightness(0.92) !important; }
.awesomebot-wrapper .awesomebot-chat-input { border: 1px solid #e0e0e0 !important; }
.awesomebot-wrapper .awesomebot-chat-input:focus { border-color: var(--ab-primary, #0078ff) !important; box-shadow: 0 0 0 2px rgba(0,120,255,.18) !important; }
.awesomebot-wrapper .awesomebot-chat-header-title { color: var(--ab-primary, #0078ff) !important; }
.awesomebot-wrapper .awesomebot-transcript-button, .awesomebot-wrapper .awesomebot-close-button, .awesomebot-wrapper .awesomebot-minimize-button { color: var(--ab-primary, #0078ff) !important; }
.awesomebot-wrapper .awesomebot-transcript-button svg, .awesomebot-wrapper .awesomebot-transcript-button svg path { fill: currentColor !important; }
/* Place transcript and close buttons side by side at right */
.awesomebot-wrapper .awesomebot-transcript-button { position: absolute !important; top: 50% !important; right: 40px !important; transform: translateY(-50%) !important; width: 28px !important; height: 28px !important; display: flex !important; align-items: center !important; justify-content: center !important; z-index: 2; }
.awesomebot-wrapper .awesomebot-close-button { position: absolute !important; top: 50% !important; right: 8px !important; transform: translateY(-50%) !important; width: 28px !important; height: 28px !important; display: flex !important; align-items: center !important; justify-content: center !important; z-index: 2; }
/* Match container/header radius for a blended look */
.awesomebot-wrapper .awesomebot-chat-container { border-radius: 12px !important; overflow: hidden !important; }
.awesomebot-wrapper .awesomebot-chat-header { border-radius: 12px 12px 0 0 !important; }
.awesomebot-wrapper .awesomebot-chat-input-container { border-radius: 0 0 12px 12px !important; }

/* Header layout tweaks for centered title */
.awesomebot-chat-header { display: flex; align-items: center; justify-content: space-between; }
.awesomebot-chat-header .awesomebot-chat-header-title { flex: 1 1 auto; text-align: center; margin: 0; }
.awesomebot-chat-header .awesomebot-header-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.awesomebot-chat-logo { height: 50px !important; width: auto !important; margin-right: 8px !important; }
/* Adjust header buttons when grouped */
.awesomebot-wrapper .awesomebot-minimize-button,
.awesomebot-wrapper .awesomebot-transcript-button,
.awesomebot-wrapper .awesomebot-close-button { position: relative !important; right: auto !important; top: auto !important; transform: none !important; }

/* Unified sizing for entire widget */
.awesomebot-wrapper { width: var(--ab-w, 360px) !important; height: var(--ab-h, 600px) !important; border-radius: 12px !important; overflow: hidden !important; }
.awesomebot-chat-container { width: var(--ab-w, 360px) !important; height: var(--ab-h, 600px) !important; box-sizing: border-box !important; border-radius: 12px !important; overflow: hidden !important; }
.awesomebot-chat-inner-container { display: flex !important; flex-direction: column !important; height: 100% !important; }
.awesomebot-chat-header { flex-shrink: 0; }
.awesomebot-chat-message-container { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; }
.awesomebot-chat-input-container { flex-shrink: 0 !important; }