.assistant-msg-cont {
    display: flex;
    flex-direction: column;

    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    word-spacing: 1px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    /* 'wrap' is invalid; use 'normal' */
    line-height: 2;
    /* optional: glassmorphism effect */
    background: none;
    max-width: 800px;
    width: 800px;
    position: relative;
    gap: 10px;
    justify-content: center;
}

.thought-cont {
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    width: 100%;
    padding: 10px 30px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: wrap;
    border-radius: 30px;
    /* Ensures text wraps properly */

    overflow: auto;
    background: linear-gradient(95deg,
            rgba(var(--bg-color1), 0.15),
            rgba(var(--bg-color1), 0.05));

    color: gray;
}

.thought-header {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    width: 100%;
    font-size: 14px;
    line-height: 1.2;
    overflow-x: auto;
    gap: 10px
}

.assistant-msg-box {
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    padding: 5px 20px;
    width: 100%;
    background: none;

    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: wrap;
    /* Ensures text wraps properly */
    overflow: auto;
}

.chat-footer {
    position: relative;
    padding: 5px;
    height: auto;
    gap: 5px;
    display: flex;
    flex-direction: row;
    min-width: 100px;
    width: auto;


}

.chat-footer-user {
    position: relative;
    padding: 5px;
    height: auto;
    gap: 5px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    min-width: 50px;
    width: 40px;
    height: 40px;
}

.model-label {
    position: relative;
    min-width: 100px;
    max-width: 200px;
    padding: 2px;
    left: 5px;
    font-style: italic;
    font-size: smaller;
}

.render-link {
    display: inline-block;
    text-decoration: none;
    background: rgba(var(--bg-color1), 0.15);
    font-weight: 500;
    border-radius: 9999px;
    /* pill shape */
    padding: 2px 10px;
    font-size: 10px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.render-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.render-link:active {
    transform: scale(0.97);
}

.render-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}


@media screen and (max-width: 1000px) {
    .assistant-msg-cont {
        width: 96vw;
    }
}
.user-chat-msg-cont {
    max-width: 800px;
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.user-msg-cont {
    display: block;

    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    word-spacing: 1px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    /* 'wrap' is invalid; use 'normal' */
    line-height: 2;
    /* optional: glassmorphism effect */
    background: none;
    width: 100%;
    position: relative;
    gap: 10px;
    justify-content: center;
}

.user-msg-box {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    padding: 1px 20px;
    background: rgba(var(--bg-color1), 0.2);
    border-radius: 30px;

    box-sizing: border-box;
    /* include padding in width */

    .user-msg-box {
        display: block;
        /* block ensures full width */
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        width: 100%;
        max-width: 100%;
        padding: 8px 20px;
        background: rgba(var(--bg-color1), 0.2);
        border-radius: 30px;
        box-sizing: border-box;

        /* Wrapping */
        white-space: pre-wrap;
        /* preserves line breaks */
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;

        overflow-x: hidden;
        /* prevents horizontal scroll */
    }

    overflow: none;
    /* prevents horizontal overflow */
}

.user-msg-box p,
.user-msg-box li,
.user-msg-box table,
.user-msg-box td,
.user-msg-box th,
.user-msg-box code,
.user-msg-box pre {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    white-space: pre-wrap;
}



.chat-image_url-cont {
    height: 200px;
    width: 200px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid gray;
}
:root {
    --bg-color-rgb: 31, 41, 55;
    /* Default Dark: Cool Gray 800 */
    --text-color-rgb: 229, 231, 235;
    /* Default Dark: Cool Gray 200 */
    --primary-color: #8b5cf6;
    /* Violet 500 */
    --green-color: #22c55e;
    /* Green 500 */
    --red-color: #ef4444;
    /* Red 500 */
    --blue-color: #3b82f6;
    /* Blue 500 */
    --gray-color: #9ca3af;
    /* Gray 400 */
    --border-color: rgba(255, 255, 255, 0.1);
}

html.light {
    --bg-color-rgb: 255, 255, 255;
    --text-color-rgb: 49, 46, 73;
    --border-color: rgba(0, 0, 0, 0.1);
    --gray-color: #6b7280;
    /* Gray 500 */
}

.tool-result-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: rgb(var(--bg-color-rgb));
    color: rgb(var(--text-color-rgb));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease-in-out;
}

/* ### Full Screen Mode ### */
.tool-result-container.fullscreen {
    position: fixed;
    top: 5%;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 0;
    z-index: 9999999;
    margin: 0;
    overflow: hidden;
}

.tool-result-container.fullscreen .tool-result-content {
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    overflow: scroll;
    /* Adjust based on header height */
}


/* ### Header ### */
.tool-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;

}

.tool-result-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-controls button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    color: var(--gray-color);
    transition: all 0.2s ease;
}

.header-controls button:hover {
    background: rgba(var(--text-color-rgb), 0.08);
    color: rgb(var(--text-color-rgb));
}

.header-controls button[data-active="true"] {
    background: rgba(var(--primary-color), 0.15);
    color: var(--primary-color);
}

/* ### Main Content Area ### */
.tool-result-content {
    padding: 5px;
    max-height: 70vh;
    overflow: auto;
}

.tool-result-content::-webkit-scrollbar {
    width: 8px;
}

.tool-result-content::-webkit-scrollbar-track {
    background: transparent;
}

.tool-result-content::-webkit-scrollbar-thumb {
    background: rgba(var(--text-color-rgb), 0.2);
    border-radius: 4px;
}

.tool-result-content::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--text-color-rgb), 0.3);
}

/* ### Value Rendering ### */
.value-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    position: relative;
}

.value-row .copy-button {
    display: none;
}

.value-row:hover .copy-button {
    display: flex;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: rgba(var(--text-color-rgb), 0.08);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.type-badge>.type-text {
    opacity: 0.7;
}

.action-button {
    background: transparent;
    border: none;
    border-radius: 5px;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-color);
    transition: all 0.2s ease;
}

.action-button:hover {
    background: rgba(var(--text-color-rgb), 0.1);
    color: rgb(var(--text-color-rgb));
}

.action-button.copy-button {
    margin-left: 8px;
}

.html-placeholder .copy-button {
    margin-left: auto;
}

.html-placeholder .preview-button {
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.html-placeholder .preview-button:hover {
    background: rgba(var(--primary-color), 0.2);
}


/* ### Data Type Styles ### */
.string-value {
    color: var(--green-color);
}

.number-value {
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
}

.boolean-value {
    font-weight: 500;
}

.null-value {
    color: var(--gray-color);
    font-style: italic;
}

.date-value,
.link-value {
    color: var(--blue-color);
    text-decoration: none;
}

.link-value:hover {
    text-decoration: underline;
}

.base64-image,
.media-player {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

/* ### Long String ### */
.long-string-wrapper .value-row {
    align-items: center;
}

.long-string-wrapper .summary-info {
    margin-left: 0;
}

.long-string-wrapper .action-button {
    margin-left: 5px;
}

.long-string-content {
    margin-top: 5px;
    padding: 12px;
    background: rgba(var(--bg-color-rgb));
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

/* ### Card View for Objects & Arrays ### */
.collection-wrapper.card-view {
    background: rgba(var(--text-color-rgb), 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 5px;
    height: auto;
    max-height: 100%;
}

.collection-header {
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
}

.collection-icon {
    color: var(--gray-color);
}

.collection-header .summary-info {
    font-weight: 500;
    color: var(--gray-color);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-actions .copy-button {
    display: flex;
}

/* Always show copy on header */

.card-view .nested-content {
    padding: 2px 5px 5px 5px;
    border-left: none;
    margin-top: 0;
}

/* ### Field styles for non-tech view ### */
.field-item {
    padding: 10px 0;
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-gap: 16px;
    gap: 16px;
    align-items: start;
    border-top: 1px solid var(--border-color);
}

.field-key {
    font-weight: 500;
    color: rgb(var(--text-color-rgb));
    opacity: 0.7;
    text-transform: capitalize;
    word-break: break-word;
}

.field-value>.type-badge {
    display: none;
}

/* Hide type badge for nested values */
.field-value .value-row {
    padding: 0;
}

.field-value .value-row:hover {
    background: transparent;
}

@media (max-width: 800px) {
    .tool-result-container {
        max-width: 95vw;
        width: 95vw;
    }
}

@media (max-width: 600px) {
    .field-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ### HTML Popup ### */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: rgb(var(--bg-color-rgb));
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.popup-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    color: var(--gray-color);
    cursor: pointer;
    padding: 0 8px;
}

.popup-html-container {
    padding: 20px;
    overflow-y: auto;
    color: rgb(var(--text-color-rgb));
}

.popup-html-container>*:first-child {
    margin-top: 0;
}

.popup-html-container>*:last-child {
    margin-bottom: 0;
}

.popup-html-container p,
.popup-html-container li {
    line-height: 1.6;
}

.popup-html-container b,
.popup-html-container strong {
    font-weight: 600;
}

.popup-html-container a {
    color: var(--blue-color);
}

.popup-html-container img {
    max-width: 100%;
    border-radius: 6px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* ### File Preview Styling ### */
.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(var(--text-color-rgb), 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
}

.file-icon {
    color: var(--gray-color);
    flex-shrink: 0;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-link {
    font-size: 12px;
    color: var(--blue-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: -moz-fit-content;
    width: fit-content;
}

.download-link:hover {
    text-decoration: underline;
}

/* ### Table View ### */
.table-wrapper {
    overflow-x: auto;
    padding-top: 8px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.result-table th,
.result-table td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    vertical-align: top;
}

.result-table th {
    font-weight: 600;
    background: rgba(var(--text-color-rgb), 0.05);
    text-transform: capitalize;
}

.result-table td .value-row {
    padding: 0;
}

.result-table td .value-row:hover {
    background: none;
}

.result-table td .copy-button {
    display: flex;
}

.result-table td .type-badge {
    display: none;
}
.chat-msg-cont {
    max-width: 800px;
    width: 100%;


}

.message-box {
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    width: 100%;

    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: wrap;
    /* Ensures text wraps properly */
    overflow: auto;
}

.user-message {
    background: #262d2d84;
    color: white;
    border-radius: 16px 16px 4px 16px;
    transform: translateX(10px);
    /* Slight shift for user messages */
}

.system-message {
    background: red;
    color: rgb(210, 206, 206);
    border-radius: 16px 16px 16px 4px;
}

.image-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 500px;
    width: 500px;
    border-radius: 20px;
    cursor: pointer;
    background: rgba(128, 128, 128, 0.144);
    box-shadow: 0 4px 6px rgba(114, 114, 114, 0.1);
    /* Subtle shadow */
    border: 1px solid rgba(128, 128, 128, 0.144);
    overflow: hidden;
}

.image-download {
    position: absolute;
    display: flex;
    gap: 10px;
    align-items: center;
    left: 10%;
    bottom: 5%;
    width: 40px;
    justify-content: center;
    padding: 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.7);
    /* semi-transparent dark for contrast */
    color: white;
    /* ensures text/icons are visible */
    z-index: 1000;
    /* keeps it on top */
    box-shadow: 0 4px 6px rgba(114, 114, 114, 0.1);
    /* Subtle shadow */
    border: 1px solid rgba(128, 128, 128, 0.144);
    /* subtle shadow for depth */
    transition: background 0.3s ease;
    cursor: pointer;

    &:hover {
        background: rgba(0, 0, 0, 0.85);
    }
}

.ai-image {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    /* Ensures the image covers the box without distortion */
}

.image_url-cont {
    height: auto;
    max-height: 150px;
    width: auto;
    max-width: 100%;
    border-radius: 10px;
    cursor: pointer;
}

.image_url-modal-cont {
    position: fixed;
    top: 0%;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);


}

.image_url-modal {
    position: absolute;
    display: flex;
    max-height: 500px;
    height: auto;
    width: auto;
    border-radius: 20px;
}

@keyframes glowBlurPulse {
    0% {
        filter: blur(200px) brightness(1) saturate(1);
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        filter: blur(180px) brightness(1.3) saturate(1.2);
        opacity: 0.5;
        transform: scale(1.01);
    }

    100% {
        filter: blur(200px) brightness(1) saturate(1);
        opacity: 0.2;
        transform: scale(1);
    }
}

.ai-image-blur {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    filter: blur(200px);
    animation: glowBlurPulse 2s infinite ease-in-out;
}


.error-message {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 10px;
    background: rgba(128, 128, 128, 0.144);
    box-shadow: 0 4px 6px rgba(114, 114, 114, 0.1);
    /* Subtle shadow */
    border: 2px solid rgba(255, 2, 2, 0.685);
    color: rgba(255, 2, 2, 0.685);
    /* Slight shift for user messages */
}

.aityping-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: gray;
    animation: zoom 1s infinite;
    /* Adds the zoom animation */
}

.chat-footer {
    position: relative;
    padding: 5px;
    height: auto;
    gap: 5px;
    display: flex;
    flex-direction: row;
    min-width: 100px;
    width: auto;


}

.chat-footer-user {
    position: relative;
    padding: 5px;
    height: auto;
    gap: 5px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    min-width: 70px;
    width: 40px;
    height: 40px;
}

.message-box-loading {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    width: auto;
    height: 5vh;
    left: 20px;

    gap: 10px;

    .msg-loading-img {
        animation: zoom 1s infinite;

    }
}

.thinking-text::after {
    content: '. . .';
    animation: dots 1.5s steps(3, end) infinite;
}

.thinking-text {
    animation: pulseText 1s infinite ease-in-out;
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}


@keyframes dots {
    0% {
        content: '';
    }

    33% {
        content: '.';
    }

    66% {
        content: '..';
    }

    100% {
        content: '...';
    }
}

@keyframes zoom {
    0% {
        transform: scale(1);
        /* Initial scale */
    }

    50% {
        transform: scale(1.5);
        /* Scale up to 1.5 times */
    }

    100% {
        transform: scale(1);
        /* Scale back to original */
    }
}

@media screen and (max-width: 1024px) {
    .chat-msg-cont {
        width: 99%;
        background: red;
    }
}

@media screen and (max-width: 600px) {
    .image-box {
        width: 90vw;
        height: auto;
    }

}
