.lumise-tiydo-ai-settings {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
    margin: 10px;
}

li[data-tab="tiydo_ai"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%; /* Ensure the list item container takes full height */
}

i.tiydo-ai-icon {
    width: 30.5px;
    height: 30px;

    background-color: currentColor;

    -webkit-mask: url("../icons/tiydo-ai.svg") no-repeat center;
    -webkit-mask-size: contain;

    mask: url("../icons/tiydo-ai.svg") no-repeat center;
    mask-size: contain;
}

.tab-header .tab-header-inner {
    display: inline-block;
    margin: 10px 20px 0;
    width: calc(100% - 40px);
    border-top: none;
}

.tab-header .tab-header-inner button {
    margin: 10px 0px;
    text-transform: inherit;
    font-weight: normal;
    font-size: 15px;
    width: 50%;
    white-space: nowrap;
    float: left;
    padding: 10px 12px;
    border: none;
    cursor: pointer;
    background: #eee;
    outline: none !important;
}

.tab-header .tab-header-inner button:first-child {
    margin-right: 1px;
    width: calc(50% - 1px);
    border-radius: 0;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.tab-header .tab-header-inner button:hover {
    background: var(--tiydo-theme-color);
    color: #eee !important;
    position: relative;
}

.tab-header .tab-header-inner button.active {
    background: var(--tiydo-theme-color);
    color: #eee !important;
}

.chat-layout {
    display: flex;
    flex-direction: column;
    height: calc(100% - 80px); /* Adjust height to account for header */
    background-color: white;
    margin: 0 12px;
    padding: 10px 8px;
    box-sizing: border-box;
}

.chat-widget {
    width: 100%;
    flex: 1; /* Allow chat widget to grow */
    background-color: white;
    color: black;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    overflow: hidden; /* Prevent overflow */
}

.chat-widget .tiydo-chat-con {
    height: 100%; /* Fill the available space */
    overflow-y: auto;
    padding: 10px 5px;
    scroll-behavior: smooth;
}

.chat-widget .tiydo-chat-con .msg-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.chat-widget .tiydo-chat-con .msg-row .bubble {
    padding: 10px 12px;
    border-radius: 8px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-widget .tiydo-chat-con .bot .bubble {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.chat-widget .tiydo-chat-con .user {
    justify-content: flex-end;
}

.chat-widget .tiydo-chat-con .user .bubble {
    background-color: var(--tiydo-theme-color);
    color: white;
    border: none;
}

/* Markdown Styling inside Bubbles */
.bubble h1, .bubble h2, .bubble h3 {
    margin: 10px 0 5px;
    font-weight: 700;
    line-height: 1.2;
}
.bubble h1 { font-size: 1.4em; }
.bubble h2 { font-size: 1.2em; }
.bubble h3 { font-size: 1.1em; }

.bubble strong { font-weight: bold; }
.bubble em { font-style: italic; }

.bubble li {
    margin-left: 20px;
    list-style-type: disc;
    margin-bottom: 4px;
}

.bubble br {
    content: "";
    display: block;
    margin-bottom: 6px;
}

.bubble hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

/* avatar */
.msg-row.bot .avatar {
    flex-shrink: 0;
    margin-top: 2px;
}

/* typing spinner */
.msg-row.bot.typing .bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
}

.msg-row.bot.typing .dot {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.msg-row.bot.typing .dot:nth-child(2) {
    animation-delay: .2s;
}

.msg-row.bot.typing .dot:nth-child(3) {
    animation-delay: .4s;
}

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}

.chat-layout .chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #e5e5e5;
    background: #fff;
}

.chat-layout .chat-input input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    font-size: 13px;
}

.chat-layout .chat-input input:focus {
    border-color: var(--tiydo-theme-color);
}

.chat-layout .chat-input button {
    padding: 8px 15px;
    border: none;
    background: var(--tiydo-theme-color);
    color: #fff;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
}

.chat-layout .chat-input button:hover {
    background: #35a89d;
}

.image-bubble img {
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}