* {
    box-sizing: border-box;
}

body {
    background-color: white;
    font-family: "Helvetica", "Roboto", sans-serif;
}

.chat_window {
    position: absolute;
    width: calc(100% - 40px);
    max-width: 1800px;
    height: calc(100vh - 100px);
    min-height: 500px;
    border-radius: 10px;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.15);
    background-color: white;
    overflow: hidden;
    resize: both;
    max-height: 95vh;
    transition: width 0.2s ease, height 0.2s ease;
    -webkit-transition: width 0.2s ease, height 0.2s ease;
    -moz-transition: width 0.2s ease, height 0.2s ease;
}

.top_menu {
    background-color: #fff;
    width: 100%;
    padding: 20px 0 15px;
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.1);
}

    .top_menu .title {
        text-align: center;
        color: #bcbdc0;
        font-size: 20px;
    }

        .top_menu .title .icon_bot {   
                width: 60px;
                height: 60px;
                border-radius: 50%;  
                background-color: LightGray;
                position: relative;  
                margin: 0 auto;                                                                                               
        }


            .top_menu .title .icon_bot .bot {    
                    position: absolute;
                    top: 0;
                    bottom: 0;
                    width: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;    
                    color: #000000;                                                                                            
            }

/* Voice input button styles */
.voice_input_btn {
    position: absolute;
    bottom: 20px;
    left: 60px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
}

/* Speech synthesis toggle button styles */
.speech_synthesis_btn {
    position: absolute;
    bottom: 20px;
    left: 110px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
}

.speech_synthesis_btn:hover {
    background-color: #5a6268;
    transform: scale(1.1);
}

.speech_synthesis_btn.enabled {
    background-color: #28a745;
}

.speech_synthesis_btn.enabled:hover {
    background-color: #218838;
}

.speech_synthesis_btn.speaking {
    background-color: #ffc107;
    animation: pulse-yellow 1.5s infinite;
}

.speech_synthesis_btn.speaking:hover {
    background-color: #e0a800;
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.voice_input_btn:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

.voice_input_btn.listening {
    background-color: #dc3545;
    animation: pulse 1.5s infinite;
}

.voice_input_btn.listening:hover {
    background-color: #c82333;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Voice indicator styles */
.voice-indicator {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.voice-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.voice-indicator-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-wave {
    display: flex;
    gap: 2px;
}

.voice-wave span {
    width: 3px;
    height: 15px;
    background-color: #007bff;
    border-radius: 2px;
    animation: voice-wave 1.2s infinite ease-in-out;
}

.voice-wave span:nth-child(1) {
    animation-delay: -1.1s;
}

.voice-wave span:nth-child(2) {
    animation-delay: -1.0s;
}

.voice-wave span:nth-child(3) {
    animation-delay: -0.9s;
}

@keyframes voice-wave {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1.0);
    }
}

.voice-text {
    font-size: 12px;
    white-space: nowrap;
}

.messages {
    position: relative;
    list-style: none;
    padding: 20px 10px 120px 10px;
    margin: 0;
    height: calc(100% - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 11pt;
    font-weight: 300;
    cursor: default;
    transition: height 0.3s ease;
}

    .messages .message {
        clear: both;
        overflow: hidden;
        margin-bottom: 20px;
        transition: all 0.5s linear;
        opacity: 0;
    }


        .messages .message.left .text_wrapper {
            background-color: LightGray;
            margin-left: 20px;
        }

            .messages .message.left .text_wrapper::after, .messages .message.left .text_wrapper::before {
                right: 100%;
                border-right-color: #ffe6cb;
            }

        .messages .message.left .text {
            color: #000000;
            word-break: break-word;
            overflow-wrap: break-word;
            cursor: text;
        }
        
        .messages .message .text a {
            cursor: pointer;
        }

        .messages .message.right .text_wrapper {
            background-color: #008cba;
            margin-right: 20px;
            float: right;
        }
        
        .messages .message.right .text {
            color: #FFFFFF;
            word-break: break-word;
            overflow-wrap: break-word;
            cursor: text;
        }

            .messages .message.right .text_wrapper::after, .messages .message.right .text_wrapper::before {
                left: 100%;
                border-left-color: #c7eafc;
            }

        .messages .message.right .text {
            color: #FFFFFF;
        }

        .messages .message.appeared {
            opacity: 1;
        }

        .messages .message .text_wrapper {
            display: inline-block;
            padding: 20px;
            border-radius: 20px;
            width: calc(100% - 60px);
            min-width: 100px;
            position: relative;
            max-width: 85%;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }
        
/* Copy buttons container */
.messages .message .copy-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.messages .message .text_wrapper:hover .copy-buttons {
    opacity: 1;
}

/* Copy button styling */
.messages .message .copy-button {
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.messages .message .copy-to-input {
    background-color: rgba(255, 255, 255, 0.8);
}

.messages .message.right .copy-button {
    background-color: rgba(0, 0, 0, 0.1);
}

.messages .message .copy-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.messages .message.right .copy-button:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.messages .message .copy-button svg {
    width: 16px;
    height: 16px;
    fill: #555;
}

.messages .message.right .copy-button svg {
    fill: #fff;
}

/* Copy success indicator */
.copy-success {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-success.show {
    opacity: 1;
}

.bottom_wrapper {
    width: 100%;
    background-color: #fff;
    padding: 20px 20px;
    position: absolute;
    bottom: 0;
    max-height: 200px;
    overflow: visible;
    z-index: 10;
    transition: max-height 0.3s ease;
}

    .bottom_wrapper .message_input_wrapper {
        display: inline-block;
        min-height: 50px;
        border-radius: 25px;
        border: 1px solid #bcbdc0;
        width: calc(100% - 40px);
        position: relative;
        padding: 0 20px;
        transition: height 0.2s;
        overflow: hidden;
    }

        .bottom_wrapper .message_input_wrapper .message_input {
            border: none;
            box-sizing: border-box;
            width: calc(100% - 40px);
            position: absolute;
            outline-width: 0;
            color: gray;
            resize: none;
            padding: 15px 0;
            line-height: 20px;
            max-height: 150px;
            overflow-y: auto;
            font-family: inherit;
            font-size: inherit;
            background: transparent;
            top: 0;
        }

.message_template {
    display: none;
}

/* Scrollbar styling */
.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.messages::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

/* Message timestamp styling */
.timestamp {
    font-size: 9px;
    color: #888;
    margin-top: 5px;
    text-align: right;
    font-style: italic;
}

.message.left .timestamp {
    text-align: left;
}

.message.right .timestamp {
    text-align: right;
    color: #000;  /* Black color for user timestamps for better contrast against blue background */
}

/* Typing indicator styling */
.typing-indicator-container {
    display: inline-block;
    background-color: LightGray;
    border-radius: 15px;
    padding: 15px 15px;
    position: relative;
    min-height: 18px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 1px;
    background-color: #9E9EA1;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
}

.typing-indicator span:nth-of-type(1) {
    animation: typing 1s infinite;
    -webkit-animation: typing 1s infinite;
    -moz-animation: typing 1s infinite;
}

.typing-indicator span:nth-of-type(2) {
    animation: typing 1s infinite 0.25s;
    -webkit-animation: typing 1s infinite 0.25s;
    -moz-animation: typing 1s infinite 0.25s;
}

.typing-indicator span:nth-of-type(3) {
    animation: typing 1s infinite 0.5s;
    -webkit-animation: typing 1s infinite 0.5s;
    -moz-animation: typing 1s infinite 0.5s;
}

@keyframes typing {
    0% {
        transform: translateY(0px);
        -webkit-transform: translateY(0px);
        -moz-transform: translateY(0px);
    }
    28% {
        transform: translateY(-5px);
        -webkit-transform: translateY(-5px);
        -moz-transform: translateY(-5px);
    }
    44% {
        transform: translateY(0px);
        -webkit-transform: translateY(0px);
        -moz-transform: translateY(0px);
    }
}

@-webkit-keyframes typing {
    0% {
        transform: translateY(0px);
        -webkit-transform: translateY(0px);
    }
    28% {
        transform: translateY(-5px);
        -webkit-transform: translateY(-5px);
    }
    44% {
        transform: translateY(0px);
        -webkit-transform: translateY(0px);
    }
}

@-moz-keyframes typing {
    0% {
        transform: translateY(0px);
        -moz-transform: translateY(0px);
    }
    28% {
        transform: translateY(-5px);
        -moz-transform: translateY(-5px);
    }
    44% {
        transform: translateY(0px);
        -moz-transform: translateY(0px);
    }
}

/* Typing indicator label */
.typing-label {
    font-size: 10px;
    color: #888;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 5px;
}

/* System message styling for errors */
.message .system_message {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    margin-left: 20px;
    margin-right: 20px;
    width: auto;
}

.message .system_message .text {
    color: #d32f2f;
    font-size: 0.9em;
}

/* Code block styling */
.messages .message pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
}

.messages .message pre code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9em;
    background-color: transparent;
    padding: 0;
    border: none;
}

.messages .message.right pre {
    background-color: #e6f7ff;
}

.messages .message code {
    background-color: rgba(0,0,0,0.05);
    border-radius: 3px;
    padding: 2px 4px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9em;
}

/* Code block buttons styling */
.code-block-buttons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.messages .message pre:hover .code-block-buttons {
    opacity: 1;
}

.code-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.code-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.code-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.code-btn svg {
    width: 14px;
    height: 14px;
    fill: #555;
}

/* Specific button styling */
.copy-code-btn {
    color: #2196F3;
}

.copy-code-btn:hover {
    background-color: #e3f2fd;
    border-color: #2196F3;
}

.copy-code-btn svg {
    fill: #2196F3;
}

.copy-to-editor-btn {
    color: #4CAF50;
}

.copy-to-editor-btn:hover {
    background-color: #e8f5e8;
    border-color: #4CAF50;
}

.copy-to-editor-btn svg {
    fill: #4CAF50;
}

.open-vscode-btn {
    color: #007ACC;
}

.open-vscode-btn:hover {
    background-color: #e6f3ff;
    border-color: #007ACC;
}

.open-vscode-btn svg {
    fill: #007ACC;
}

/* Dark theme for right-side messages */
.messages .message.right pre .code-btn {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.messages .message.right pre .code-btn:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.messages .message.right pre .code-btn svg {
    fill: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .code-block-buttons {
        opacity: 1; /* Always show on mobile */
        position: static;
        justify-content: flex-end;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .code-btn {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    .code-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* Visualization container styling */
.messages .message .visualization-container {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #fff;
    overflow: hidden;
}

.messages .message .chart-container {
    height: 300px;
    width: 100%;
    position: relative;
}

.messages .message .map-container {
    height: 300px;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.messages .message .datatable-container {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0;
}

.messages .message .mermaid {
    margin: 10px 0;
    overflow-x: auto;
}

/* Reset DataTables styling to fit in chat */
.messages .message table.dataTable {
    width: 100% !important;
    margin: 10px 0 !important;
    font-size: 0.9em;
}

.messages .message .dataTables_wrapper .dataTables_length, 
.messages .message .dataTables_wrapper .dataTables_filter {
    margin-bottom: 10px;
}

/* Message cards for structured content */
.messages .message .card {
    margin: 10px 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.messages .message .card-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: bold;
}

.messages .message .card-body {
    padding: 15px;
}

.messages .message .card-footer {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9em;
}

/* Tabs for segmented content */
.messages .message .tabs-container {
    margin: 15px 0;
}

.messages .message .tabs-header {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.messages .message .tab-item {
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    margin-bottom: 5px;
    background-color: #f8f9fa;
}

.messages .message .tab-item.active {
    background-color: #fff;
    border-color: #dee2e6;
    border-bottom-color: #fff;
    margin-bottom: -1px;
    font-weight: bold;
}

.messages .message .tab-content {
    display: none;
    padding: 10px;
}

.messages .message .tab-content.active {
    display: block;
}

/* Button styling */
.messages .message .btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 5px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.messages .message .btn:hover {
    background-color: #e9ecef;
}

.messages .message .btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.messages .message .btn-primary:hover {
    background-color: #0069d9;
}

.messages .message .btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.messages .message .btn-success:hover {
    background-color: #218838;
}

.messages .message .btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.messages .message .btn-danger:hover {
    background-color: #c82333;
}

/* Dashboard styling */
.messages .message .dashboard-container {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #fff;
    overflow: hidden;
}

.messages .message .dashboard-header {
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.messages .message .dashboard-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.messages .message .dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

.messages .message .dashboard-widget {
    flex: 0 0 calc(50% - 10px);
    margin: 5px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* On smaller screens, make widgets full width */
@media (max-width: 768px) {
    .messages .message .dashboard-widget {
        flex: 0 0 calc(100% - 10px);
    }
}

/* GridStack Dashboard styling */
.messages .message .grid-stack {
    background: #f8f9fa;
    border-radius: 5px;
    margin: 10px 0;
}

.messages .message .grid-stack-item-content {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
    background-color: white;
    overflow: hidden;
}

.messages .message .widget-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 0.9em;
}

.messages .message .widget-body {
    padding: 10px;
    height: calc(100% - 35px);
    overflow: auto;
}

/* Filter controls styling */
.messages .message .filter-container {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.messages .message .filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.messages .message .filter-control {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.messages .message .filter-select {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
}

.messages .message .filter-results {
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    min-height: 100px;
}

/* Timeline styling */
.messages .message .timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.messages .message .timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #e0e0e0;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.messages .message .timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    animation: fadeIn 0.5s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.messages .message .timeline-item.left {
    left: 0;
}

.messages .message .timeline-item.right {
    left: 50%;
}

.messages .message .timeline-badge {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 1em;
    text-align: center;
    position: absolute;
    top: 16px;
    right: -15px;
    background-color: #007bff;
    color: #fff;
    border-radius: 50%;
    z-index: 1;
}

.messages .message .timeline-item.right .timeline-badge {
    left: -15px;
}

.messages .message .timeline-panel {
    padding: 15px;
    background-color: #fff;
    position: relative;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.messages .message .timeline-item.left .timeline-panel::after {
    content: '';
    position: absolute;
    top: 16px;
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

.messages .message .timeline-item.right .timeline-panel::after {
    content: '';
    position: absolute;
    top: 16px;
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

.messages .message .timeline-heading h4 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.messages .message .timeline-body {
    margin-top: 10px;
}

@media screen and (max-width: 768px) {
    .messages .message .timeline::after {
        left: 31px;
    }
    
    .messages .message .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .messages .message .timeline-item.right {
        left: 0;
    }
    
    .messages .message .timeline-badge {
        left: 16px;
        right: auto;
    }
    
    .messages .message .timeline-item.left .timeline-panel::after {
        left: -10px;
        right: auto;
        border-width: 10px 10px 10px 0;
        border-color: transparent #fff transparent transparent;
    }
}

/* Monaco Editor Styling */
.bottom_wrapper .editor_toggle_btn {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.bottom_wrapper .editor_toggle_btn:hover {
    background-color: #e9ecef;
}

/* Loading state for toggle button */
.bottom_wrapper .editor_toggle_btn.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.bottom_wrapper .editor_toggle_btn .spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bottom_wrapper .editor_toggle_icon {
    font-size: 14px;
    color: #666;
}

.bottom_wrapper .monaco_editor_wrapper {
    display: none;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 10px;
    border: 1px solid #bcbdc0;
    width: calc(100% - 40px);
    background: white;
    transition: height 0.2s ease;
    position: relative;
}

/* Resize handle for Monaco editor */
.monaco_resize_handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background-color: transparent;
    cursor: ns-resize;
    z-index: 100;
}

.monaco_resize_handle:hover,
.monaco_resize_handle.dragging {
    background-color: rgba(0, 140, 186, 0.2);
}

.monaco_resize_handle:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 2px;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

/* Important: When editor mode is active */
.bottom_wrapper.editor_mode {
    max-height: 300px;
    padding-top: 10px;
}

.bottom_wrapper.editor_mode .message_input_wrapper {
    display: none;
}

.bottom_wrapper.editor_mode .monaco_editor_wrapper {
    display: block;
}

.bottom_wrapper .monaco_controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    height: 30px;
}

.bottom_wrapper .monaco_controls button {
    padding: 3px 8px;
    font-size: 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s ease;
}

.bottom_wrapper .monaco_controls button:hover {
    background-color: #e9ecef;
    transform: scale(1.05);
}

/* Active state for buttons */
.bottom_wrapper .monaco_controls button.active {
    background-color: #e9ecef;
    font-weight: bold;
}

/* Special styling for clear button */
.bottom_wrapper .monaco_controls #monaco_clear {
    color: #d9534f;
}

.bottom_wrapper .monaco_controls #monaco_clear:hover {
    background-color: #ffebee;
}

.bottom_wrapper .monaco_container {
    height: calc(100% - 50px);
}

.bottom_wrapper .editor_status_bar {
    font-size: 11px;
    padding: 2px 10px;
    text-align: right;
    color: #777;
    background: #f1f1f1;
    border-top: 1px solid #ddd;
    height: 20px;
    overflow: hidden;
}

/* Language dropdown styling */
.language-dropdown {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: absolute;
    z-index: 1000;
}

.language-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.language-item:hover {
    background-color: #f0f0f0;
}

/* Error message styling */
.monaco-error {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    margin: 10px 20px;
    padding: 10px;
    color: #d32f2f;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Theme-specific styles */
.bottom_wrapper.editor_mode.theme-dark .monaco_controls {
    background-color: #1e1e1e;
    border-color: #333;
}

.bottom_wrapper.editor_mode.theme-dark .monaco_controls button {
    background-color: #252526;
    border-color: #333;
    color: #ccc;
}

.bottom_wrapper.editor_mode.theme-dark .monaco_controls button:hover {
    background-color: #2d2d2d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bottom_wrapper.editor_mode {
        max-height: 250px;
    }
    
    .messages {
        height: calc(100% - 150px);
    }
    
    .messages .message.appeared {
        transition: opacity 0.3s ease;
    }
    
    .bottom_wrapper.editor_mode ~ .messages {
        height: calc(100% - 250px);
    }
}

/* Resize handle indicator */
.chat_window::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, transparent 50%, #007bff 50%);
    border-radius: 0 0 10px 0;
    cursor: se-resize;
    z-index: 1000;
}

/* Mode Switcher Styles */
.mode_switcher {
    margin-top: 15px;
    text-align: center;
}

.mode_toggle_container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.mode_label {
    font-size: 12px;
    color: #666;
    margin-right: 5px;
    font-weight: 500;
}

.toggle_switch {
    position: relative;
    display: inline-flex;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 2px;
    font-size: 11px;
    border: 1px solid #ddd;
}

.toggle_switch input[type="radio"] {
    display: none;
}

.toggle_option {
    padding: 6px 12px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.toggle_switch input[type="radio"]:checked + .toggle_option {
    color: white;
}

.toggle_slider {
    position: absolute;
    top: 2px;
    left: 2px;
    height: calc(100% - 4px);
    width: calc(50% + 9px); /* Wider to fully cover text */
    background-color: #28a745; /* Green for User mode default */
    border-radius: 18px;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1;
}

.toggle_switch input[name="bot_mode"]:nth-of-type(1):checked ~ .toggle_slider {
    transform: translateX(-5px); /* Slight left offset to cover Configuration text */
    background-color: #007bff; /* Blue for Configuration mode */
}

.toggle_switch input[name="bot_mode"]:nth-of-type(2):checked ~ .toggle_slider {
    transform: translateX(calc(100% - 10px)); /* Adjusted right position */
    background-color: #28a745; /* Green for User mode */
}

/* Mode indicator in chat window */
.chat_window[data-mode="configuration"] {
    border-top: 3px solid #007bff;
}

.chat_window[data-mode="user"] {
    border-top: 3px solid #28a745;
}

/* System message styling for mode changes */
.message.system .text_wrapper.system_message {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 8px 12px;
    border-radius: 4px;
    font-style: italic;
    color: #495057;
}

/* JavaScript execution result styling */
.js-execution-result {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.js-execution-result.error {
    background-color: #fff5f5;
    border-color: #fed7d7;
}

.execution-header {
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.console-output {
    margin-bottom: 10px;
}

.console-header {
    font-weight: bold;
    color: #6c757d;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

.console-line {
    background-color: #ffffff;
    padding: 2px 6px;
    margin: 1px 0;
    border-radius: 3px;
    border-left: 3px solid #dee2e6;
    white-space: pre-wrap;
    word-break: break-word;
}

.console-line.console-log {
    border-left-color: #28a745;
}

.console-line.console-error {
    border-left-color: #dc3545;
    background-color: #fff5f5;
    color: #721c24;
}

.console-line.console-warn {
    border-left-color: #ffc107;
    background-color: #fff8e1;
    color: #856404;
}

.console-line.console-info {
    border-left-color: #17a2b8;
    background-color: #e6f3ff;
    color: #0c5460;
}

.final-result {
    border-top: 1px solid #dee2e6;
    padding-top: 8px;
}

.result-header {
    font-weight: bold;
    color: #6c757d;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

.result-value {
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 3px;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}

.result-message {
    color: #495057;
    padding: 4px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Code validation warning styling */
.js-execution-result.validation-warning {
    background-color: #fff8e1;
    border-color: #ffcc02;
    border-left: 4px solid #ff9800;
}

.validation-issue {
    background-color: #ffffff;
    border: 1px solid #ffcc02;
    border-radius: 4px;
    margin: 8px 0;
    padding: 10px;
}

.issue-type {
    font-weight: bold;
    color: #e65100;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.issue-message {
    color: #bf360c;
    font-weight: 500;
    margin-bottom: 6px;
}

.issue-suggestion {
    color: #4a4a4a;
    margin-bottom: 6px;
    font-size: 13px;
}

.issue-example {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 6px;
    margin-top: 4px;
    font-size: 12px;
}

.issue-example code {
    background-color: transparent;
    color: #333;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.validation-footer {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: #856404;
    text-align: center;
    font-style: italic;
}

/* Loading indicator for chat history */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

.loading-indicator span {
    margin-left: 10px;
    color: #6c757d;
    font-size: 14px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #007bff;
    animation: loading-pulse 1.5s ease-in-out infinite;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.3s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.15s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loading-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}