@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Colors */
    --primary-color: #19C37D;
    --primary-hover: #15a76c;
    --primary-light: rgba(25, 195, 125, 0.1);
    --text-primary: #2D3748;
    --text-secondary: #4A5568;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F7FAFC;
    --bg-chat: #F9FAFB;
    --border-color: #E2E8F0;
    --error-color: #E53E3E;
    --warning-bg: #FFF9E5;
    --warning-text: #92400E;

    /* Layout */
    --sidebar-width: 320px;
    --header-height: 64px;
    
    /* UI Elements */
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    display: flex;
    height: 100vh;
    background: var(--bg-chat);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

/* Headers */
.sidebar-header,
.chat-header {
    height: var(--header-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: var(--bg-primary);
}

.chat-header { justify-content: space-between; }

.sidebar-header h2,
.chat-header h1 {
    font-size: 16px;
    font-weight: 600;
}

/* Upload Section */
.upload-section {
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.file-input-wrapper { margin-top: 12px; }
.file-input { display: none; }

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.file-label:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Documents List */
.documents-list {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Styles */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    animation: messageSlide 0.3s ease;
    box-shadow: var(--shadow-sm);
    width: fit-content;
}

.user-message {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Input Area */
.chat-input {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 12px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    font-family: inherit;
    width: 91%;
}

ul {
    margin: 0;
    padding: 10px 15px;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.send-btn {
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.send-btn:hover:not(:disabled) { background: var(--primary-hover); }
.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Markdown Content */
.markdown-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.markdown-content pre,
.markdown-content code {
    font-family: var(--font-mono);
    font-size: 13px;
}

.markdown-content pre {
    margin: 16px 0;
    padding: 16px;
    background: #1E1E1E;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.markdown-content code {
    padding: 2px 4px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: #E2E8F0;
    line-height: 1.5;
}

/* Animations */
@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .sidebar { 
        width: 100%;
        max-height: 40vh;
    }
    .chat-messages { padding: 20px 16px; }
    .message { max-width: 90%; }
}

.active { background-color: #E2E8F0; }

/* filepath: /c:/Users/divami-user/Documents/GitHub/ai-demos/RAG-pdf-model/static/styles.css */
.markdown-content ul {
    list-style: none;
    padding-left: 20px;
    margin: 8px 0;
}

.markdown-content li {
    position: relative;
    padding-left: 20px;
    margin: 4px 0;
}

.markdown-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

.markdown-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}