/* AI Chatbot Styles for Maheshwari Digitech */

:root {
    --primary-color: #4b88ff;
    --accent-color: #d3d703;
    --bg-dark: #1c1d1f;
    --bg-darker: #0a0a0b;
    --white: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #ffffffb5;
    --text-muted: #ffffff80;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --border-color: #ffffff21;
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3);
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 20px;
    --radius-xl: 30px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Remove body styles that might conflict with main site */

/* Chatbot Container - Complete CSS Isolation */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    /* Create a new stacking context and isolate from parent styles */
    isolation: isolate;
    contain: layout style;
    /* Reset all text properties to prevent inheritance */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-size: 14px !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: 0px !important;
    word-spacing: 0px !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

/* Complete CSS reset for all chatbot elements - EXCEPT Font Awesome icons */
.chatbot-container *:not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.chatbot-container *:not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"])::before,
.chatbot-container *:not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"])::after {
    /* Reset all possible text properties */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-variant: normal !important;
    font-variant-caps: normal !important;
    font-variant-numeric: normal !important;
    font-variant-ligatures: normal !important;
    font-stretch: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-indent: 0px !important;
    text-shadow: none !important;
    letter-spacing: 0px !important;
    word-spacing: 0px !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    text-align: left !important;
    text-justify: none !important;
    text-overflow: clip !important;
    box-sizing: border-box !important;
    /* Reset any potential CSS animations or transitions on text */
    animation: none !important;
    transition: none !important;
}

/* Preserve Font Awesome icons */
.chatbot-container .fas,
.chatbot-container .far,
.chatbot-container .fab,
.chatbot-container .fal,
.chatbot-container .fad,
.chatbot-container [class*="fa-"] {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro", "Font Awesome 5 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    white-space: nowrap !important;
    text-rendering: auto !important;
    display: inline-block !important;
}

.chatbot-window {
    width: 380px;
    height: 600px;
    background: linear-gradient(135deg, rgba(28, 29, 31, 0.95) 0%, rgba(10, 10, 11, 0.98) 100%);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateY(calc(100% + 100px));
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    bottom: 80px;
    right: 0;
}

.chatbot-window.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Chatbot Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-title i {
    font-size: 18px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.chatbot-close {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.chatbot-message {
    display: flex;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 12px;
    margin-top: 2px;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: var(--success-color);
    color: var(--white);
    margin-right: 0;
    margin-left: 12px;
}

.user-message .message-avatar::after {
    content: '\f007';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.message-content {
    flex: 1;
    max-width: 80%;
}

.user-message .message-content {
    text-align: right;
}

.user-message .message-content .message-text {
    text-align: left;
    white-space: normal;
    letter-spacing: normal;
    word-spacing: normal;
}

.message-content p {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 4px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.user-message .message-content p {
    background: linear-gradient(135deg, var(--primary-color), #5a9cff);
    color: var(--white);
    border-radius: 18px 18px 4px 18px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(75, 136, 255, 0.3);
}

.bot-message .message-content p {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: none;
}

.bot-message .message-content p strong {
    color: var(--accent-color);
    font-weight: 600;
}

.bot-message .message-content p br {
    line-height: 1.8;
}

/* Message Text Formatting */
.message-text {
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 4px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.bot-message .message-text {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-message .message-text {
    background: linear-gradient(135deg, var(--primary-color), #5a9cff);
    color: var(--white);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(75, 136, 255, 0.3);
    white-space: normal;
    letter-spacing: normal;
    word-spacing: normal;
    text-align: left;
}

.message-text strong {
    color: var(--accent-color);
    font-weight: 600;
}

.message-text .price {
    color: var(--accent-color);
    font-weight: 600;
}

/* Fix user input display issues */
.user-message .message-text,
.user-message .message-content p {
    white-space: normal !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-align: left !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
}

/* Ensure proper text rendering for all messages */
.chatbot-message .message-text,
.chatbot-message .message-content p {
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    font-style: normal;
}

/* CRITICAL FIX: User message text display - Override everything */
.chatbot-container .user-message .message-text,
.chatbot-window .user-message .message-text,
.user-message .message-text {
    display: block !important;
    white-space: normal !important;
    letter-spacing: 0px !important;
    word-spacing: 0px !important;
    text-align: left !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: white !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    text-transform: none !important;
    font-variant: normal !important;
    font-style: normal !important;
    font-weight: normal !important;
    text-decoration: none !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    font-stretch: normal !important;
    font-variant-caps: normal !important;
    font-variant-numeric: normal !important;
    font-variant-ligatures: normal !important;
}

/* Additional reset for any nested elements */
.chatbot-container .user-message .message-text *,
.chatbot-window .user-message .message-text *,
.user-message .message-text * {
    letter-spacing: 0px !important;
    word-spacing: 0px !important;
    white-space: normal !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    text-transform: none !important;
    font-variant: normal !important;
}

/* Nuclear option: Force normal text rendering for user messages */
.chatbot-container .user-message,
.chatbot-container .user-message *,
.chatbot-window .user-message,
.chatbot-window .user-message * {
    font-feature-settings: normal !important;
    font-kerning: normal !important;
    font-optical-sizing: auto !important;
    font-synthesis: weight style !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* FINAL FIX: Override any possible CSS that could cause character spacing */
.chatbot-container .user-message .message-text {
    /* Text content and spacing */
    content: normal !important;
    quotes: none !important;
    counter-reset: none !important;
    counter-increment: none !important;

    /* Display and positioning */
    display: block !important;
    position: static !important;
    float: none !important;
    clear: none !important;

    /* Text properties - most comprehensive reset possible */
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: white !important;
    text-align: left !important;
    vertical-align: baseline !important;

    /* Spacing - force to zero */
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    text-indent: 0 !important;

    /* Text behavior */
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;

    /* Remove any transforms or effects */
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    text-shadow: none !important;

    /* Reset any grid or flex properties that might affect text */
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-gap: 0 !important;
    gap: 0 !important;
    column-gap: 0 !important;
    row-gap: 0 !important;

    /* CRITICAL: Prevent column layout and character splitting */
    columns: auto !important;
    column-count: auto !important;
    column-width: auto !important;
    column-gap: normal !important;
    column-rule: none !important;
    column-fill: balance !important;
    column-span: none !important;

    /* Force single line display for single words */
    white-space: nowrap !important;
    display: inline-block !important;
    width: auto !important;

    /* Prevent any text manipulation */
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    unicode-bidi: normal !important;

    /* Disable animations that might split text */
    animation: none !important;
    transition: none !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    animation-play-state: paused !important;
}

/* Reset any inherited styles that might cause spacing issues */
.chatbot-window * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.chatbot-window .user-message .message-text * {
    letter-spacing: inherit !important;
    word-spacing: inherit !important;
}

/* CRITICAL: Prevent user message container from using column or flex layout */
.chatbot-container .user-message .message-content,
.chatbot-window .user-message .message-content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    columns: auto !important;
    column-count: auto !important;
}

/* Force user message text to display as single block */
.chatbot-container .user-message .message-text,
.chatbot-window .user-message .message-text {
    flex: 0 0 auto !important;
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    width: auto !important;
    height: auto !important;
}

/* Message Suggestions */
.message-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.suggestion-btn {
    background: rgba(75, 136, 255, 0.2);
    border: 1px solid rgba(75, 136, 255, 0.3);
    border-radius: 16px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(75, 136, 255, 0.3);
}

@media (max-width: 768px) {
    .suggestion-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

.user-message .message-time {
    text-align: right;
}

/* Quick Actions */
.quick-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-s);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 10px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    animation: slideIn 0.3s ease-out;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    margin-right: 4px;
    animation: typing 1.4s ease-in-out infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chatbot Input */
.chatbot-input-container {
    border-top: 1px solid var(--border-color);
    padding: 15px 20px 10px;
}

.chatbot-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.chatbot-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(75, 136, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

#chatbot-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
    word-wrap: break-word;
}

#chatbot-input::placeholder {
    color: var(--text-muted);
}

#chatbot-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

#chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(75, 136, 255, 0.3);
}

#chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    text-align: center;
    margin-top: 8px;
}

.powered-by {
    font-size: 10px;
    color: var(--text-muted);
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    animation: float 3s ease-in-out infinite;
    border: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.chatbot-toggle:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 25px 50px rgba(75, 136, 255, 0.4);
}

.chatbot-toggle.active {
    background: var(--error-color);
}

.chatbot-toggle.active i::before {
    content: '\f00d';
    /* fa-times */
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--error-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.notification-badge.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
        left: 15px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: 0;
        left: 0;
        margin: 0 auto;
        border-radius: var(--radius-m);
        max-height: 600px;
    }

    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        position: fixed;
        width: 55px;
        height: 55px;
        font-size: 20px;
    }

    .chatbot-header {
        padding: 12px 16px;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .message-content {
        max-width: 85%;
    }

    .message-content p {
        font-size: 14px;
        padding: 10px 14px;
        line-height: 1.4;
    }

    .chatbot-input-container {
        padding: 12px 16px 8px;
    }

    #chatbot-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 10px 12px;
    }

    .quick-actions {
        padding: 10px 16px;
        gap: 6px;
    }

    .quick-action-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    right: 15px;
    width: 55px;
    height: 55px;
    font-size: 20px;
}
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: -20px;
        border-radius: 0;
    }

    .chatbot-header {
        border-radius: 0;
    }

    .chatbot-container {
        right: 0;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Message Types */
.message.error .message-content p {
    background: var(--error-color);
    color: var(--white);
}

.message.success .message-content p {
    background: var(--success-color);
    color: var(--white);
}

.message.warning .message-content p {
    background: var(--warning-color);
    color: var(--bg-dark);
}

/* Message Suggestions */
.message-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.suggestion-btn {
    background: rgba(75, 136, 255, 0.15);
    border: 1px solid rgba(75, 136, 255, 0.4);
    border-radius: 16px;
    padding: 6px 12px;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.suggestion-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(75, 136, 255, 0.4);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: var(--bg-dark);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(211, 215, 3, 0.3);
}

/* E
nhanced word wrapping for user messages */
.user-message .message-text {
    /* Force proper text wrapping for long messages */
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;

    /* Prevent horizontal overflow */
    overflow-x: hidden !important;

    /* Ensure text doesn't go outside container */
    display: block !important;

    /* Better line breaking for long words */
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

/* Ensure message content container doesn't overflow */
.user-message .message-content {
    max-width: 80% !important;
    width: 80% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Bot message improvements */
.bot-message .message-text {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.bot-message .message-content {
    max-width: 85% !important;
    overflow: hidden !important;
}

/* Ensure chatbot messages container doesn't allow horizontal scroll */
.chatbot-messages {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    word-wrap: break-word !important;
}

/* Fix for very long words or URLs */
.chatbot-message .message-text * {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
}

/ * Enhanced word wrapping for user messages - CRITICAL FIX */ .user-message .message-text {
    /* Force proper text wrapping for long messages */
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;

    /* Prevent horizontal overflow */
    overflow-x: hidden !important;

    /* Ensure text doesn't go outside container */
    display: block !important;

    /* Better line breaking for long words */
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

/* Ensure message content container doesn't overflow */
.user-message .message-content {
    max-width: 80% !important;
    width: 80% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Bot message improvements */
.bot-message .message-text {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.bot-message .message-content {
    max-width: 85% !important;
    overflow: hidden !important;
}

/* Ensure chatbot messages container doesn't allow horizontal scroll */
.chatbot-messages {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    word-wrap: break-word !important;
}

/* Fix for very long words or URLs */
.chatbot-message .message-text * {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
}

/* Additional fix for user message display */
.user-message .message-text,
.user-message .message-content p {
    /* Override any inherited styles that prevent wrapping */
    white-space: pre-wrap !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    font-variant: normal !important;
    text-transform: none !important;

    /* Ensure proper breaking */
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;

    /* Container constraints */
    max-width: 100% !important;
    width: auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Force word wrapping on all chatbot text elements */
.chatbot-container * {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Specific fix for user input that appears as single line */
.chatbot-message.user-message .message-text {
    /* Critical: Override any inline styles or inherited properties */
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;

    /* Ensure container respects boundaries */
    max-width: calc(100% - 20px) !important;
    width: auto !important;
    display: block !important;

    /* Force line breaks for long continuous text */
    word-break: break-all !important;
    line-break: anywhere !important;
}

/* CR
ITICAL FIX: Override all possible text display issues for user messages */
.chatbot-container .user-message .message-text,
.chatbot-container .user-message .message-content .message-text,
.chatbot-container .chatbot-message.user-message .message-text {
    /* Force text wrapping with maximum priority */
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;

    /* Container constraints */
    max-width: 100% !important;
    width: auto !important;
    display: block !important;
    box-sizing: border-box !important;

    /* Override any font or text properties that might cause issues */
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    font-variant: normal !important;

    /* Force breaking of long words */
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    line-break: anywhere !important;
}

/* Ensure the message content div also respects boundaries */
.chatbot-container .user-message .message-content {
    max-width: 80% !important;
    width: 80% !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
}

/* Additional fix for any remaining single-line issues */
.chatbot-window .user-message .message-text {
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
}