.tuta-chat-widget {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: block !important;
    visibility: visible !important;
}

.tuta-chat-widget.right {
    right: 20px;
}

.tuta-chat-widget.left {
    left: 20px;
}

.tuta-chat-bubble {
    background-color: var(--tuta-primary-color, #2271b1);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

/* Fix for chat widget bubble - adding the same styling as tuta-chat-bubble */
.tuta-chat-widget-bubble {
    background-color: var(--tuta-primary-color, #2271b1);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.tuta-chat-bubble:hover,
.tuta-chat-widget-bubble:hover {
    transform: scale(1.1);
}

.tuta-chat-bubble .dashicons,
.tuta-chat-widget-bubble .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.tuta-chat-container {
    position: absolute;
    bottom: 80px; /* Position above the bubble */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    display: none; /* Initially hidden */
    flex-direction: column;
    width: 350px;
    height: 500px;
    z-index: 9999; /* Ensure it appears above other elements */
}

.tuta-chat-widget.right .tuta-chat-container {
    right: 0;
}

.tuta-chat-widget.left .tuta-chat-container {
    left: 0;
}

.tuta-chat-container.hidden {
    display: none !important; /* Force hidden state */
}

.tuta-chat-header {
    background-color: var(--tuta-primary-color, #2271b1);
    color: white;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

/* Non-free plan (minimalist header) */
.tuta-chat-header.no-powered-by {
    padding: 8px 15px;
    min-height: 40px;
}

/* Free plan (with powered by text) */
.tuta-chat-header.has-powered-by {
    padding: 10px 15px;
}

.tuta-chat-header .tuta-chat-title {
    font-weight: bold;
    font-size: 0; /* Hide text */
    display: block;
}

.tuta-chat-header .tuta-chat-title-hidden {
    display: none; /* Completely hide this element */
}

.tuta-chat-header .tuta-chat-close {
    cursor: pointer;
    font-size: 18px;
    position: absolute;
    right: 15px;
    top: 40%;
    transform: translateY(-50%);
    z-index: 10;
}

.tuta-powered-by {
    font-size: 12px;
    text-align: center;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    z-index: 5;
    font-style: normal;
}

.tuta-powered-by .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 5px;
}

.tuta-powered-by a {
    color: white;
    text-decoration: none;
}

.tuta-powered-by a:hover {
    text-decoration: underline;
}

/* Messages Area */
.tuta-chat-messages {
    flex-grow: 1; /* Allow messages area to fill space */
    overflow-y: auto;
    padding: 10px; /* Reduced from 15px to create more space */
    background-color: #ffffff;
    border-bottom: none; /* Remove border */
    max-height: calc(100% - 110px); /* Adjust for header + form height */
    position: absolute;
    top: 45px; /* Default - adjust based on header height */
    left: 0;
    right: 0;
    bottom: 65px; /* Adjust based on form height */
}

/* Adjust top position for minimal header (non-free plan) */
.tuta-chat-header.no-powered-by + .tuta-chat-messages {
    top: 35px; /* Less space needed for smaller header */
}

/* Position for header with powered by text */
.tuta-chat-header.has-powered-by + .tuta-chat-messages {
    top: 45px; /* Standard spacing for header with content */
}

/* Message Bubbles */
.tuta-chat-message {
    margin-bottom: 12px;
    display: flex;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 100%; /* Increased from 85% to allow more content */
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word; /* Ensure long words break */
    position: relative; /* For potential future elements like timestamps */
}

/* User Message Styling */
.user-message {
    justify-content: flex-end;
    margin-left: 5%; /* Reduced from 15% to reduce indentation */
}
.user-message .message-bubble {
    background-color: var(--tuta-primary-color, #007bff);
    color: white;
    border-bottom-right-radius: 5px; /* Slightly different corner */
}

/* AI Message Styling */
.ai-message {
    justify-content: flex-start;
    margin-right: 5%; /* Reduced from 15% to reduce indentation */
}
.ai-message .message-bubble {
    background-color: #f1f0f0; /* Light grey background */
    color: #000;
    border-bottom-left-radius: 5px; /* Slightly different corner */
}

.ai-message .message-bubble code {
    background-color: rgba(0, 0, 0, 0.07);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 90%;
}

.ai-message .message-bubble pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
}

.ai-message .message-bubble pre code {
    background-color: transparent;
    padding: 0;
    font-size: 90%;
    display: block;
    line-height: 1.5;
}

.ai-message .message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 90%;
}

.ai-message .message-bubble th,
.ai-message .message-bubble td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
}

.ai-message .message-bubble th {
    background-color: rgba(0, 0, 0, 0.05);
    font-weight: bold;
}

.ai-message .message-bubble blockquote {
    border-left: 4px solid #ccc;
    margin: 8px 0;
    padding-left: 12px;
    color: #555;
}

/* Error Message Styling */
.error-message {
     justify-content: center;
     margin: 5px 10%;
}
.error-message .message-bubble {
    background-color: #fff0f0; /* Light red */
    color: #d8000c; /* Dark red text */
    border: 1px solid #ffd3d3;
    text-align: center;
    font-size: 13px;
    max-width: 100%;
}

/* Typing Indicator Styles */
.typing-indicator {
    display: none; /* Hidden by default, will be changed to flex when active */
    margin-right: 5%; /* Match AI message indentation */
    margin-bottom: 12px;
    border-top: none; /* Remove the line above typing indicator */
    order: 999; /* Ensure it stays at the end of messages when using flex layout */
}

/* When shown, make it a flex container like other messages */
.typing-indicator.shown {
    display: flex !important; 
}

.typing-indicator .message-bubble {
    background-color: #f1f0f0; /* Same as AI message */
    border-radius: 18px;
    border-bottom-left-radius: 5px; /* Same as AI message */
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background-color: #999;
    border-radius: 50%;
    margin: 0 3px;
    animation: typing-blink 1.4s infinite ease-in-out both;
}

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

@keyframes typing-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Input Form Area */
.tuta-chat-form {
    flex-shrink: 0; /* Prevent form from shrinking */
    display: flex;
    padding: 12px;
    background-color: #f9f9f9;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #e0e0e0;
    z-index: 10; /* Ensure it appears above messages */
    margin-bottom: 0 !important; /* Override WordPress defaults */
}

/* Fix for form elements to override WordPress defaults */
.tuta-chat-form form,
.tuta-chat-widget form,
#tuta-chat-container form {
    margin-bottom: 0 !important;
}

#tuta-chat-input {
    flex-grow: 1;
    padding: 9px 14px;
    border: 1px solid #ccc;
    border-radius: 5px; /* Reduced from 20px to 5px */
    margin-right: 10px;
    font-size: 14px;
    outline: none; /* Remove default focus outline */
    transition: border-color 0.2s ease;
    color: #333 !important; /* Force text color */
    background-color: #fff !important; /* Force background color */
}
#tuta-chat-input:focus {
    border-color: var(--tuta-primary-color, #007bff);
    color: #333 !important; /* Maintain text color on focus */
}

#tuta-send-button {
    background-color: var(--tuta-primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px; /* Slightly larger */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

#tuta-send-button:hover {
    opacity: 0.85;
}

#tuta-send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#tuta-send-button .dashicons {
    font-size: 22px;
    line-height: 1;
    height: auto;
    width: auto;
}

/* Size Adjustments - Use classes set in PHP */
.tuta-chat-container {
    /* Default size (S) */
    width: 350px;
    height: 500px; 
}
.tuta-chat-widget.size-m .tuta-chat-container { width: 400px; height: 550px; }
.tuta-chat-widget.size-l .tuta-chat-container { width: 450px; height: 600px; }

/* Responsive adjustments */
@media (max-width: 480px) {
    .tuta-chat-widget .tuta-chat-container {
        position: fixed; /* Use fixed instead of absolute */
        width: calc(100% - 30px) !important; 
        height: calc(100% - 90px) !important;
        max-width: 95vw;
        max-height: 80vh;
        bottom: 70px;
        right: 15px !important;
        left: auto;
        display: none; /* Initially hidden */
    }
    
    .tuta-chat-widget.left .tuta-chat-container {
        left: 15px !important;
        right: auto !important;
    }
    
    /* Make sure display properties work properly */
    .tuta-chat-widget .tuta-chat-container:not(.hidden) {
        display: flex !important;
    }
    
    .message-bubble { font-size: 15px; }
    #tuta-chat-input { font-size: 15px; }
    .tuta-chat-messages {
        bottom: 75px;
    }
}

/* Override any hidden containers at mobile sizes */
@media (max-width: 480px) {
    .tuta-chat-container {
        width: calc(100% - 40px) !important;
        height: calc(100% - 120px) !important;
        bottom: 90px;
        left: 20px !important;
        right: 20px !important;
        z-index: 99999 !important; /* Ensure highest z-index */
    }

    /* Remove !important from display property in this media query */
    .tuta-chat-container.hidden {
        display: none !important;
    }
    
    /* When chat is active, make sure it's shown */
    .tuta-chat-container:not(.hidden) {
        display: flex !important;
    }

    .tuta-chat-widget.right,
    .tuta-chat-widget.left {
        right: 10px;
        left: auto;
        z-index: 99999;
    }
    
    /* Fix for container.hidden to make sure it's actually hidden */
    .tuta-chat-container.hidden {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Markdown Content Styling (if using marked.js) */
.tuta-chat-widget .ai-message .message-bubble h1,
.tuta-chat-widget .ai-message .message-bubble h2,
.tuta-chat-widget .ai-message .message-bubble h3,
.tuta-chat-widget .ai-message .message-bubble h4,
.tuta-chat-widget .ai-message .message-bubble h5,
.tuta-chat-widget .ai-message .message-bubble h6 {
    color: #333 !important;
    font-weight: 600 !important;
    margin: 0.8em 0 0.4em 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

.tuta-chat-widget .ai-message .message-bubble h1 { font-size: 1.4em !important; }
.tuta-chat-widget .ai-message .message-bubble h2 { font-size: 1.3em !important; }
.tuta-chat-widget .ai-message .message-bubble h3 { font-size: 1.2em !important; }
.tuta-chat-widget .ai-message .message-bubble h4 { font-size: 1.1em !important; }
.tuta-chat-widget .ai-message .message-bubble h5 { font-size: 1em !important; }
.tuta-chat-widget .ai-message .message-bubble h6 { font-size: 0.9em !important; }

.tuta-chat-widget .ai-message .message-bubble p {
    margin: 0.5em 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    color: inherit !important;
    font-size: inherit !important;
}

.tuta-chat-widget .ai-message .message-bubble a {
    color: #0073aa !important;
    text-decoration: underline !important;
    font-weight: normal !important;
}

.tuta-chat-widget .ai-message .message-bubble a:hover {
    color: #00a0d2 !important;
    text-decoration: none !important;
}

.tuta-chat-widget .ai-message .message-bubble img {
    max-width: 75% !important;
    height: auto !important;
    display: block !important;
    margin: 0.5em 0 1.2em 0 !important; /* Add more space below image */
    border-radius: 4px !important;
}

.tuta-chat-widget .ai-message .message-bubble ul,
.tuta-chat-widget .ai-message .message-bubble ol {
    padding-left: 1em; /* Reduced from 1.5em */
    margin: 0.3em 0;
}

.tuta-chat-widget .ai-message .message-bubble ul {
    list-style-type: none; /* Remove bullet points */
    padding-left: 0.3em; /* Minimal indentation */
}

.tuta-chat-widget .ai-message .message-bubble ol {
    list-style-type: decimal;
}

.tuta-chat-widget .ai-message .message-bubble ul li,
.tuta-chat-widget .ai-message .message-bubble ol li {
    margin: 0.2em 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

.tuta-chat-widget .ai-message .message-bubble code {
    font-family: monospace !important;
    background-color: rgba(0, 0, 0, 0.07) !important;
    padding: 0.2em 0.4em !important;
    border-radius: 3px !important;
    font-size: 90% !important;
    display: inline !important;
    white-space: pre-wrap !important;
}

.tuta-chat-widget .ai-message .message-bubble pre {
    background-color: rgba(0, 0, 0, 0.05) !important;
    padding: 10px !important;
    border-radius: 4px !important;
    overflow-x: auto !important;
    margin: 8px 0 !important;
    white-space: pre !important;
}

.tuta-chat-widget .ai-message .message-bubble pre code {
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 90% !important;
    display: block !important;
    line-height: 1.5 !important;
}

.tuta-chat-widget .ai-message .message-bubble blockquote {
    border-left: 4px solid #ccc !important;
    margin: 0.5em 0 !important;
    padding: 0.3em 0.8em !important;
    color: #555 !important;
    font-style: italic !important;
    background-color: rgba(0, 0, 0, 0.03) !important;
}

.tuta-chat-widget .ai-message .message-bubble table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0.5em 0 !important;
    font-size: 90% !important;
}

.tuta-chat-widget .ai-message .message-bubble th,
.tuta-chat-widget .ai-message .message-bubble td {
    border: 1px solid #ddd !important;
    padding: 0.4em 0.6em !important;
    text-align: left !important;
    vertical-align: top !important;
}

.tuta-chat-widget .ai-message .message-bubble th {
    background-color: rgba(0, 0, 0, 0.05) !important;
    font-weight: bold !important;
}

/* Deep Chat container */
.tuta-chat-container deep-chat {
    flex: 1;
    min-height: 0;
    border: none !important;
    border-radius: 0 0 10px 10px !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

/* Deep Chat customizations */
deep-chat {
    --deep-chat-border-radius: 0;
    --deep-chat-border: none;
    --deep-chat-margin: 0;
    --deep-chat-input-border-radius: 20px;
    --deep-chat-input-margin: 10px;
    --deep-chat-input-padding: 12px 15px;
    --deep-chat-input-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    --deep-chat-input-background-color: #f5f5f5;
    --deep-chat-input-font-size: 14px;
    --deep-chat-input-line-height: 20px;
    --deep-chat-button-icon-filter: brightness(0) invert(1);
    --deep-chat-button-background-color: var(--tuta-primary-color, #2271b1);
    --deep-chat-button-hover-background-color: var(--tuta-primary-color, #2271b1);
    --deep-chat-button-active-background-color: var(--tuta-primary-color, #2271b1);
    --deep-chat-messages-container-padding: 15px;
}

/* Ensure messages container takes full height */
deep-chat::part(messages-container) {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Position input at bottom */
deep-chat::part(input-container) {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: white;
    padding: 10px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Enhanced image styling for Deep Chat */
.tuta-chat-container deep-chat img,
.tuta-chat-container deep-chat img.message-media-content,
.tuta-chat-container deep-chat .message-media img,
.tuta-chat-container deep-chat .message-bubble img {
    max-width: 100% !important;
    max-height: 250px !important;
    object-fit: contain !important;
    width: auto !important;
    height: auto !important;
}

.tuta-chat-container deep-chat .message-bubble {
    overflow: hidden;
    max-width: 85% !important;
}

.tuta-chat-container deep-chat .message-media {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100% !important;
    max-height: 250px !important;
}

/* Improved list styling */
.tuta-chat-container deep-chat .message-bubble ol,
.tuta-chat-container deep-chat .message-bubble ul {
    padding-left: 0.8em !important;
    margin-left: 0 !important;
    margin-top: 0.5em !important;
    margin-bottom: 0.5em !important;
}

.tuta-chat-container deep-chat .message-bubble li {
    margin-bottom: 0.3em !important;
    padding-left: 0.2em !important;
}

.tuta-chat-container deep-chat .message-bubble li ol,
.tuta-chat-container deep-chat .message-bubble li ul {
    padding-left: 0.6em !important;
    margin-top: 0.3em !important;
}

/* Modern link styling */
.tuta-chat-container deep-chat .message-bubble a {
    color: var(--tuta-primary-color, #2271b1) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: opacity 0.2s ease !important;
}

.tuta-chat-container deep-chat .message-bubble a:hover {
    opacity: 0.8 !important;
}

/* Enhanced formatting for product listings and descriptions */
.tuta-chat-container deep-chat .message-bubble ol > li {
    margin-bottom: 0.8em !important;
}

.tuta-chat-container deep-chat .message-bubble ol > li > ul {
    margin-top: 0.3em !important;
}

/* Improve description formatting */
.tuta-chat-container deep-chat .message-bubble dl, 
.tuta-chat-container deep-chat .message-bubble dt, 
.tuta-chat-container deep-chat .message-bubble dd {
    margin: 0 !important;
    padding: 0 !important;
}

.tuta-chat-container deep-chat .message-bubble dt {
    font-weight: 600 !important;
    margin-top: 0.5em !important;
}

.tuta-chat-container deep-chat .message-bubble dd {
    margin-left: 1em !important;
}

/* Improve paragraph spacing */
.tuta-chat-container deep-chat .message-bubble p {
    margin-top: 0.5em !important;
    margin-bottom: 0.5em !important;
}

/* Format prices and product details */
.tuta-chat-container deep-chat .message-bubble strong, 
.tuta-chat-container deep-chat .message-bubble b {
    font-weight: 600 !important;
}

/* Size variations */
.tuta-chat-widget.size-S .tuta-chat-container {
    width: 350px;
    height: 500px;
}

.tuta-chat-widget.size-M .tuta-chat-container {
    width: calc(350px * 1.2);
    height: calc(500px * 1.1);
}

.tuta-chat-widget.size-L .tuta-chat-container {
    width: calc(350px * 1.3);
    height: calc(500px * 1.15);
}

/* Adaptive image sizing based on chat size */
.tuta-chat-widget.size-S deep-chat img,
.tuta-chat-widget.size-S deep-chat img.message-media-content,
.tuta-chat-widget.size-S deep-chat .message-media img,
.tuta-chat-widget.size-S deep-chat .message-bubble img {
    max-width: 100% !important;
    max-height: 250px !important;
}

.tuta-chat-widget.size-M deep-chat img,
.tuta-chat-widget.size-M deep-chat img.message-media-content,
.tuta-chat-widget.size-M deep-chat .message-media img,
.tuta-chat-widget.size-M deep-chat .message-bubble img {
    max-width: 100% !important;
    max-height: 300px !important;
}

.tuta-chat-widget.size-L deep-chat img,
.tuta-chat-widget.size-L deep-chat img.message-media-content,
.tuta-chat-widget.size-L deep-chat .message-media img,
.tuta-chat-widget.size-L deep-chat .message-bubble img {
    max-width: 100% !important;
    max-height: 350px !important;
}

/* For very small screens */
@media (max-width: 360px) {
    .tuta-chat-container {
        width: calc(100% - 20px) !important;
        left: 10px !important;
        right: 10px !important;
    }
    
    /* Further reduce image sizes */
    .tuta-chat-container deep-chat img,
    .tuta-chat-container deep-chat img.message-media-content,
    .tuta-chat-container deep-chat .message-media img,
    .tuta-chat-container deep-chat .message-bubble img {
        max-height: 180px !important;
    }
}

/* For longer welcome messages that need to wrap */
@media (min-width: 481px) {
    .tuta-chat-title.long-message {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }
}

/* Improved list indentation in AI messages */
.ai-message .message-bubble ul,
.ai-message .message-bubble ol {
    padding-left: 1em; /* Reduced from 1.5em */
    margin: 0.3em 0;
}

.ai-message .message-bubble ul ul,
.ai-message .message-bubble ol ol,
.ai-message .message-bubble ul ol,
.ai-message .message-bubble ol ul {
    padding-left: 0.7em; /* Even tighter nesting */
    margin: 0.2em 0;
}

.ai-message .message-bubble li {
    margin-bottom: 0.2em; /* Tighter spacing between list items */
    padding-left: 0; /* Remove extra padding */
}

/* Make markdown content more compact */
.message-bubble p { 
    margin: 0.3em 0; /* Reduced from 0.5em */
}

/* Override any WordPress or global list styles */
.message-bubble ul, 
.message-bubble ol {
    margin: 0.3em 0;
    padding-left: 1em;
}

/* Tighten spacing on nested lists */
.message-bubble li ul, 
.message-bubble li ol {
    margin-top: 0.1em !important;
    margin-bottom: 0.1em !important;
    padding-left: 0.7em !important;
}

/* Remove dots from unordered lists but keep numbers for ordered lists */
.ai-message .message-bubble ul {
    list-style-type: none; /* Remove bullet points */
    padding-left: 0.3em; /* Minimal indentation */
}

/* Keep padding for nested lists with additional adjustments */
.ai-message .message-bubble ul ul,
.ai-message .message-bubble ol ul {
    list-style-type: none; /* Remove bullets for nested lists */
    padding-left: 0.2em; /* Minimal indentation for nested lists */
}

/* Add a bit more space to numbered items to align with non-bulleted items */
.ai-message .message-bubble ol {
    padding-left: 1.2em; /* Keep enough space for numbers */
}

/* Custom styling for list items in unordered lists */
.ai-message .message-bubble ul > li {
    position: relative;
    margin-bottom: 0.2em;
}

/* Ensure chat container is visible when needed */
.tuta-chat-container.force-show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 99999 !important;
}

/* Fix for mobile display quirks in some browsers */
@media (max-width: 480px) {
    /* Fix for iOS Safari and some Android browsers */
    .tuta-chat-container {
        transform: translateZ(0); /* Force hardware acceleration */
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* Adjust image sizes for smaller screens */
    .tuta-chat-container deep-chat img,
    .tuta-chat-container deep-chat img.message-media-content,
    .tuta-chat-container deep-chat .message-media img,
    .tuta-chat-container deep-chat .message-bubble img {
        max-height: 200px !important;
    }
    
    /* Make chat bubble smaller on mobile */
    .tuta-chat-bubble,
    .tuta-chat-widget-bubble {
        width: 50px;
        height: 50px;
    }
    
    .tuta-chat-bubble .dashicons,
    .tuta-chat-widget-bubble .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}

/* Markdown specific element styling */
.tuta-chat-widget .ai-message .message-bubble .tuta-md-element {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    line-height: 1.4 !important;
    margin: 0.5em 0 !important;
    color: inherit !important;
}

/* Force text color to remain black in dark themes */
.tuta-chat-widget .ai-message .message-bubble {
    color: #333 !important;
}

/* Fix for various theme overrides */
.tuta-chat-widget .ai-message .message-bubble *:not(a) {
    text-decoration: none !important;
}

.tuta-chat-container deep-chat .ai-message .message-bubble ul {
    list-style-type: none !important;
    padding-left: 0.3em !important;
}
.tuta-chat-container deep-chat .ai-message .message-bubble ul ul,
.tuta-chat-container deep-chat .ai-message .message-bubble ol ul {
    list-style-type: none !important;
    padding-left: 0.2em !important;
} 