body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    overflow: hidden;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 20px;
}

h1 {
    text-align: center;
    color: #24a9a5;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.chat-container {
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 75vh;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    scroll-behavior: smooth;
}

.input-area {
    display: flex;
    padding: 16px;
    border-top: 1px solid #f0f0f0;
    background-color: #fff;
    position: relative;
}

#user-input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #e7e7e7;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    outline: none;
    font-family: 'Poppins', sans-serif;
}

#user-input:focus {
    border-color: #3498db;
    box-shadow: 0 2px 15px rgba(52, 152, 219, 0.15);
}

#send-btn {
    margin-left: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
}

#send-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

#send-btn:active {
    transform: translateY(0);
}

.message {
    margin-bottom: 20px;
    padding: 0;
    border-radius: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background-color: #3498db;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    padding: 15px 20px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
}

.assistant-message {
    background-color: #f8f9fa;
    color: #333;
    align-self: flex-start;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 0;
}

.loading {
    font-style: italic;
    color: #777;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
}

.loading:after {
    content: "...";
    animation: loading 1.5s infinite;
    width: 20px;
    text-align: left;
}

@keyframes loading {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

.contexts {
    margin: 0 0 15px 0;
    padding: 15px 20px;
    background-color: #f1f7fa;
    border-radius: 18px 18px 18px 4px;
    border-left: 4px solid #17a2b8;
    font-size: 0.9rem;
}

.contexts h4 {
    margin: 0 0 10px 0;
    color: #17a2b8;
    font-weight: 600;
    font-size: 1rem;
}

.contexts ul {
    margin: 0;
    padding-left: 20px;
}

.contexts li {
    margin-bottom: 8px;
    line-height: 1.4;
}

hr {
    border: none;
    border-top: 1px solid #edf2f7;
    margin: 15px 0;
}

.answer {
    padding: 15px 20px;
}

.answer h4 {
    margin: 0 0 10px 0;
    color: #28a745;
    font-weight: 600;
    font-size: 1rem;
}

/* Markdown content styles - enhanced */
.markdown-content {
    line-height: 1.7;
    font-size: 1rem;
}

.markdown-content h1 {
    font-size: 1.8em;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
    font-weight: 600;
    color: #2c3e50;
}

.markdown-content h2 {
    font-size: 1.5em;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
    font-weight: 600;
    color: #2c3e50;
}

.markdown-content h3 {
    font-size: 1.3em;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    font-weight: 600;
    color: #2c3e50;
}

.markdown-content p {
    margin-bottom: 1.2em;
}

.markdown-content ul, 
.markdown-content ol {
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content code {
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 85%;
    padding: 0.2em 0.4em;
}

.markdown-content pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 85%;
    line-height: 1.45;
    overflow: auto;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #eaecef;
}

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

.markdown-content blockquote {
    border-left: 4px solid #dfe2e5;
    color: #6a737d;
    margin-left: 0;
    padding: 0 1em;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.markdown-content table {
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
    display: block;
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #eaecef;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #eaecef;
    padding: 8px 13px;
}

.markdown-content table tr {
    background-color: #fff;
    border-top: 1px solid #eaecef;
}

.markdown-content table tr:nth-child(2n) {
    background-color: #f8f9fa;
}

.markdown-content table th {
    background-color: #f1f3f5;
    font-weight: 600;
    text-align: left;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #eaecef;
}

/* Dark mode toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        margin: 1rem auto;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .chat-container {
        height: 80vh;
        border-radius: 12px;
    }
    
    #chat-messages {
        padding: 15px;
    }
    
    .message {
        max-width: 90%;
    }
}

.general-knowledge-notice {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.general-knowledge-notice p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

body.dark-mode .general-knowledge-notice {
    background-color: #2c2c2c;
    border-left-color: #ffc107;
}

body.dark-mode .general-knowledge-notice p {
    color: #ffc107;
}

/* Add these styles to handle the new sidebar and chat UI */

/* Layout */
.sidebar {
    width: 300px;
    height: 100vh;
    background-color: #f5f7f9;
    border-right: 1px solid #e6e9ed;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 100;
}

.main-content {
    flex: 1;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Sidebar components */
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e6e9ed;
}

.sidebar-header h2 {
    margin: 0 0 16px 0;
    font-size: 1.3rem;
    color: #24a9a5;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background-color: #24a9a5;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background-color: #1d8a87;
    transform: translateY(-1px);
}

.new-chat-btn:active {
    transform: translateY(0);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.conversation-item:hover {
    background-color: #e9ecef;
}

.conversation-item.active {
    background-color: #e2f2f1;
}

.conversation-info {
    flex: 1;
    overflow: hidden;
}

.conversation-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.conversation-preview {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.delete-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
}

.delete-btn:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e6e9ed;
}

.clear-all-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background-color: #e9ecef;
    color: #dc3545;
}

/* Chat container modifications */
.chat-container {
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.chat-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: #24a9a5;
    background-color: rgba(36, 169, 165, 0.1);
}

/* Mobile sidebar toggle */
.mobile-sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 99;
    display: none;
}

/* Modal for renaming */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-buttons button {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

#rename-cancel {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

#rename-confirm {
    background-color: #24a9a5;
    color: white;
    border: none;
}

/* Loading animation with dots */
.loading-dots-container {
    padding: 20px;
}

.loading-dots {
    display: flex;
    align-items: center;
    column-gap: 8px;
    justify-content: center;
}

.loading-dots span {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background-color: #c0c0c0;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Dark mode adjustments */
body.dark-mode .sidebar {
    background-color: #1a1a2e;
    border-right-color: #0f3460;
}

body.dark-mode .sidebar-header,
body.dark-mode .sidebar-footer {
    border-color: #0f3460;
}

body.dark-mode .new-chat-btn {
    background-color: #4361ee;
}

body.dark-mode .new-chat-btn:hover {
    background-color: #3a56d4;
}

body.dark-mode .conversation-item:hover {
    background-color: #212f45;
}

body.dark-mode .conversation-item.active {
    background-color: #30305a;
}

body.dark-mode .conversation-preview {
    color: #a0aec0;
}

body.dark-mode .clear-all-btn {
    background-color: #16213e;
    color: #a0aec0;
    border-color: #0f3460;
}

body.dark-mode .clear-all-btn:hover {
    background-color: #212f45;
    color: #ff6b6b;
}

body.dark-mode .chat-header {
    border-bottom-color: #0f3460;
}

body.dark-mode .action-btn {
    color: #a0aec0;
}

body.dark-mode .action-btn:hover {
    color: #4cc9f0;
    background-color: rgba(76, 201, 240, 0.1);
}

body.dark-mode .mobile-sidebar-toggle {
    background-color: #16213e;
    color: #f1f1f1;
}

body.dark-mode .modal-content {
    background-color: #16213e;
    color: #f1f1f1;
}

body.dark-mode .modal-content input {
    background-color: #1a1a2e;
    border-color: #0f3460;
    color: #f1f1f1;
}

body.dark-mode #rename-cancel {
    background-color: #212f45;
    color: #a0aec0;
    border-color: #0f3460;
}

body.dark-mode .loading-dots span {
    background-color: #4cc9f0;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        opacity: 0;
        width: 80%;
        max-width: 300px;
    }
    
    .sidebar.open {
        transform: translateX(0);
        opacity: 1;
    }
    
    .mobile-sidebar-toggle {
        display: flex;
    }
    
    .main-content {
        width: 100%;
    }
    
    .chat-container {
        border-radius: 0;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-header h1 {
        font-size: 1.2rem;
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
} 