@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* Apply the font to the body */
body {
    font-family: 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    display: flex;
    overflow: hidden;
    background: #f5f5f5;
    flex-direction: column;
}

.chat {
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    max-height: 100vh;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.chat-box {
    overflow-y: auto;
    margin-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-top: 10px; 
}

.chat-box .message-content ::marker {
    color: #5e5e5e;
}

.toolbar{
    position: relative;
    overflow: hidden;
    height: 30px;
}
.chat-header{
    margin-top: -10%;
}

.chat-header h1{
    text-align: center; 
    font-weight: 400; 
    font-size: 27px;
    user-select: none;
}

.chat-input {
    display: flex;
    gap: 5px;
    flex-direction: row;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
    font-size: 16px;
}

.message {
    margin-bottom: 10px;
    width: fit-content;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
.message.progress-message{
    padding-bottom: 0;
}

.message-content p:only-child, .message-content p:last-child {
    margin-bottom: 0;
}

.message-content math{
    margin-top: 15px;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    font-size: 120%;
}

.message-image{
    max-width: 250px;
    max-height: 300px;
    border-radius: 4px;
    padding: 3px;
    background: white;
    box-shadow: 0px 0px 2px #939393;
    margin-left: 2px;
    margin-bottom: 10px;
    margin-top: 1px;
}

.user-message {
    width: 100%;
    margin-bottom: 20px;
}

.user-message .message-content{
    background-color: #dee2e67a;
}

.message-content{
    padding: 10px 15px;
    border-radius: 15px;
}

.message-content h2{
    font-weight: 500;
}

.audio-message{
    background: none;
    padding-right: 0;
}

.audio-message audio{
    height: 25px;
}

.ai-message {
    width: 100%;
    box-sizing: border-box;
    max-width: none;
}
.ai-message .message-content{
    padding-left: 0px;
    padding-right:0;
}
.progress-message {
    background-color: #F8F9FA;
    color: #666;
    border: 1px solid #F8F9FA;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
}

.progress-message.success {
    background-color: #ceffda;
    color: #0e872a;
    border-color: #9aedae;
}

.progress-message.error {
    background-color: #ffd8dc;
    color: #e4263a;
    border-color: #ffadb4;
    text-align: left;
}

.upgrade-message {
    background: linear-gradient(135deg, #4facfe 0%, #6263dc 100%);
    color: #ffffff;
    border-color: #7dbfff;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    border-radius: 10px;
    margin-bottom: 30px;
}

.upgrade-button {
    background: white;
    border: none;
    color: #6263dc;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    display: inline-block;
}

.upgrade-button:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.upgrade-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.chat-input-message {
    flex: 1;
    padding: 15px 15px 0;
    border: 1px solid #DDD;
    border-radius: 10px;
    font-size: 14px; 
    height: 18px;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    box-sizing: border-box;
    min-height: 120px;
    height: 48px;
    transition: 0.1s ease all;
    padding-right: 50px;

}
.chat-input-message:focus-within, .chat-input-message:focus {
    outline: none;
    border-color: #bfbaba;
}
.chat-input-message::placeholder{
    color: #aeaeae;
}

.chat.active .chat-input-message{
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: -3px;
}

.send {
    padding: 7px 10px;
    background-color: #484d51;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 25px;
    height: 25px;
    position: absolute;
    right: 10px;
    top: 10px;
    display: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.3s ease background-color;
}

.send:hover {
    background-color: #333;
}

.send:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.message-content {
    line-height: 1.5;
}

.progress-message .message-content {
    display: flex;
    padding: 5px 10px;
}

.message-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 10px;
    opacity: 1;
}

.message-content p {
    margin: 0 0 10px 0;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0;
    border-radius: 4px;
    overflow-x: auto;
}

pre.code-output{
    font-size: 14px; background: white; padding: 0; border: 1px solid #EEE; border-radius: 5px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.code-output code{
    display: block;
    padding: 0 10px 10px 10px;
}
code, pre{
    font-family: "Roboto Mono", monospace;
}

.message-content code {
    font-family: "Roboto Mono", monospace;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
}

.message-content ul, .message-content ol {
    margin: 0 0 10px 0px;
    padding-left: 35px;
}

a {
    color: rgb(47, 134, 233);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.progress-spinner {
}

.progress-message .progress-spinner{
    margin-right: 5px;
    margin-left: 10px;
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.dir, .file, .app, .email{
    cursor: pointer;
    display: inline; 
    padding: 0px 2px; 
    border-radius: 2px;
    font-weight: 500;
}

.dir{
    display: inline-block;
}

.dir:hover, .file:hover, .app:hover{
    background: #ffffffc2;
}

/* Dark theme styles */
body.dark-theme {
    background: #1a1a1a;
}

.dark-theme .chat-header h1 {
    color: #e1e1e1;
}

.dark-theme .chat-input-message {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
    color: #e1e1e1;
}

.dark-theme .chat-input-message:focus-within,
.dark-theme .chat-input-message:focus {
    border-color: #4d4d4d;
    box-shadow: 0px 0px 6px #1a1a1a;
}

.dark-theme .ai-message {
    background-color: #2d2d2d;
    color: #e1e1e1;
}

.dark-theme .user-message {
    background-color: #3d3d3d;
    color: white;
}

.dark-theme .audio-message {
    background: none;
}

.dark-theme .progress-message {
    background-color: #2d2d2d;
    color: #e1e1e1;
    border-color: #3d3d3d;
}

.dark-theme .progress-message.success {
    background-color: #1b4332;
    color: #4ade80;
    border-color: #1b4332;
}

.dark-theme .progress-message.error {
    background-color: #470f1a;
    color: #f87171;
    border-color: #470f1a;
}

.dark-theme .burger-icon {
    background: #2d2d2d;
}

.dark-theme .burger-icon span {
    background-color: #e1e1e1;
}

.dark-theme .dir:hover,
.dark-theme .file:hover,
.dark-theme .app:hover {
    background: #4d4d4d;
}

.dark-theme .message-content pre {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .message-content code {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme a {
    color: #60a5fa;
}

.dark-theme .progress-spinner {
    border-color: #4d4d4d;
    border-top-color: transparent;
}

.dark-theme pre.code-output {
    background: #2d2d2d;
    border: none;
    color: white;
}

.transcript-container {
    margin-top: 8px;
    padding-top: 8px;
}

.transcript-toggle {
    cursor: pointer;
    color: #666;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.transcript-toggle:hover {
    color: #333;
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.transcript-toggle.active .toggle-icon {
    transform: rotate(-180deg);
}

.transcript-content {
    margin-top: 8px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 0.9em;
    color: #333;
    transition: all 0.3s ease;
}

.transcript-content.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.transcript-content:not(.hidden) {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dark-theme .transcript-content {
    background: #2a2a2a;
    color: #ddd;
}

.dark-theme .transcript-toggle {
    color: #aaa;
}

.dark-theme .transcript-toggle:hover {
    color: #fff;
}

audio::-webkit-media-controls-play-button, audio::-webkit-media-controls-panel {
    background: white;
}

.dark-theme audio::-webkit-media-controls-play-button, .dark-theme audio::-webkit-media-controls-panel {
    background: #2d2d2d;
}

.message {
    position: relative;
    font-size: 14px;
}

.copy-icon, .edit-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #3c3c3c;
    padding: 6px;
    position: absolute;
    bottom: 5px;
    right: 5px;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    position: absolute;
    bottom: -5px;
    right: 0;
}
.copy-icon{
    left: 0;
}
.copy-icon svg, .edit-icon svg {
    fill: currentColor;
    width: 16px;
    height: 16px;
}
.message:hover .copy-icon, 
.message:hover .edit-icon {
    opacity: 1;
}
.copy-icon:hover, .edit-icon:hover {
    color: #333;
    background-color: #f7f7f7;
}
.copy-icon.success {
    color: #4CAF50;
    opacity: 1;
}

.message-editing {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.edit-message-input {
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    min-height: 80px;
    max-height: 300px;
    resize: vertical;
    box-sizing: border-box;
    overflow-y: auto;
    display: block;
    margin: 0;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 5px;
}

.edit-actions button {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 12px;
}

.edit-actions .save-edit {
    background-color: #484d51;
    color: white;
    border-color: #484d51;
}

.edit-actions button:hover {
    opacity: 0.9;
}

.code-block {
    position: relative;
    margin: 1em 0;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    font-size: 12px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 5px;
    background: #f3f3f3;
    border-bottom: 1px solid #eee;
    font-family: 'Roboto', sans-serif;
    margin-top: -18px;
}

.code-language {
    font-size: 11px;
    color: #666;
    text-transform: lowercase;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.code-copy-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height:20px;
    margin-top:2px;
}

.code-copy-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.code-copy-btn.success {
    background: rgba(14, 135, 42, 0.1);
    border-radius: 4px;
}

.code-copy-btn.success svg path {
    fill: #0e872a;
}

.code-block code {
    display: block;
    padding: 12px 16px;
    overflow-x: auto;
    line-height: 1.6;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
}

.code-block code::-webkit-scrollbar {
    height: 8px;
}

.code-block code::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.code-block code::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.code-block code::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Dark theme support */
.dark-theme .code-block {
    background: #1e1e1e;
    border-color: #2d2d2d;
}

.dark-theme .code-header {
    background: #2d2d2d;
    border-bottom-color: #3d3d3d;
}

.dark-theme .code-language {
    color: #999;
}

.dark-theme .code-copy-btn svg path {
    fill: #999;
}

.dark-theme .code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .code-copy-btn.success {
    background: rgba(14, 135, 42, 0.2);
}

.dark-theme .code-block code::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.dark-theme .code-block code::-webkit-scrollbar-thumb {
    background: #444;
}

.dark-theme .code-block code::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.send.processing {
    background-color: #d64242 !important;
}
.send.processing:hover {
    background-color: #b53535 !important;
}

/* Chat History Styles */
.chat-history-heading {
    padding: 10px 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f5f5f5;
    margin-top: 40px;
    font-size: 12px;
    user-select: none;
}

.saved-chats-list {
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.chat-item {
    padding: 10px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.chat-item:hover {
    background-color: #f8f8f8;
}

.chat-item.active {
    background-color: #f0f0f0;
    border-left: 3px solid #484d51;
}

.chat-item-title {
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    width: calc(100% - 25px);
}

.chat-item-date {
    color: #999;
    font-size: 12px;
}

.chat-item-options {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-item:hover .chat-item-options {
    opacity: 1;
}

.delete-chat {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #999;
    border-radius: 3px;
}

.delete-chat:hover {
    background-color: #f0f0f0;
    color: #d32f2f;
}

.delete-chat svg {
    fill: currentColor;
}

.no-chats-message {
    padding: 20px;
    color: #999;
    font-size: 14px;
    text-align: center;
    font-style: italic;
    user-select: none;
}

/* Dark theme styles for chat history */
body.dark-theme .chat-history-heading {
    color: #ccc;
    border-bottom-color: #3d3d3d;
}

body.dark-theme .chat-item {
    border-bottom-color: #3d3d3d;
}

body.dark-theme .chat-item:hover {
    background-color: #3a3a3a;
}

body.dark-theme .chat-item.active {
    background-color: #2a2a2a;
    border-left-color: #e1e1e1;
}

body.dark-theme .chat-item-title {
    color: #e1e1e1;
}

body.dark-theme .chat-item-date {
    color: #888;
}

body.dark-theme .delete-chat:hover {
    background-color: #2a2a2a;
    color: #f44336;
}

body.dark-theme .no-chats-message {
    color: #888;
}

/* Dark theme overrides for edit elements */
.dark-theme .edit-icon:hover {
    color: #ddd;
    background-color: #444;
}

.dark-theme .edit-message-input {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e1e1e1;
}

.dark-theme .edit-actions button {
    background: #333;
    border-color: #444;
    color: #e1e1e1;
}

.dark-theme .edit-actions .save-edit {
    background-color: #444;
    color: white;
    border-color: #555;
}

.dark-theme .edit-actions button:hover {
    background: #444;
}

/* Header New Chat Button */
.header-new-chat {
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.1s ease;
    color: #292929; 
    display: flex; 
    align-items: center; 
    margin-left: 10px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    justify-content: center;
    align-items: center;
}


.header-new-chat:hover {
    background-color: #e9e9e9;
    text-decoration: none;
}

.header-new-chat.hidden {
    display: none !important;
}

/* Dark theme styles for header new chat button */
.dark-theme .header-new-chat {
    background: #2d2d2d;
    color: #60a5fa !important;
}

.dark-theme .header-new-chat:hover {
    background-color: #3d3d3d;
}

.dark-theme .header-new-chat svg path {
    fill: #60a5fa;
}

.example-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 10px;
    justify-content: center;
    transition: opacity 0.3s ease, height 0.3s ease;
    
}
.example-prompts.hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.example-prompt {
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}
.example-prompt:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}
.example-prompt svg {
    width: 14px; height: 14px; margin-bottom: -1px; margin-right: 5px;
}

body.dark-theme .example-prompt {
    background: #2a2a2a;
    color: #ccc;
}
body.dark-theme .example-prompt:hover {
    background: #3a3a3a;
}

.header-new-chat{
    cursor: pointer;
    position: absolute;
    right: 60px;
    top: 10px;
}

.close-button{
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
}
.close-button svg{
    width: 12px;
    height: 12px;
}

.close-button:hover{
    background-color: #e9e9e9;
}

.todo-list .message-content{
    background-color: white;
    padding: 15px 15px 15px 15px;
}

.todo-list ul{
    padding-left: 0;
    margin-bottom: 0;
}
.todo-list li{
    list-style: none;
}

/* Gentle throb animation for pending todos */
@keyframes gentleThrob {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

.todo-list .todo-in_progress {
    animation: gentleThrob 1s ease-in-out infinite;
    transform-origin: left center;
}

.todo-list .todo-completed {
    color: #029802;
}

.todo-list ul li svg {
    margin-bottom: -1px;
}

