/* Root Variables for Dark Theme */
:root {
    --bs-body-bg: #191b1d; /* Dark background */
    --bs-body-color: #e0e0e0; /* Light text */
    --bs-border-color: #444444; /* Dark border */
    --bs-accent-bg: #23272a; /* Slightly lighter background for accents */
    --bs-message-bg: #252729; /* Message background */
    --bs-muted-text: #b0b0b0; /* Muted text */
    --bs-primary: #007bff; /* Primary button color */
    --bs-button-bg: #181a1c; /* Button background */
  }
  
  /* General Body Styling */
  body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: "Roboto", sans-serif;
    margin: 0;
    padding: 0;
  }
  
  /* Sidebar Styling */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100%;
    background-color: var(--bs-accent-bg);
    color: var(--bs-body-color);
    transition: width 0.0s ease, background-color 0.0s ease;
    overflow: hidden;
  }
  
  .sidebar.collapsed {
    width: 50px;
    background-color: var(--bs-body-bg); /* Match main section background */
  }
  
  .sidebar .toggle-sidebar {
    background: none;
    border: none;
    color: var(--bs-body-color);
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
  }
  
  .sidebar .sidebar-content {
    padding: 10px;
  }
  
  .sidebar .sidebar-content ul {
    list-style: none;
    padding: 0;
  }
  
  .sidebar .sidebar-content ul li {
    margin: 10px 0;
  }
  
  .sidebar .sidebar-content ul li a {
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
  }
  
  .sidebar .sidebar-content ul li a:hover {
    color: var(--bs-primary);
  }
  
  .sidebar .sidebar-content ul li .sidebar-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }
  
  .sidebar.collapsed .sidebar-content {
    display: none; /* Hide options when collapsed */
  }
  
  /* Main Content Styling */
  input {
    box-sizing: border-box;
    padding: 0.5rem;
    font-size: 14px;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    background-color: var(--bs-message-bg);
    color: var(--bs-body-color);
  }

  .login-container form {
    color: var(--bs-body-color);
    background-color: var(--bs-message-bg);
  } 

  .login-container .logo {
    width: 120px;
  }


  /* Chat Container */
  .chat {
    margin: 2rem auto; /* Center horizontally */
    padding: 1rem;
    border-radius: 8px;
    max-width: 700px;
    transition: margin-left 0.3s ease, margin-right 0.3s ease;
  }
  
  .sidebar.collapsed + .chat {
    margin-left: auto; /* Center horizontally when sidebar is collapsed */
    margin-right: auto;
  }
  
  .sidebar + .chat {
    margin-left: auto; /* Center horizontally when sidebar is expanded */
    margin-right: auto;
  }
  
  /* Chat Header */
  .chat .top {
    display: flex;
    justify-content: left;
    align-items: center;
    padding: 1rem;
  }
  
  .chat .top img {
    width: 100px;
  }
  
  /* Chat Messages */
  .chat .instructions {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
  } 

  .chat .messages {
    padding: 1rem;
    overflow-y: auto;
    max-height: 80%;
    white-space: pre-wrap; /* Preserve whitespace and line breaks */    
    scrollbar-color: var(--bs-border-color) var(--bs-accent-bg); /* Firefox */
    scrollbar-width: thin; /* Firefox */    
  }

  .chat .messages .message {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
  }
  
  .chat .messages .left {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-align: left;
    line-height: 1.5rem;
  }
  
  .chat .messages .right {
    background-color: var(--bs-message-bg);
    color: #fff;
    text-align: right;
  }
  
  /* Chat Footer */
  .chat .bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  
  .chat .bottom textarea {
    width: 600px; /* Set width to 70% of the parent */
    padding: 0.5rem; /* Add padding for better readability */
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--bs-body-color); /* Light text color */
    background-color: var(--bs-accent-bg); /* Dark background */
    border: none; /* Subtle border */
    border-radius: 4px; /* Rounded corners */
    outline: none; /* Remove focus outline */
    box-sizing: border-box; /* Ensure padding doesn't affect width */
    overflow: hidden; /* Prevent scrollbars */    
  }
  
  .chat .bottom textarea::placeholder {
    color: var(--bs-muted-text); /* Muted text for placeholder */
  }

  .chat .bottom input {
    float: left;
    display: inline-flex;
    word-wrap: break-word;
    box-sizing: border-box;
    width: 75%;
    padding: 1rem 2rem;
    font-weight: 400;
    color: var(--bs-body-color);
    background-color: var(--bs-accent-bg);
    background-clip: padding-box;
    font-size: 14px;
    line-height: 26px;
    border: none; /* Remove the border */
    border-radius: 5px;
    outline: none; /* Remove the focus outline */

  }
  
  .chat .bottom input::placeholder {
    color: var(--bs-muted-text);
  }
  
  .chat .bottom button {
    display: inline-flex;
    text-align: center;
    cursor: pointer;
    border-radius: 50px;
    margin: 2px;
    width: 3rem;
    height: 3rem;
    background: url("/images/paper-plane-solid-white.svg") center no-repeat;
    background-color: var(--bs-button-bg);
    background-size: 60%;
    background-position: center center;  
    border: none
  }
  
  .chat .bottom button.loading {
    background: url("/images/Spin-1x-1.0s-200px-200px.gif") center no-repeat; /* Spinner image */
    background-color: var(--bs-button-bg); /* Keep the same background color */
    background-size: 60%; /* Adjust spinner size */
    cursor: not-allowed; /* Indicate loading state */
  }

  .chat .bottom button:hover {
    background-color: #0056b3;
  }

  /* Status bar */
  #status-bar {
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    display: none; /* Hidden by default */
    bottom: 0;
    width: 100%;
    z-index: 1000;
  }
  
  #status-text {
    display: inline-block; /* Keep the text inline */
    vertical-align: middle; /* Align text vertically */
  }
  
  #status-ellipsis {
    display: inline-block;
    margin-left: 2px;
    vertical-align: middle; /* Align ellipsis with the text */
    width: 20px; /* Fixed width to prevent shifting */
    text-align: left; /* Align dots to the left */
    position: absolute; /* Position the ellipsis absolutely */
  }
  
  #status-ellipsis::after {
    content: ''; /* Start with no dots */
    display: inline-block;
    animation: dots 1.5s steps(3, end) infinite; /* Animate the dots */
  }
  
  @keyframes dots {
    0% {
      content: '';
    }
    33% {
      content: '.';
    }
    66% {
      content: '..';
    }
    90% {
      content: '...';
    }
  }


  /* Markdown Content Styling */
  .markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
  }

  .markdown-content th, .markdown-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }

  .markdown-content th {
    background-color: var(--bs-accent-bg);
    font-weight: bold;
  }

  .markdown-content tr:nth-child(even) {
    background-color: var(--bs-accent-bg);
  }

  .markdown-content pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
  }

  .markdown-content code {
    background: var(--bs-message-bg);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
  }
