:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #f3f4f6;
    --secondary-dark: #e5e7eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --border: #d1d5db;
    --radius: 8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-dark);
}

.chat-container {
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
}

.sidebar {
    width: 280px;
    min-width:200px;
    background-color: #f8fafc;
    border-right: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 0 var(--radius) var(--radius) 0;
    max-width: 720px;
}

.dropdown-content
{
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-radius: var(--radius);
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border-radius: 0 var(--radius) 0 0;
}

.chat-box {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #fcfcfc;
}

.user-bubble, .ai-bubble {
    max-width: 98%;
    padding: 14px 18px;
    border-radius: 12px;
    word-wrap: break-word;
    margin-bottom: 8px;
    position: relative;
    line-height: 1.6;
}

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

.ai-bubble {
    align-self: flex-start;
    background-color: var(--secondary);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* AI response formatted content */
.ai-bubble h1, .ai-bubble h2, .ai-bubble h3 {
    margin: 18px 0 10px 0;
    font-weight: 600;
}

.ai-bubble h1 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.ai-bubble h2 {
    font-size: 1.3em;
}

.ai-bubble h3 {
    font-size: 1.1em;
}

.ai-bubble p {
    margin-bottom: 14px;
}

.ai-bubble ul, .ai-bubble ol {
    margin-left: 20px;
    margin-bottom: 14px;
}

.ai-bubble li {
    margin-bottom: 6px;
}

.ai-bubble pre {
    background-color: #f1f5f9;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}

.ai-bubble code {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    background-color: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

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

.ai-bubble blockquote {
    border-left: 3px solid #cbd5e1;
    margin-left: 5px;
    padding-left: 16px;
    color: #64748b;
    font-style: italic;
    margin-bottom: 14px;
}

.ai-bubble hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 18px 0;
}

.ai-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 14px;
}

.ai-bubble th, .ai-bubble td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}

.ai-bubble th {
    background-color: #f8fafc;
}

.ai-bubble strong {
    font-weight: 600;
}

.ai-bubble em {
    font-style: italic;
}

.input-area {
    display: flex;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background-color: white;
}

#user-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    font-size: 16px;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    font-family: inherit;
}

#user-input:focus {
    border-color: var(--primary);
}

#send-button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

#send-button:hover {
    background-color: var(--primary-dark);
}

.typing-indicator {
    padding: 10px 15px;
    background-color: #f1f5f9;
    border-radius: 12px;
    margin-bottom: 10px;
    align-self: flex-start;
    color: var(--text-light);
    font-style: italic;
    display: none;
}

.typing-indicator::after {
    content: "";
    display: inline-block;
    animation: ellipsis 1.5s infinite;
    width: 20px;
    text-align: left;
}

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

.clear-button {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.clear-button:hover {
    opacity: 0.9;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-weight: 600;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.sidebar select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: white;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 14px;
}

.sidebar select:focus {
    border-color: var(--primary);
    outline: none;
}

.sidebar-footer {
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    padding-top: 20px;
}

.ai-bubble .code-header {
    background-color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px 6px 0 0;
    font-family: monospace;
    font-size: 0.85em;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-bubble .code-header + pre {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.copy-code {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-code:hover {
    color: var(--primary);
}

/* Additional mobile-specific styles */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    .chat-container {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        transition: left 0.3s ease;
        border-radius: 0;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        display: flex;
        flex-direction: column;
        height: 100vh;
        width: 100%;
        border-radius: 0;
    }
    
    .chat-box {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 80px; /* Make room for fixed input area */
    }
    
    .input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px;
        background: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        z-index: 100;
    }
    
    .toggle-sidebar {
        display: block;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    /* Dropdown menu styles for mobile */
    .dropdown {
        position: relative;
        display: inline-block;
    }
    
    .dropdown-content {
        display: none;
        position: absolute;
        right: 0;
        background-color: white;
        min-width: 160px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        z-index: 100;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .dropdown-content.show {
        display: block;
    }
    
    .dropdown-content a {
        color: var(--text-dark);
        padding: 12px 16px;
        text-decoration: none;
        display: block;
        font-size: 14px;
    }
    
    .dropdown-content a:hover {
        background-color: var(--secondary);
    }
    
    .dropdown-toggle {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-dark);
    }
    
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 90%;
    animation: slideDown 0.3s forwards;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.notification-icon {
    color: var(--primary);
}

.notification-message {
    flex: 1;
}

.notification-actions {
    display: flex;
    gap: 8px;
}

.notification-btn {
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.notification-btn-primary {
    background-color: var(--primary);
    color: white;
}

.notification-btn-secondary {
    background-color: var(--secondary);
    color: var(--text-dark);
}

/* Additional tweaks */
.toggle-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-dark);
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-dark);
}


/* Add this mobile-specific style for the typing indicator */
@media (max-width: 768px) {
    .typing-indicator {
        position: fixed;
        bottom: 70px; /* Position above the input area */
        left: 20px;
        z-index: 120; /* Below notifications but above regular content */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--border);
        margin-bottom: 0;
        max-width: 70%; /* Limit width on mobile */
    }
    
    /* Make sure chat box padding accommodates the indicator */
    .chat-box {
        padding-bottom: 100px; /* Increase from 80px to make room for typing indicator */
    }
}