:root {
    --primary-blue: #1e88e5;
    --light-blue: #64b5f6;
    --dark-blue: #0d47a1;
    --sidebar-bg: rgba(13, 30, 80, 0.7);
    --sidebar-blur: blur(20px);
    --main-bg: #0a1929;
    --message-user-bg: rgba(30, 136, 229, 0.2);
    --message-ai-bg: rgba(13, 71, 161, 0.3);
    --text-primary: #e3f2fd;
    --text-secondary: #bbdefb;
    --text-muted: #90caf9;
    --border-color: rgba(100, 181, 246, 0.15);
    --input-bg: rgba(13, 71, 161, 0.2);
    --input-border: rgba(100, 181, 246, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
    --blur-intensity: blur(30px);
    --code-bg: rgba(0, 0, 0, 0.3);
    --code-border: rgba(255, 255, 255, 0.1);
}

.light-theme {
    --primary-blue: #1976d2;
    --light-blue: #e3f2fd;
    --dark-blue: #bbdefb;
    --sidebar-bg: rgba(227, 242, 253, 0.7);
    --sidebar-blur: blur(20px);
    --main-bg: #f5f9ff;
    --message-user-bg: rgba(30, 136, 229, 0.1);
    --message-ai-bg: rgba(187, 222, 251, 0.5);
    --text-primary: #0d47a1;
    --text-secondary: #1e88e5;
    --text-muted: #42a5f5;
    --border-color: rgba(30, 136, 229, 0.15);
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: rgba(30, 136, 229, 0.3);
    --blur-intensity: blur(20px);
    --code-bg: rgba(0, 0, 0, 0.05);
    --code-border: rgba(0, 0, 0, 0.1);
}

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

body {
    background: var(--main-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    transition: var(--transition);
}

#networkCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: transparent;
    pointer-events: none;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    transition: var(--transition);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--sidebar-bg);
    backdrop-filter: var(--sidebar-blur);
    -webkit-backdrop-filter: var(--sidebar-blur);
    padding: 16px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 100;
    transform: translateX(-100%);
    transition: var(--transition);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: var(--blur-intensity);
    border: 1px solid var(--border-color);
}

.light-theme .logo {
    background: rgba(255, 255, 255, 0.3);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.new-chat-btn {
    background: var(--dark-blue);
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: var(--transition);
    width: 100%;
    backdrop-filter: var(--blur-intensity);
}

.light-theme .new-chat-btn {
    background: var(--primary-blue);
    color: white;
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.delete-all-btn {
    background: rgba(244, 67, 54, 0.8);
    color: white;
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: var(--transition);
    width: 100%;
    backdrop-filter: var(--blur-intensity);
}

.light-theme .delete-all-btn {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

.delete-all-btn:hover {
    background: rgba(244, 67, 54, 0.9);
    transform: translateY(-2px);
}

.delete-all-btn:disabled {
    background: rgba(244, 67, 54, 0.4);
    cursor: not-allowed;
    transform: none;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
}

.chat-item {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    backdrop-filter: var(--blur-intensity);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    position: relative;
}

.light-theme .chat-item {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

.chat-item:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateX(4px);
}

.chat-item.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.chat-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.chat-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
}

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

.delete-chat-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    opacity: 0.7;
}

.delete-chat-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

.chat-item i {
    font-size: 16px;
    flex-shrink: 0;
}

.chat-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    transition: var(--transition);
    backdrop-filter: var(--blur-intensity);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
}

.light-theme .user-profile {
    background: rgba(255, 255, 255, 0.4);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
}

.user-status {
    font-size: 13px;
    color: var(--text-muted);
}

.account-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.account-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--main-bg);
    backdrop-filter: var(--blur-intensity);
    overflow: hidden;
    transition: var(--transition);
    width: 100%;
    min-height: 100vh;
}

.header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: var(--blur-intensity);
}

.light-theme .header {
    background: rgba(255, 255, 255, 0.6);
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle, .updates-btn, .sidebar-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    backdrop-filter: var(--blur-intensity);
}

.light-theme .theme-toggle,
.light-theme .updates-btn,
.light-theme .sidebar-toggle {
    background: rgba(255, 255, 255, 0.8);
}

.theme-toggle:hover, .updates-btn:hover, .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.light-theme .theme-toggle:hover,
.light-theme .updates-btn:hover,
.light-theme .sidebar-toggle:hover {
    background: var(--primary-blue);
    color: white;
}

.updates-btn {
    width: auto;
    padding: 0 16px;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
    padding-bottom: 180px;
    
    /* Enhanced scrolling properties */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: auto;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 100%;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    z-index: 2;
}

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

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 16px;
    margin-top: 4px;
    backdrop-filter: var(--blur-intensity);
}

.user-msg .message-avatar {
    background: rgba(74, 144, 226, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-msg .message-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-content {
    flex: 1;
    padding: 16px 20px;
    border-radius: 12px;
    line-height: 1.6;
    backdrop-filter: var(--blur-intensity);
    font-size: 16px;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    
    /* SCROLLABLE FIX - Make messages scrollable when content is too long */
    max-height: 500px;
    overflow-y: auto;
    padding-right: 12px;
}

.user-msg .message-content {
    background: var(--message-user-bg);
    color: white;
}

.ai-msg .message-content {
    background: var(--message-ai-bg);
    color: var(--text-primary);
}

/* MARKDOWN STYLING */
.message-content strong {
    font-weight: bold;
    color: inherit;
}

.message-content em {
    font-style: italic;
    color: inherit;
}

.message-content del {
    text-decoration: line-through;
    color: var(--text-muted);
}

.message-content h1, 
.message-content h2, 
.message-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-weight: bold;
    color: inherit;
}

.message-content h1 {
    font-size: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.message-content h2 {
    font-size: 20px;
}

.message-content h3 {
    font-size: 18px;
}

.message-content blockquote {
    border-left: 3px solid var(--primary-blue);
    padding-left: 15px;
    margin: 10px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* SCROLLBAR STYLING FOR MESSAGE CONTENT */
.message-content::-webkit-scrollbar {
    width: 8px;
}

.message-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 4px 0;
}

.message-content::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.message-content::-webkit-scrollbar-thumb:hover {
    background: #3a7bd5;
    background-clip: content-box;
}

/* Light theme scrollbars */
.light-theme .message-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.light-theme .message-content::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    background-clip: content-box;
}

/* User message specific scrollbar styling */
.user-msg .message-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.user-msg .message-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    background-clip: content-box;
}

.user-msg .message-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
    background-clip: content-box;
}

/* Code block styling */
.message-content pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    
    /* Make code blocks scrollable too */
    max-height: 300px;
    overflow-y: auto;
}

.message-content code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: inherit;
}

.message-content pre code {
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}

/* Inline code styling */
.message-content :not(pre) > code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Code language label */
.code-block {
    position: relative;
    margin: 12px 0;
}

.code-language {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.light-theme .code-language {
    background: rgba(0, 0, 0, 0.1);
}

/* Scrollbar for code blocks */
.message-content pre::-webkit-scrollbar {
    height: 8px;
}

.message-content pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.message-content pre::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.input-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 24px;
    background: transparent;
    z-index: 10;
}

.input-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    border: none;
    background: transparent;
}

.input-box {
    display: flex;
    align-items: flex-end;
    background: var(--input-bg);
    border-radius: 12px;
    padding: 12px 16px;
    transition: var(--transition);
    backdrop-filter: var(--blur-intensity);
    width: 100%;
    border: 1px solid var(--input-border);
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.light-theme .input-box {
    background: white;
    border-color: var(--border-color);
}

.input-box:focus-within {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px var(--primary-blue);
}

.light-theme .input-box:focus-within {
    background: white;
    box-shadow: 0 0 0 2px var(--primary-blue);
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    resize: none;
    max-height: 120px;
    outline: none;
    line-height: 1.5;
    padding: 8px 0;
    font-family: inherit;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-button {
    background: var(--primary-blue);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 12px;
    flex-shrink: 0;
    font-size: 16px;
    backdrop-filter: var(--blur-intensity);
}

.send-button:hover {
    background: #3a7bd5;
    transform: translateY(-2px);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
    width: 100%;
    max-width: 800px;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 80px;
    backdrop-filter: var(--blur-intensity);
    color: var(--text-primary);
}

.light-theme .quick-action-btn {
    background: rgba(255, 255, 255, 0.6);
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.light-theme .quick-action-btn:hover {
    background: var(--primary-blue);
    color: white;
}

.quick-action-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.quick-action-text {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.welcome-message {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px 180px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    z-index: 2;
}

.welcome-title {
    font-size: 48px;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.5;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

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

@keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ENHANCED SCROLLBAR STYLING */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 4px 0;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #3a7bd5;
    background-clip: content-box;
}

/* Light theme scrollbars */
.light-theme .chat-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.light-theme .chat-container::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    background-clip: content-box;
}

/* Sidebar scrollbar */
.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 8px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #3a7bd5;
}

/* Input scrollbar */
.message-input::-webkit-scrollbar {
    width: 6px;
}

.message-input::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.message-input::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 8px;
}

/* Ensure smooth scrolling */
.chat-container {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) rgba(255, 255, 255, 0.05);
}

.chat-history {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) rgba(255, 255, 255, 0.05);
}

/* Firefox scrollbar styling */
@supports (scrollbar-width: thin) {
    .chat-container {
        scrollbar-width: thin;
        scrollbar-color: var(--primary-blue) rgba(255, 255, 255, 0.05);
    }
    
    .chat-history {
        scrollbar-width: thin;
        scrollbar-color: var(--primary-blue) rgba(255, 255, 255, 0.05);
    }
}

/* Auto-scroll to bottom when new messages arrive */
.chat-container {
    overflow-anchor: auto;
}

/* Prevent scroll jumping */
.message:last-child {
    overflow-anchor: none;
}

/* Better scrollbar for code blocks */
.message-content pre::-webkit-scrollbar {
    height: 8px;
}

.message-content pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.message-content pre::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

/* Mobile scrollbar adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
    
    .message {
        max-width: 95%;
        gap: 12px;
    }
    
    .welcome-title {
        font-size: 36px;
    }
    
    .welcome-subtitle {
        font-size: 18px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .theme-toggle, .updates-btn, .sidebar-toggle {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .updates-btn {
        padding: 0 12px;
        font-size: 13px;
    }
    
    .message-content {
        padding: 14px 18px;
        font-size: 15px;
        max-width: 90%;
        max-height: 400px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .quick-actions {
        gap: 12px;
    }
    
    .quick-action-btn {
        padding: 10px 12px;
        min-width: 70px;
    }
    
    .quick-action-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .quick-action-text {
        font-size: 11px;
    }
    
    .chat-item-actions {
        opacity: 1;
    }
    
    .chat-container {
        padding-bottom: 160px;
    }
    
    .chat-container::-webkit-scrollbar {
        width: 6px;
    }
    
    .chat-history::-webkit-scrollbar {
        width: 4px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }
    
    .welcome-title {
        font-size: 32px;
    }
    
    .welcome-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .input-box {
        padding: 10px 14px;
    }
    
    .message-input {
        font-size: 15px;
    }
    
    .send-button {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .chat-container {
        padding: 16px;
        padding-bottom: 140px;
    }
    
    .quick-actions {
        gap: 8px;
    }
    
    .quick-action-btn {
        padding: 8px 10px;
        min-width: 60px;
    }
    
    .quick-action-text {
        font-size: 10px;
    }
    
    .message-content {
        max-height: 350px;
        
    }
    /* Auto-scroll indicator */
.auto-scroll-indicator {
    position: fixed;
    bottom: 150px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: var(--primary-blue, #10a37f);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    border: 2px solid rgba(255,255,255,0.2);
}

.auto-scroll-indicator.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.auto-scroll-indicator:hover {
    background: var(--light-blue, #4a90e2);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Light theme adjustments */
.light-theme .auto-scroll-indicator {
    background: var(--primary-blue, #1976d2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Enhanced chat container for smooth scrolling */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
    padding-bottom: 180px;
    
    /* Enhanced scrolling properties */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none; /* We'll handle this manually */
}

/* Ensure messages don't jump around */
.message {
    animation: fadeIn 0.5s ease-out;
    position: relative;
    z-index: 2;
    min-height: 40px; /* Prevent height changes during rendering */
}

/* Mobile adjustments for scroll indicator */
@media (max-width: 768px) {
    .auto-scroll-indicator {
        bottom: 130px;
        right: 20px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .auto-scroll-indicator {
        bottom: 120px;
        right: 16px;
        width: 32px;
        height: 32px;
    }
}
}
