* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    height: 50px;
    background-color: #e0e0e0;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

.header h1 {
    font-size: 24px;
    color: #333;
}

.header-right {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.header button:hover {
    background-color: #357abd;
}

.header-right button {
    background-color: #e0e0e0;
    color: #999;
    border: 1px solid #ccc;
    border-radius: 8px 8px 0 0;
}

.header-right button:hover {
    background-color: #e0e0e0;
    color: #333;
    border-color: #999;
}

.header-right button.active {
    color: #333;
    border-color: #333;
    border-bottom: none;
    font-weight: bold;
}

.main-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 50px);
}

.left-panel {
    width: 20%;
    background-color: #e0e0e0;
    border-right: 1px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Carbon Ads */
.carbon-ad-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #ddd;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#carbonads {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
    display: flex;
    max-width: 330px;
    background-color: hsl(0, 0%, 98%);
    box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, .1);
}

#carbonads a {
    color: inherit;
    text-decoration: none;
}

#carbonads a:hover {
    color: inherit;
}

#carbonads span {
    position: relative;
    display: block;
    overflow: hidden;
}

#carbonads .carbon-wrap {
    display: flex;
}

#carbonads .carbon-img {
    display: block;
    margin: 0;
    line-height: 1;
}

#carbonads .carbon-img img {
    display: block;
}

#carbonads .carbon-text {
    font-size: 13px;
    padding: 10px;
    line-height: 1.5;
    text-align: left;
}

#carbonads .carbon-poweredby {
    display: block;
    padding: 8px 10px;
    background: repeating-linear-gradient(-45deg, transparent, transparent 5px, hsla(0, 0%, 0%, .025) 5px, hsla(0, 0%, 0%, .025) 10px) hsla(203, 11%, 95%, .4);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    font-size: 9px;
    line-height: 1;
}

.clear-all-button {
    width: 100%;
    padding: 12px 15px;
    background-color: #d9534f;
    color: white;
    border: none;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
}

.clear-all-button:hover {
    background-color: #c9302c;
}

.chat-slot {
    width: 100%;
    padding: 12px 15px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: left;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

.chat-slot:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.chat-slot.active {
    background-color: #4a90e2;
    color: white;
    border-color: #4a90e2;
    font-weight: bold;
}

.middle-panel {
    width: 40%;
    background-color: #e0e0e0;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.middle-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}


#activeChatName {
    position: absolute;
    left: 20%;
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.chat-name-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-name-container #apiKeyButton {
    padding: 6px 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.chat-name-container #apiKeyButton:hover {
    background-color: #218838;
}

.stack-icon {
    width: 32px;
    height: 32px;
    background-color: #4a90e2;
    border: 2px solid #357abd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    font-family: Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stack-icon.warning {
    background-color: #f0ad4e;
    border-color: #eea236;
}

.stack-icon.danger {
    background-color: #d9534f;
    border-color: #c9302c;
}

.model-select {
    order: 2;
    padding: 8px 10px 8px 10px;
    padding-right: 30px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    width: auto;
    max-width: 250px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.model-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.add-model-option {
    color: #4a90e2;
    font-style: italic;
}

#chatNameDisplay {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #f5f5f5;
    max-height: 100%;
}

.chat-bubble {
    position: relative;
    width: 95%;
    margin: 0 auto 15px auto;
    padding: 15px;
    background-color: #e0e0e0;
    border: 1px solid #999;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 95%;
    box-sizing: border-box;
}

.chat-bubble-assistant {
    background-color: #fff;
    border-color: #4a90e2;
}

.bubble-metadata {
    font-size: 12px;
    color: #666;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.token-timer {
    font-size: 11px;
    color: #999;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
    padding: 4px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
}

.token-timer.timer-complete {
    color: #4a90e2;
    font-weight: bold;
}

.token-timer.timer-saved {
    position: absolute;
    top: 10px;
    right: 45px;
    margin: 0;
    z-index: 10;
}

.regenerate-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 6px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.regenerate-btn:hover {
    background-color: #357abd;
}

.regenerate-btn .material-icons {
    font-size: 18px;
}

.regenerate-btn-user {
    position: absolute;
    top: 10px;
    right: 10px;
}

.bubble-reasoning {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.reasoning-label {
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
    font-size: 12px;
}

.reasoning-content {
    color: #555;
    font-style: italic;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bubble-content {
    white-space: normal;
    word-wrap: break-word;
}

/* Markdown styling within chat bubbles */
.bubble-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
}

.bubble-content code {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.bubble-content pre code {
    background-color: transparent;
    padding: 0;
}

.bubble-content h1,
.bubble-content h2,
.bubble-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.bubble-content p {
    margin: 12px 0;
    line-height: 1.6;
}

.bubble-content ul,
.bubble-content ol {
    margin: 12px 0;
    padding-left: 32px;
}

.bubble-content li {
    margin: 6px 0;
    line-height: 1.5;
}

.bubble-content blockquote {
    border-left: 3px solid #ccc;
    padding-left: 12px;
    margin: 8px 0;
    color: #666;
}

.bubble-content a {
    color: #4a90e2;
    text-decoration: none;
}

.bubble-content a:hover {
    text-decoration: underline;
}

/* Markdown styling within reasoning section */
.reasoning-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
}

.reasoning-content code {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.reasoning-content pre code {
    background-color: transparent;
    padding: 0;
}

.reasoning-content p {
    margin: 12px 0;
    line-height: 1.6;
}

.reasoning-content ul,
.reasoning-content ol {
    margin: 12px 0;
    padding-left: 32px;
}

.reasoning-content li {
    margin: 6px 0;
    line-height: 1.5;
}

.chat-bubble-error {
    background-color: #ffe0e0;
    border-color: #d9534f;
    color: #a94442;
}

.input-container {
    height: 200px;
    width: 100%;
    border-top: 1px solid #ccc;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ccc;
}

.input-footer span {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.footer-buttons {
    display: flex;
    gap: 10px;
}

.input-footer button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.input-footer button:hover {
    background-color: #357abd;
}

.input-container textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 10px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    resize: none;
    background-color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.right-panel {
    width: 40%;
    background-color: #e0e0e0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.right-content {
    flex: 1;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.right-content textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.right-footer {
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10px;
}

.right-footer button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.right-footer button:hover {
    background-color: #357abd;
}

.context-menu {
    position: fixed;
    display: none;
    background-color: white;
    border: 1px solid #333;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 150px;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
}

.context-menu-item:hover {
    background-color: #f5f5f5;
}

.context-menu-item:first-child {
    border-radius: 5px 5px 0 0;
}

.context-menu-item:last-child {
    border-radius: 0 0 5px 5px;
}

.is-hidden {
    display: none;
}

.payload-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2d2d2d;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.payload-content {
    margin: 0;
    padding: 20px;
    color: #e0e0e0;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    counter-reset: line;
    max-width: 100%;
    box-sizing: border-box;
}

.payload-content.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 16px;
    color: #999;
}

.readme-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    box-sizing: border-box;
}

.readme-title {
    color: #333;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 24px;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #999;
}

.readme-content {
    color: #333;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 20px;
}

.readme-content h1 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
}

.readme-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 20px;
}

.readme-content h3 {
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 16px;
}

.readme-content p {
    margin: 12px 0;
    text-indent: 20px;
}

.readme-content ol,
.readme-content ul {
    margin: 15px 0;
    padding-left: 40px;
}

.readme-content li {
    margin: 8px 0;
    line-height: 1.8;
}

.readme-content li ul,
.readme-content li ol {
    margin: 8px 0;
    padding-left: 30px;
}

.readme-content hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #999;
}

.readme-content code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
}

.readme-content a {
    color: #0066cc;
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

.readme-content img {
    display: block;
    margin: 20px 0;
}


