body {
  font-family: 'Roboto', sans-serif; 
  background-color: #f4f4f4; 
  color: #333; 
  line-height: 1.6;
}
        .typing-dots::after {
            content: '';
            animation: typing 1.5s infinite;
        }
        
        @keyframes typing {
            0% { content: '.'; }
            33% { content: '..'; }
            66% { content: '...'; }
            100% { content: '.'; }
        }

        /* Hide scrollbar but keep functionality */
        .hide-scrollbar::-webkit-scrollbar {
            display: none;
        }
        .hide-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Improved markdown styling */
        .markdown pre {
            background-color: #2d2d3a;
            border-radius: 6px;
            padding: 12px;
            margin: 12px 0;
            overflow-x: auto;
            position: relative;
            max-width: 100%;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        
        .markdown code {
            font-family: monospace;
        }
        
        .markdown p {
            margin-bottom: 12px;
        }
        
        .markdown ol, .markdown ul {
            margin-left: 24px;
            margin-bottom: 12px;
            padding-left: 1rem;
        }
        
        .markdown ol {
            list-style-type: decimal;
        }
        
        .markdown ul {
            list-style-type: disc;
        }
        
        .markdown h1, .markdown h2, .markdown h3, .markdown h4 {
            margin-top: 24px;
            margin-bottom: 16px;
            font-weight: bold;
            line-height: 1.25;
        }
        
        .markdown h1 { font-size: 1.5rem; }
        .markdown h2 { font-size: 1.4rem; }
        .markdown h3 { font-size: 1.3rem; }
        .markdown h4 { font-size: 1.2rem; }
        
        /* Code block styling */
        .code-block {
            margin: 16px 0;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid #4b5563;
            max-width: 100%;
        }
        
        .code-header {
            background-color: #374151;
            padding: 8px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .copy-code-btn {
            background: none;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            font-size: 0.875rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .copy-code-btn:hover {
            color: #f9fafb;
        }
        
      
        /* Tables styling */
        .markdown table {
            border-collapse: collapse;
            width: 100%;
            margin: 16px 0;
            display: block;
            overflow-x: auto;
        }
        
        .markdown th, .markdown td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
            min-width: 120px;
        }
        
        .markdown th {
            background-color: #f2f2f2;
            font-weight: bold;
        }
        
        .dark .markdown th {
            background-color: #333;
        }
        
        .dark .markdown th, .dark .markdown td {
            border-color: #444;
        }
        
        /* Improved overflow handling for code and tables */
        .overflow-x-auto {
            max-width: 100%;
            overflow-x: auto;
        }
        
        /* Fix sidebar overlay z-index */
        #sidebar {
            z-index: 40;
        }
        
        #sidebar-overlay {
            z-index: 35;
        }
        
        /* Make chat history items accessible above overlay */
        .chat-item {
            position: relative;
            z-index: 45;
        }
        
     
/* Đảm bảo khu vực chat có thanh cuộn khi cần */
#chat-container {
    flex: 1;
    overflow-y: auto; /* Cuộn dọc */
   
    max-height: calc(100vh - 150px); /* Giới hạn chiều cao */
    padding-bottom: 16px;
}


/* Tùy chỉnh thanh cuộn cho Webkit (Chrome, Edge, Safari) */
#chat-messages::-webkit-scrollbar {
    width: 8px; /* Độ rộng thanh cuộn */
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1; /* Màu nền thanh cuộn */
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #10a37f; /* Màu thanh cuộn */
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #0e8466; /* Màu khi rê chuột vào */
}


/* Thêm thanh cuộn tùy chỉnh */
#chat-container::-webkit-scrollbar {
    width: 8px;
}

#chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* Điều chỉnh bố cục của form */
/* Điều chỉnh giao diện chat-form theo chế độ sáng */
#chat-form {
    display: flex;
    align-items: center;
    border: 1px solid #ccc; /* Viền sáng */
    border-radius: 8px;
    padding: 8px;
    background: white;
    position: relative;
    transition: background 0.3s ease-in-out, border 0.3s ease-in-out;
}

/* Chế độ tối */
.dark #chat-form {
    background: #202123; /* Màu nền tối */
    border: 1px solid #444; /* Viền tối */
}

/* Điều chỉnh textarea */
#message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 8px 12px;
    height: 40px;
    font-size: 1rem;
    background: transparent;
    color: #333; /* Màu chữ mặc định */
}

.dark #message-input {
    color: white; /* Màu chữ trắng khi tối */
}

/* Nút chọn file */
.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s ease-in-out;
}

.file-label:hover {
    background: #f1f1f1;
}

.dark .file-label:hover {
    background: #333; /* Màu hover khi chế độ tối */
}

/* Nút gửi */
#send-button {
    width: 40px;
    height: 40px;
    border: none;
    background: #10a37f;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease-in-out;
}

#send-button:hover {
    background: #0e8466;
}

.dark #send-button {
    background: #0e8466; /* Màu tối hơn khi dark mode */
}

.dark #send-button:hover {
    background: #0c6a52;
}

/* Đặt nút chọn file và nút gửi bên trong ô nhập */
.file-label, #send-button {
    margin-left: 8px;
}

.fullscreen-image-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.8); /* Màu nền đen với độ trong suốt */
     display: flex;
     justify-content: center;
     align-items: center;
     z-index: 1000; /* Đảm bảo hiển thị trên cùng */
     cursor: pointer; /* Thay đổi con trỏ chuột để báo hiệu có thể click */
 }

 .fullscreen-image-overlay img {
     max-width: 90%; /* Giới hạn kích thước ảnh để không bị tràn màn hình */
     max-height: 90%;
	 border-width: 4px;
    border-radius: 20px;
    border-color: #ffffff;
 }
 #chat-history {
  
    overflow-y: auto; /* Bật thanh cuộn dọc khi cần */
    padding-right: 4px; /* Tránh thanh cuộn đè lên nội dung */
}

/* Tùy chỉnh thanh cuộn cho Webkit (Chrome, Safari) */
#chat-history::-webkit-scrollbar {
    width: 8px;
}

#chat-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#chat-history::-webkit-scrollbar-thumb {
    background: #10a37f; /* Màu thanh cuộn */
    border-radius: 4px;
}

#chat-history::-webkit-scrollbar-thumb:hover {
    background: #0e8466; /* Màu khi rê chuột vào */
}
/* Thêm hoặc chỉnh sửa khối này trong styles.css */
.kebab-menu {
    position: absolute; /* Đảm bảo menu nằm ở vị trí tuyệt đối */
    right: 0;           /* Đặt nó ở phía bên phải của nút 3 chấm */
    top: 100%;          /* Đặt nó ngay bên dưới nút 3 chấm */
    margin-top: 4px;    /* Tạo một chút khoảng trống giữa nút và menu */
    z-index: 50;        /* Đảm bảo nó luôn nằm trên các chat-item khác */
    /* Các thuộc tính khác của menu như border, background, shadow... giữ nguyên */
}
