/* Reset mặc định */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: "Poppins", sans-serif;
      background-color: #0d0d0d;
      color: #fff;
      overflow-x: hidden;
      scroll-behavior: smooth;
    }

    /* Thanh menu trượt */
    .sidebar {
      position: fixed;
      top: 0;
      left: -260px;
      width: 240px;
      height: 100%;
      background: #111;
      transition: 0.4s;
      padding: 20px;
      z-index: 999;
      box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }

    .sidebar.active {
      left: 0;
    }

    .sidebar ul {
      list-style: none;
      margin-top: 50px;
    }

    .sidebar ul li {
      margin: 20px 0;
    }

    .sidebar ul li a {
      color: #ccc;
      text-decoration: none;
      font-size: 18px;
      transition: 0.3s;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .sidebar ul li a:hover {
      color: #00aaff;
    }

    .close-btn {
      background: none;
      border: none;
      color: #fff;
      font-size: 24px;
      cursor: pointer;
    }

    .menu-btn {
      position: fixed;
      top: 20px;
      left: 20px;
      background: #333;
      border: none;
      color: white;
      padding: 10px 15px;
      font-size: 22px;
      border-radius: 8px;
      cursor: pointer;
      z-index: 1000;
      transition: background 0.3s, transform 0.1s;
    }

    .menu-btn:hover {
        background: #444;
    }
    .menu-btn:active {
        transform: scale(0.95);
    }
    
    /* Giao diện Chatbot */
    .chatbot-container {
      display: flex;
      flex-direction: column;
      height: 100vh;
      max-width: 800px;
      margin: 0 auto;
      padding-top: 80px;
    }
    
    #chat-box {
      flex: 1;
      padding: 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 15px;
      padding-bottom: 100px;
    }

    .message {
      display: flex;
      gap: 10px;
      align-items: flex-start;
    }

    .message.user {
      justify-content: flex-end;
    }
    
    .message.bot {
      justify-content: flex-start;
    }

    .avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background-color: #333;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      flex-shrink: 0;
      overflow: hidden; /* Đảm bảo ảnh vừa khung */
    }

    .avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover; /* Giữ tỷ lệ ảnh */
    }

    /* Ẩn avatar người dùng */
    .message.user .avatar {
      display: none;
    }

    .message-content {
      max-width: 80%;
      padding: 12px;
      border-radius: 12px;
      line-height: 1.6;
      background-color: #333;
      white-space: pre-wrap;
      overflow-wrap: break-word;
    }

    .message.user .message-content {
      background-color: #00aaff;
      color: #fff;
      border-bottom-right-radius: 0;
    }

    .message.bot .message-content {
      background-color: #222;
      color: #fff;
      border-bottom-left-radius: 0;
    }

    /* Hiệu ứng loading */
    .loading-dots {
      display: flex;
      gap: 5px;
      padding: 12px;
    }

    .loading-dot {
      width: 10px;
      height: 10px;
      background-color: #aaa;
      border-radius: 50%;
      animation: bounce 1.4s infinite ease-in-out both;
    }
    
    .loading-dot:nth-child(1) { animation-delay: -0.32s; }
    .loading-dot:nth-child(2) { animation-delay: -0.16s; }
    .loading-dot:nth-child(3) { animation-delay: 0s; }

    @keyframes bounce {
      0%, 80%, 100% { transform: scale(0); }
      40% { transform: scale(1); }
    }
    
    .chatbot-input {
      display: flex;
      position: fixed;
      bottom: 0;
      width: 100%;
      max-width: 800px;
      padding: 10px;
      background-color: #0d0d0d;
      gap: 10px;
    }
    
    #user-input {
      flex: 1;
      padding: 15px;
      border: 1px solid #333;
      border-radius: 25px;
      background-color: #1a1a1a;
      color: #fff;
      font-size: 16px;
      outline: none;
    }

    #send-btn {
      background-color: #00aaff;
      border: none;
      color: white;
      padding: 15px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.3s;
    }
    
    #send-btn:hover {
      background-color: #0099e6;
    }

    /* Định dạng nội dung từ Bot */
    .message-content h1, .message-content h2, .message-content h3 {
        margin-top: 10px;
        margin-bottom: 5px;
        color: #00aaff;
    }
    .message-content p {
        margin-bottom: 10px;
    }
    .message-content a {
        color: #00ffcc;
        text-decoration: underline;
    }
    .message-content img {
        max-width: 100%;
        border-radius: 10px;
        margin-top: 10px;
    }

    /* Tùy chỉnh code block và nút copy */
    .message-content pre {
      position: relative;
      background-color: #1a1a1a;
      padding: 0;
      border-radius: 8px;
      overflow: hidden;
      margin-top: 10px;
    }

    .message-content pre .code-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 15px;
      background-color: #222;
      border-bottom: 1px solid #333;
      color: #ccc;
      font-size: 14px;
    }

    .message-content pre code {
      display: block;
      padding: 15px;
      overflow-x: auto;
      color: #00ffcc;
      font-family: monospace;
      font-size: 14px;
    }

    .copy-btn {
      background-color: #00aaff;
      color: white;
      border: none;
      padding: 5px 10px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 12px;
      transition: background-color 0.3s;
    }

    .copy-btn:hover {
      background-color: #0099e6;
    }

    .copy-btn:active {
      background-color: #0077c4;
    }

    /* Responsive */
    @media (max-width: 768px) {
      .chatbot-input {
        flex-direction: column;
        align-items: stretch;
      }
      #send-btn {
        padding: 15px 20px;
        border-radius: 10px;
      }
    }
