/* General body */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  background-color: #f0f2f5;
  margin: 0;
}

/* Chat container */
.chat-container {
  width: 90%;
  max-width: 900px;   /* bigger max width for fullscreen */
  height: 90%;
  max-height: 95vh;   /* keep some margin */
  background: #fff;
  border-radius: 0 0 12px 12px;  /* flat top, rounded bottom */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Header */
.header {
  background-color: #1E253D;
  color: white;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.lightbulb {
  font-size: 24px;
}

/* Chat messages */
.chat-history {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 80%;
  line-height: 1.4;
}

.user-message {
  background-color: #1E253D;
  color: white;
  align-self: flex-end;
}

.bot-message {
  background-color: #e9ecef;
  color: #333;
  align-self: flex-start;
}

/* Input area */
.input-area {
  display: flex;
  padding: 15px;
}

#query-input {
  flex-grow: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 16px;
  outline: none;
}

#send-button {
  background-color: #1E253D;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease;
}

#send-button:hover {
  background-color: #1E253D;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .chat-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;  /* remove rounded corners for mobile fullscreen */
  }
}

/* --- NEW STYLES FOR MARKDOWN RENDERING (TABLES, LISTS, HEADINGS) --- */
/* Ensure Bold, Italic, and Paragraphs look good */
.bot-message strong { font-weight: 700; color: #111; }
.bot-message em { font-style: italic; }
.bot-message p { margin-top: 0; margin-bottom: 10px; }
/* Markdown Headings */
.bot-message h1, 
.bot-message h2, 
.bot-message h3 {
  color: #1E253D;
  margin-top: 15px;
  margin-bottom: 8px;
  font-weight: 600;
}

.bot-message h2 { font-size: 18px; border-bottom: 1px solid #ddd; padding-bottom: 5px; }
.bot-message h3 { font-size: 16px; }

/* Markdown Lists (Bullet points) */
.bot-message ul, 
.bot-message ol {
  padding-left: 20px;
  margin-top: 5px;
  margin-bottom: 10px;
}

.bot-message li {
  margin-bottom: 6px;
}

/* Professional Table Styling */
.bot-message table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 12px;
  background-color: #ffffff;
  border-radius: 8px;
  

  table-layout: fixed; 

}

.bot-message th, 
.bot-message td {
  border: 1px solid #e0e0e0;
  padding: 10px 12px;
  text-align: left;

  white-space: normal; 
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.bot-message th {
  background-color: #1E253D;
  color: #ffffff;
  font-weight: bold;
  
}

/* Zebra striping for table rows to make reading easy */
.bot-message tr:nth-child(even) {
  background-color: #f8f9fa;
}

.bot-message tr:hover {
  background-color: #f1f3f5;
}

/* Inline code formatting (e.g., when the bot mentions device names) */
.bot-message code {
  background-color: #e0e0e0;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #d63384;
}