:root {
  --bg-main: #0b1220;
  --bg-sidebar: #0f1724;
  --text-main: #e6eef8;
  --text-subtitle: #9aa7b7;
  --bubble-user: linear-gradient(90deg, #2563eb, #4f46e5);
  --bubble-ai: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.1);
  --overlay-bg: transparent;
}

/* Light Theme */
/* Light Theme */
[data-theme='light'] {
  --bg-main: #f7f7f7;
  --bg-sidebar: #ffffff;
  --text-main: #111827;
  --text-subtitle: #6b7280;
  --bubble-user: #2563eb;
  --bubble-ai: #e5e7eb;
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --overlay-bg: transparent;

  /* Toggle Sidebar Button in Light Mode */
  .toggle-sidebar-btn {
    background: rgba(0, 0, 0, 0.05); /* subtle dark overlay */
    border: none;
    cursor: pointer;
    color: #111827; /* dark icon for light theme */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 4px 4px;
    border-radius: 6px; /* optional */
  }
.message-row.user .message-time {
    color: #ffffff !important;
    opacity: 0.9;
  }
  .thinking-row {
  background: var(--bubble-ai); 
  font-style: italic;
  opacity: 0.8; 
}
  /* 3️⃣ Typing dots → BLACK */
  .typing-dots span {
    background-color: #111827 !important;
  }
  .toggle-sidebar-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    filter: none;
  }

  /* Chat send button in Light Mode */
 .chatgpt-send-btn {
  background: #62662836;
  border: 1px solid #e2e4e8;
}




 .chatgpt-send-btn mat-icon {
  color: #374151; /* slate gray arrow */
}

.chatgpt-send-btn:hover {
  background: #e5e7eb;
}


}

/* =======================
   OVERLAY & SHELL
   ======================= */
.gbai-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  justify-content: flex-end;
  z-index: 200;
}

.gbai-shell {
 width: 700px;
  top:30px;
  margin-top: 40px;
  margin-right: 10px;
  margin-bottom: 30px;
  height: 90vh;
  background: var(--bg-main);
  border-radius: 12px 0 0 12px;
  display: flex;

  min-width: 0 !important; 
  flex-direction: row;
  overflow: hidden;
  box-shadow: -5px 5px 40px rgba(2, 6, 23, 0.6);
  transition: all 0.25s ease;
}

.gbai-shell.maximized {
  width: 98vw;
  height: 92vh;
  margin-right: 10px;
  border-radius: 8px;
}

/* =======================
   SIDEBAR
   ======================= */
.gbai-sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right:  1px solid rgba(255, 255, 255, 0.03);
  min-width: 0 !important;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text-main);
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-toggle {
  position: fixed;
  bottom: 10px;
  right: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.3s;
  z-index: 200;
}

.ai-close-btn {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #ef4444;
  border-radius: 50%;
  border: none;
  width: 18px;
  height: 18px;
  color: white;
  cursor: pointer;
}

.chat-toggle:hover {
  transform: scale(1.1);
}

.popup.right-edge {
  right: 10px;
  left: auto;
  transform: none;
}

.gbai-sidebar.hidden {
  display: none;
}



.new-chat {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.search-wrap {
  position: relative;
  padding: 10px 0;
}

.search-wrap input {
  width: 100%;
  padding: 10px 10px 10px 36px;
  background: var(--input-bg);
  border: none;           /* ✅ NO WHITE BORDER */
  outline: none;           /* ✅ Removes blue outline on click */
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.search-wrap input::placeholder {
  color: var(--text-subtitle);
}

.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtitle);
  font-size: 20px;
  pointer-events: none;
}
.search-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
  background: var(--bg-sidebar);
}
/* Make sidebar items cursor light/white */
.gbai-sidebar .new-chat,
.gbai-sidebar .sidebar-close,
.gbai-sidebar .history-item {
  cursor: pointer;
  
}

.gbai-sidebar .new-chat:hover,
.gbai-sidebar .sidebar-close:hover,
.gbai-sidebar .history-item:hover {
  filter: brightness(150%); 
}
.toggle-sidebar-btn {
  background: transparent; 
  border: none;          
  cursor: pointer;
  color: white;           
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;         
  padding: 4px 4px;
}

.toggle-sidebar-btn:hover {
  filter: brightness(120%); /* optional hover effect */
}

// .gbai-sidebar.side{
//  border-right: none; 
// }
/* =======================
   MAIN CHAT
   ======================= */
.gbai-main {
 flex: 1 !important;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-main) 0%, var(--bg-sidebar) 100%);
  color: var(--text-main);
   min-width: 0 !important;
   min-height: 0;  
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--bubble-user);
}

.header-text h3 {
  margin: 0;
  font-size: 1.1rem;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;   
}
.subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-subtitle);
}

/* Chat Body */
.main-body {
  flex: 1 !important;
  //min-height: 1px !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;

  min-width: 0 !important;
 min-height: 0; 

}



.welcome-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Only center welcome content */
.welcome-content {
  text-align: center;
 
}

.lead {
  font-size: 14px;
  color: var(--text-subtitle);
}

/* =======================
   CHAT MESSAGES
   ======================= */
.chat-messages {
  flex: 1 !important;
  //min-height: 1px !important;
  min-height: 0; 
  min-width: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
   padding: 16px;
}
.chat-messages.hidden {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}
.message-row {
  display: flex;
}

.message-row.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  background: var(--bubble-ai);
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
}

.message-row.user .message-bubble {
  background: var(--bubble-user);
  color: #fff;
}

.message-time {
  font-size: 11px;
  color: var(--text-subtitle);
  text-align: right;
  margin-top: 4px;
}

/* =======================
   INPUT AREA
   ======================= */
.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-main);
}

.chat-input input {
  flex: 1;
  border: 1px solid var(--input-border);
  background: var(--bg-main);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  outline: none;
  transition: 0.2s ease-in-out;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

/* Focus Glow */
.chat-input input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
  background: var(--bg-sidebar);
}

.chat-input input::placeholder {
  color: var(--text-subtitle);
  opacity: 0.9;
}

/* Three-dot typing animation */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 16px;
}

.typing-dots span {
  display: block;
  width: 6px;
  height: 6px;
  background-color: #fff;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Send Button - ChatGPT style */
.send-btn {
  background: #2563eb;
  padding: 10px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.send-btn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.send-btn mat-icon {
  font-size: 20px;
  color: white;
}
.chat-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-main);
}

/* ChatGPT Style Input */
.chatgpt-input {
  flex: 1;
  max-height: 180px;
  overflow-y: auto;
  resize: none;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--input-border);
  background: var(--bg-sidebar);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: 0.2s ease-in-out;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

/* Focus style */
.chatgpt-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.chatgpt-input::placeholder {
  color: var(--text-subtitle);
  opacity: 0.8;
}

/* Send button */
.send-btn {
  background: #2563eb;
  padding: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn mat-icon {
  color: white;
}

 /* Status Dot */
.status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: gray; /* offline */
  display: inline-block;
}

.status-dot.online {
  background-color: #22c55e !important; /* Tailwind green */
  background: #22c55e !important;



  /* Prevent theme override */
  filter: none !important;
  mix-blend-mode: normal !important;
}


@keyframes blink-green {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* Center screen input */
// .welcome-screen {
//   flex: 1;
//   display: flex;
//   flex-direction: column;
//   justify-content: center;   /* Centers vertically */
//   align-items: center;       /* Centers horizontally */
//   text-align: center;
//   width: 100%;
 
// }

/* Wrapper for input */
.welcome-input {
  width: 90%;                /* You can reduce if needed */
  max-width: 800px;          /* Prevents too big */
  position: relative;
  display: flex;
  margin:0 auto;
  justify-content: center;   /* Centers the actual input */
}

/* INPUT STYLE (same as bottom input) */
.welcome-input .chatgpt-input {
  width: 100%;
  height: 52px;

  padding: 0 60px 0 15px;

  background: var(--bg-main);     /* SAME as bottom */
  border: 1px solid #3d3d3d;
  border-radius: 25px;

  color: var(--text-main);
  font-size: 16px;
  outline: none;
}

/* Placeholder SAME as bottom */
.welcome-input .chatgpt-input::placeholder {
  color: var(--text-subtitle);
  opacity: 0.9;
}

/* White round send button */
.welcome-send-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  width: 40px;
  height: 40px;

  border-radius: 50%;
  background: white;
  border: none;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.welcome-screen .welcome-content h1 {
  font-size: 2rem; /* slightly bigger than before */
  margin-bottom: 14px;
}

.welcome-screen .welcome-content .lead {
  font-size: 1.1rem; /* slightly bigger than before */
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Bottom chat input common */
.chatgpt-input {
  width: 100%;
  height: 52px;
  padding: 0 60px 0 15px;

  border-radius: 30px;
  background: var(--bg-sidebar);
  border: 1px solid #3d3d3d;

  color: #fff;
  font-size: 16px;
  outline: none;
}

.chatgpt-send-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  width: 40px;
  height: 40px;

  border-radius: 50%;
  background: white;
  border: none;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chatgpt-send-btn:hover {
  background: #e7e7e7;
}

.welcome-screen .welcome-input .chatgpt-input {
  background: var(--bg-main); /* same as bottom input box */
  color: var(--text-main);
}

/* ================================
   CHAT HISTORY ITEM (SIDEBAR)
===================================*/

/* ================================
   CHAT HISTORY ITEM - ChatGPT Style
===================================*/

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 150px); /* Adjust depending on sidebar content */
  padding-right: 4px;
}

/* Individual chat item */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease-in-out;
  position: relative;
}

/* Chat item title */
.history-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Optional subtitle / time */
.history-item-time {
  font-size: 12px;
  color: var(--text-subtitle);
}

/* Hover effect */
.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

/* Active chat highlight */
.history-item.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

/* Delete button */
.history-item .delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-subtitle);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}

.history-item .delete-btn:hover {
  color: #ef4444;
  opacity: 1;
}

/* Scrollbar styling */
.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

[data-theme="light"] .history-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .history-item.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
}
.hidden {
  display: none !important;
}

/* =====================================
   PROFESSIONAL AI MESSAGE FORMATTING
===================================== */

.message-content {
  white-space: pre-wrap;        /* Preserve \n formatting */
  word-break: break-word;
  line-height: 1.65;
  font-size: 14.5px;
  letter-spacing: 0.1px;
}

/* Paragraph spacing */
.message-content p {
  margin: 6px 0;
}

/* Bullet & numbered lists */
.message-content ul,
.message-content ol {
  padding-left: 18px;
  margin: 8px 0;
}

/* List items */
.message-content li {
  margin-bottom: 6px;
}

/* Headings inside responses (if any) */
.message-content strong {
  font-weight: 600;
}

/* Code-like blocks (optional safety) */
.message-content pre {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}

/* Inline emphasis */
.message-content em {
  font-style: italic;
}

/* ===========================
   HEADER BOTTOM LINE - LIGHT MODE
   =========================== */
[data-theme="light"] .chat-header {
  border-bottom: 1px solid #e5e7eb; /* subtle gray, same feel as dark mode */
}

.message-content {
  white-space: normal;
  line-height: 1.6;
  font-size: 14px;
}

.message-content ul {
  padding-left: 18px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content strong {
  font-weight: 600;
}
.message-row.bot .message-bubble {
  background: var(--bubble-ai);
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 70%;
}
/* AGENTIC BOT BUTTON */
.agent-btn {
  margin-top: 28px;
  padding: 12px 30px;

  border-radius: 28px;
  border: none;

  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;

  color: #4c1d95;
  cursor: pointer;

  /* light violet gradient */
  background: linear-gradient(135deg, #c4b5fd, #a78bfa);

  box-shadow: 0 6px 18px rgba(167,139,250,0.35);

  transition: all 0.25s ease;
}

.agent-btn:hover {
  transform: translateY(-2px);

  background: linear-gradient(135deg,#a78bfa,#8b5cf6);

  box-shadow: 0 10px 24px rgba(139,92,246,0.4);
}
.back-btn {
  background: rgba(255,255,255,0.05);

  border: 1px solid rgba(255,255,255,0.1);

  padding: 6px 12px;

  border-radius: 8px;

  font-size: 13px;
  font-weight: 500;

  color: #c4b5fd;

  cursor: pointer;

  transition: all 0.2s ease;
}

.back-btn:hover {
  background: rgba(147,51,234,0.25);
  border-color: #9333ea;
  color: white;
}
/* PLUS BUTTON (ChatGPT style) */
.chatgpt-plus-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 42px;
  height: 42px;

  border-radius: 50%;
  color: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* 🔥 Make PLUS bigger & thicker */
.chatgpt-plus-btn mat-icon {
  font-size: 26px;     /* bigger */
  font-weight: 700;    /* thicker look */
  line-height: 1;
}

/* Hover */
.chatgpt-plus-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-50%) scale(1.08);
}

/* Input spacing */
.welcome-input .chatgpt-input {
  padding-left: 60px;
}
/* MIC BUTTON */
.chatgpt-mic-btn {
  position: absolute;
  right: 55px; /* place before send button */
  top: 50%;
  transform: translateY(-50%);

  width: 42px;
  height: 42px;

  border-radius: 50%;
  border: none;

  background: rgba(255,255,255,0.05);
  color: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* MIC ICON */
.chatgpt-mic-btn mat-icon {
  font-size: 22px;
}

/* Hover */
.chatgpt-mic-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-50%) scale(1.08);
}
.welcome-input .chatgpt-input {
  padding-left: 60px;
  padding-right: 100px; /* space for mic + send */
}