:root {
    --primary-color: #0054A6;    /* Global AI Hub dark blue */
    --primary-dark: #004385;     /* Very dark blue */
    --primary-light: #0072CE;    /* Global AI Hub lighter blue */
    --secondary-color: #E8F4FF;  /* Light blue background */
    --user-message-color: #0072CE; /* User message bubble */
    --user-message-dark: #0061B3; /* User message dark */
    --success-color: #00D1A7;    /* Green */
    --accent-color: #1DA1F2;     /* Twitter blue for accents */
    --bg-color: #FFFFFF;
    --bg-light: #F5F9FF;         /* Very light blue background */
    --text-color: #1A1A1A;
    --text-light: #666666;
    --border-color: #E6E6E6;
    --shadow-sm: 0 2px 4px rgba(0, 84, 166, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 84, 166, 0.15);
    --gradient: linear-gradient(135deg, #0054A6, #0072CE);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.chat-header {
    padding: 0.75rem 1.5rem;
    background: var(--gradient);
    border-bottom: none;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100;
    height: 60px;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
}

.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: white;
    transition: var(--transition);
}

.papara-logo {
    height: 32px;
    width: auto;
    margin-right: 12px;
}

.title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 500;
    color: white;
    letter-spacing: 0.5px;
}

/* GitHub Link Styles */
.github-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.1);
}

.github-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.github-link svg {
    color: white;
}

/* Chat Area Styles */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: var(--bg-color);
}

.message {
    max-width: 75%;
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.message.welcome .message-content {
    background: var(--secondary-color);
    border: 1px solid rgba(0, 84, 166, 0.07);
    padding: 1.5rem 2rem;
    text-align: left;
    max-width: 600px;
    margin: 1rem auto;
    border-radius: 22px;
    box-shadow: 0 4px 15px rgba(0, 84, 166, 0.08);
}

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

.message.user {
    align-self: flex-end;
    margin-left: 25%;
}

.message.bot {
    align-self: flex-start;
    margin-right: 25%;
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    line-height: 1.6;
    font-size: 1rem;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: transform 0.2s ease;
}

.message.user .message-content {
    background: var(--gradient);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 84, 166, 0.25);
}

.message.bot .message-content {
    background: var(--secondary-color);
    border: 1px solid rgba(0, 84, 166, 0.07);
    color: var(--text-color);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 84, 166, 0.1);
}

/* Markdown content styling */
.markdown-body {
    line-height: 1.6;
}

.markdown-body p {
    margin-bottom: 0.8rem;
}

.markdown-body p:last-child {
    margin-bottom: 0;
}

.markdown-body ul, .markdown-body ol {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.markdown-body li {
    margin-bottom: 0.4rem;
}

.markdown-body li:last-child {
    margin-bottom: 0;
}

.markdown-body li p {
    margin-bottom: 0.4rem;
}

.markdown-body pre {
    margin-bottom: 0.8rem;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    overflow-x: auto;
}

.message.user .markdown-body pre {
    background-color: rgba(255, 255, 255, 0.1);
}

.markdown-body code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.message.user .markdown-body code {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, 
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    margin-top: 1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-body h1 {font-size: 1.6rem;}
.markdown-body h2 {font-size: 1.4rem;}
.markdown-body h3 {font-size: 1.2rem;}
.markdown-body h4 {font-size: 1.1rem;}
.markdown-body h5, .markdown-body h6 {font-size: 1rem;}

/* Input Area Styles */
.chat-input {
    padding: 1rem 1.25rem;
    background: white;
    border-top: 1px solid rgba(0, 84, 166, 0.1);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    gap: 0.75rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.chat-input input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 84, 166, 0.15);
}

.send-button {
    padding: 0.9rem;
    width: 48px;
    height: 48px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 84, 166, 0.2);
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 84, 166, 0.3);
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
    opacity: 0.6;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: white;
    z-index: 200;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    background: var(--gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.new-chat-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin: 1rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    cursor: pointer;
    width: calc(100% - 2rem);
    transition: var(--transition);
    text-decoration: none;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.new-chat-button:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

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

.conversation-item {
    display: block;
    padding: 1rem;
    margin: 0.5rem 0;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 12px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.conversation-item:hover {
    background: var(--secondary-color);
}

.conversation-item.active {
    background: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .message {
        max-width: 90%;
    }
    
    .chat-input {
        padding: 1rem;
    }
    
    .chat-input input {
        font-size: 0.9rem;
    }
    
    .send-button {
        padding: 0.5rem;
    }
    
    .sidebar {
        width: 85%;
    }
    
    .github-link span {
        display: none;
    }
    
    .github-link {
        padding: 6px;
    }
    
    .message-content {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .message.welcome .message-content {
        padding: 1.25rem;
        margin: 0.5rem auto;
    }
    
    .chat-messages {
        padding: 1.5rem;
        gap: 1rem;
    }
}
