/* ============ GLOBAL VARIABLES ============ */
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
:root {
  --bg-color: #f5f5f5;
  --body-color: #f5f6ff;
  --sidebar-width: 260px;
  --sidebar-collaps: 60px;
  --sidebar-bg: #ffffff;
  --sidebar-text: black;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-secondary: #f6f6f6;
  --code-bg: #1e1e1e;
  --code-text: #d4d4d4;
  --border-main: #e0e0e0;
  --active-text: #1d1d1d;
  --active-bg: #2b2b2b22;
  --btn-color: linear-gradient(
    123deg,
    rgba(35, 128, 224, 1) 0%,
    rgba(127, 82, 218, 1) 99%
  );
  --btn-text: #ffff;
  --select-bg: white;
  --main-border-radious: 50px;
  --scroll-color: #575757;
  --card-header-bg: white;
  --authUrl: url("assets/background-gradient-lights\ \(1\).png");
  --logoUrl: url("assets/logo_no_bg.png");
  --box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
  --newBg: rgb(255, 255, 255);
  --active-new: #666df2;
  --sideNavText: rgba(0, 0, 0, 0.475);
}

body.dark-mode {
  --bg-color: #0b0b16;
  --active-new: #666df2;
  --sideNavText: rgba(255, 255, 255, 0.368);
  /* --bg-color: #07213f; */
  --body-color: #0b0b16;
  --sidebar-bg: #1d1d1d;
  --card-bg: #28283c;
  --text-main: #f8fafc;
  --btn-text: #1d1d1d;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --border-main: #252532;
  --sidebar-text: #e2e8f0;
  --active-text: #ffff;
  --active-bg: #223953;
  --btn-color: linear-gradient(
    185deg,
    rgba(64, 70, 179, 1) 0%,
    rgba(102, 109, 242, 1) 100%
  );
  --select-bg: transparent;
  /* --select-bg: #3a3a3a; */
  --scroll-color: #292929;
  --card-header-bg: rgba(0, 0, 0, 0.412);
  --authUrl: url("assets/background-gradient-lights\ \(4\).png");
  --logoUrl: url("assets/logo_white.png");
  --box-shadow: rgb(255 255 255 / 16%) 0px 1px 4px;
  --newBg: #121220;
}

/* ============ RESET & LAYOUT - AGGRESSIVE HEIGHT INHERITANCE ============ */
* {
  box-sizing: border-box;
  outline: none;
}

.dark-mode .btn-close {
  filter: invert(1); /* white icon */
}
/* custome scroll bar styling */

/* Width */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

/* Track (background) */
::-webkit-scrollbar-track {
  background: #a1a1a1;
  border-radius: 10px;
}

/* Thumb (scroll handle) */
::-webkit-scrollbar-thumb {
  background: var(--scroll-color);
  border-radius: 10px;
  transition: 0.3s;
}

/* Hover effect */
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background-color: var(--body-color);
  color: var(--text-main);
  height: 100dvh; /* Base height */
  display: flex;
  overflow: hidden;
  scrollbar-gutter: stable;
}
.logo-holder {
  /* height: 50px; */
  width: 100%;
}
.collapIconHolder {
  height: 2.5rem;
}
.logo-holder img {
  width: 6.2rem;
  height: 100%;
  object-fit: contain;
}
.modal-body {
  background: var(--card-bg);
}
.history-text {
  color: var(--sidebar-text);
}

/* ============ SIDEBAR ============ */
#sidebar {
  width: var(--sidebar-width);
  /* background: var(--sidebar-bg); */
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-main);
  flex-shrink: 0;
  transition: all 0.2s ease-in-out;
  overflow: hidden;
  background: var(--bg-color);
  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.374); */
  backdrop-filter: blur(4.5px);
  -webkit-backdrop-filter: blur(4.5px);
  z-index: 99;
}
.quickActionBtn {
  border-radius: 50px;
  background: var(--bg-color);
  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.374); */
  backdrop-filter: blur(4.5px);
  -webkit-backdrop-filter: blur(4.5px);
  border: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-main);
  color: var(--sidebar-text);
  font-size: 12px;
}
.quickActionBtn:hover {
  background: #666df2;
  color: white;
}

#sidebar.sideCollaps {
  width: var(--sidebar-collaps) !important;
  transition: all 0.2s ease-in-out;
}
.collapsicon {
  position: absolute;
  right: 0;
}

.com-style {
  border-radius: var(--main-border-radious) !important;
}

.logo-area {
  padding: 13.5px 20px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  white-space: nowrap;
  justify-content: space-between;
}

#sidebar.sideCollaps .logo-area {
  justify-content: center;
}
#collapsiconBtn {
  cursor: pointer;
}
#sidebar.sideCollaps #collapsiconBtn {
  display: none;
  cursor: pointer;
}

.collapsIcon {
  display: none;
}
.logo-area-2 {
  display: none;
}
.newChat-area {
  padding: 15px 10px;
  padding-bottom: 0px;
}
#sidebar.sideCollaps .newChat-area {
  padding: 15px 10px;
}
.historyCollapsHead {
  display: none;
}
#sidebar.sideCollaps .historyCollapsHead {
  display: block;
}
.historyCollapsHeadBtn {
  display: none !important;
}
#sidebar.sideCollaps .historyCollapsHeadBtn {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.nav-group {
  padding: 15px 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}
#history-holder {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.history-chat-holder {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 5px;
}

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-text);
  margin: 15px 12px 5px;
  font-weight: 600;
}
.logoText {
  display: flex;
  align-items: center;
  justify-content: center;
}
#logOutWrapper {
  /* height: 65px; */
  border-top: 1px solid var(--border-main);
  /* background-color: rgba(255, 255, 255, 0.175); */
}
.profile-img-holder {
  width: 40px;
  height: 40px;
  border-radius: 50px;
  outline: 1.5px solid var(--border-main);
}
.profile-wrapper {
  flex-grow: 1;
  min-width: 0;
  border-radius: 10px;
  /* outline: 1.5px solid var(--border-main); */
}
.profile-Info-holder {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.profile-name {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 600;
}
.profileEmail {
  font-size: 12px;
  font-weight: 400;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar.sideCollaps .nav-label {
  margin: 0px;
  margin-bottom: 5px;
}
#sidebar.sideCollaps #history-holder {
  display: none;
}
#sidebar.sideCollaps .logoText {
  display: none;
}
#sidebar.sideCollaps .logo-holder img {
  width: 100%;
  height: 2.5rem;
}
#sidebar.sideCollaps .collapsIcon {
  display: block;
  cursor: pointer;
}

#sidebar.sideCollaps .logOutWrapperText {
  display: none;
}
#sidebar.sideCollaps #logOutWrapper {
  padding: 8px;
}
#sidebar.sideCollaps #logOutWrapper svg {
  width: 1rem;
  height: 1rem;
}
.profile-wrapper {
  gap: 10px;
}
#sidebar.sideCollaps .profile-wrapper {
  gap: 20px;
}
#logOutWrapper {
  padding: 16px;
}
#sidebar.sideCollaps #logOutWrapper {
  padding: 8px;
}
.logOutBtn,
.logOutBtnTooltip {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  text-align: center;
  align-content: center;
  background-color: transparent;
  box-shadow: none;
  border: transparent;
  color: white;
  border-radius: 50px;
  background-color: var(--active-new);
  /* border: 1px solid var(--border-main); */
}
.logOutBtnTooltip{
  width: 30px;
  height: 30px;
}
#sidebar.sideCollaps #logOutWrapper svg {
  display: block !important;
}
.addItem {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  /* color: var(--sidebar-text); */
  color: white;
  background: var(--active-new);

  overflow: hidden;
  isolation: isolate;
  transition: all 0.2s ease-in;
  white-space: nowrap;
  /* outline: 1.5px solid var(--border-main); */
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  /* border-radius: 6px; */
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s;
  font-size: 12px;
  color: var(--sideNavText);
  overflow: hidden;
  isolation: isolate;
  transition: all 0.2s ease-in;
  white-space: nowrap;
  font-weight: 600;
}

/* .nav-item:hover { background-color: rgba(255,255,255,0.08); } */

.nav-item.active,
.nav-item:hover {
  position: relative;
  /* background-color: var(--active-bg); */
  color: var(--active-new) !important;
  font-weight: 600;
  /* box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; */
  transition: all 0.2s ease-in;
  /* outline: 1.5px solid var(--border-main); */
}
#sidebar.sideCollaps .nav-item.active,
#sidebar.sideCollaps .nav-item:hover {
  position: relative;
  background-color: var(--active-bg);
  /* color: var(--sidebar-text); */
  color: var(--active-new);
  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
  transition: all 0.2s ease-in;
  outline: 1.5px solid var(--border-main);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 100%;
  left: 0;
  background-color: #666df2;
  border-radius: 0px 10px 10px 0px;
}

.historyText {
  position: relative;
  white-space: nowrap; /* prevents wrapping */
  overflow: hidden; /* hides overflow */
  text-overflow: ellipsis;
  font-size: 12px;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 6px;
  isolation: isolate;
}
.historyText:hover {
  position: relative;
  background-color: var(--newBg);
  color: var(--active-new);
  font-weight: 600;
  /* box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; */
  transition: all 0.2s ease-in;
  outline: 1.5px solid var(--border-main);
}
.historyText:hover::before {
  content: "";
  position: absolute;
  width: 64px;
  height: 100%;
  background: rgb(231, 231, 231);
  right: 0;
  top: 50%;
  transform: translate(0%, -50%);
  z-index: 1;
}

.historyDeleteBtn {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  /* display: none; */
  top: 50%;
  right: -4%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: rgb(72, 72, 72);
  display: flex;
  gap: 10px;
}
.historyText:hover .historyDeleteBtn {
  visibility: visible;
  pointer-events: all;
}

/* #sidebar.sideCollaps .nav-item.active::before,
#sidebar.sideCollaps .nav-item:hover::before {
  content: "";
  position: absolute;
  right: -1%;
  width: 0px !important;
  height: 0% !important;
  border-radius: 50px;
  box-shadow:
    rgb(100 74 249 / 26%) 38px 0px 38px 60px,
    rgb(100 74 249 / 8%) 0px 0px 10px 67px;
  transition: all 0.2s ease-in;
} */
/* .nav-item.active::before,
.nav-item:hover::before {
  content: "";
  position: absolute;
  right: -1%;
  width: 5px;
  height: 80%;
  background-color: var(--btn-color);
  border-radius: 50px;
  box-shadow:
    0 0 30px 10px #f25249,
    0 0 40px 20px #f25249ad,
    0 0 60px 30px #f2524943;
  transition: all 0.2s ease-in;
} */
/* .nav-item.active::after{
  content: "";
  position: absolute;
  width: 50%;
  height: 100%;
 background: linear-gradient(90deg,rgba(107, 95, 241, 0.58) 100%, rgba(107, 95, 241, 0.18) 0%);
  right: 0;
  z-index: -1;
  box-shadow: 0 0 30px rgba(107, 95, 241, 0.5), 0 0 60px rgba(46, 91, 255, 0.3);
} */

.nav-icon {
  margin-right: 12px;
  width: 18px;
  text-align: center;
  font-size: 16px;
}

/* ============ MAIN CONTENT - AGGRESSIVE FLEX ============ */
#main {
  flex: 1; /* CRITICAL: Takes all horizontal space */
  display: flex;
  flex-direction: column; /* Vertical flow */
  min-width: 0;
  position: relative;
  isolation: isolate;
}

#topbar {
  /* height: 55px; */
  /* background-color: var(--bg-color); */
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 13.5px 20px;
  flex-shrink: 0; /* Ensures topbar doesn't shrink */
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border-radius: 6px;
  padding: 6px 12px;
  width: 400px;
  border: 1px solid var(--border-main);
}

.search-box:focus-within {
  border-color: var(--primary-color);
  background: var(--card-bg);
}
.search-input {
  border: none;
  background: transparent;
  flex: 1;
  margin-left: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.actions {
  position: absolute;
  right: 10px;
  top: 50px;
  background-color: var(--bg-color);
  flex-direction: column;
  align-items: start;
  width: 200px;
  height: auto;
  z-index: 999;
  padding: 16px;
  box-shadow: var(--box-shadow);
  border-radius: 10px;
  display: flex;
  gap: 10px;
}

.btn {
  padding: 7px 14px;
  border-radius: 5px;
  /* border: 1px solid var(--border-color); */
  /* background: var(--card-bg); */
  background-color: var(--newBg);
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: 0.2s;
  outline: 1.5px solid var(--border-main);
  backdrop-filter: blur(15px) saturate(183%);
  -webkit-backdrop-filter: blur(15px) saturate(183%);
  outline: 1px solid var(--border-color);
}
.btn:hover {
  background-color: var(--bg-color);
  border-color: #ccc;
}
.btn-primary {
  background-color: var(--active-new);
  color: white;
  border: none;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.historySearchBtn {
  background-color: transparent;
  border: none;
  width: 20px;
  height: 20px;
}
.historySearchBtn svg {
  width: 0.8rem;
  height: 0.8rem;
  color: var(--active-text);
}
/* ============ WORKSPACE PANELS - AGGRESSIVE FLEX ============ */
#workspace {
  flex: 1; /* CRITICAL: Must expand to fill height below topbar */
  padding: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Setting height: 100% defensively */
  height: 100%;
}

#view-explorer.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* Ensure no residual height calculation issues */
  height: 100%;
}

#view-explorer.active .split-container {
  flex: 1;
  height: 100%;
}

/* FIX: The Call Graph view must also be set to full height if it contains stacked elements */
#view-graph.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}

/* Ensure the card inside the Call Graph view takes up all space */
#view-graph.active .card {
  flex: 1;
  min-height: 0;
}

/* CRITICAL FIX: Ensure view panels behave correctly */
.view-panel {
  display: none;
  flex: 1;
  min-height: 0;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ============ EXPLORER: three-column flex layout ============ */
#explorerSplit {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  gap: 0;
}

/* Left tree panel � resizable, collapses smoothly */
#explorerTreePanel {
  width: 360px;          /* wider default so first-level folders fit without scroll */
  flex-shrink: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  transition: width 0.22s ease;
  display: flex;
  flex-direction: column;
}

#explorerTreePanel.collapsed {
  width: 0;
}

/* Suppress the smooth transition while actively dragging so resize feels instant */
#explorerTreePanel.resizing {
  transition: none;
}

/* Toggle / resize strip between tree and detail */
#explorerToggleStrip {
  width: 10px;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  background: var(--border-main);
  border-radius: 4px;
  font-size: 10px;
  color: transparent;
  user-select: none;
  margin: 0 3px;
  transition: background 0.15s, color 0.15s;
}

#explorerToggleStrip:hover {
  background: var(--primary-color);
  color: white;
}

/* Right detail panel � takes all remaining space */
#explorerDetailPanel {
  flex: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* --- SPECIAL LAYOUT FOR ASSISTANT (Chat Style) --- */
#view-assistant.active {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
}

/* Cards */
.card {
  background: var(--card-bg);
  /* border: 1px solid var(--border-color); */
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  height: 100%;
  min-height: 0;
}

/* ADD THIS TO THE STYLE BLOCK */
.flex-1-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-main);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--newBg);
  flex-shrink: 0;
  /* color: black; */
  color: var(--active-text);
}

.card-body {
  padding: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ============ FILE EXPLORER (SPLIT & SCROLL) ============ */

/* The Split Container Wrapper */
.split-container {
  display: flex !important;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  /* background: var(--card-bg); */
  /* border: 1px solid var(--border-color); */
  border-radius: 8px;
}

/* Left Panel (Tree) */
.split-left {
  /* width: 350px; */
  /* min-width: 200px; */
  /* max-width: 800px; */
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-main);
  background: var(--card-bg);
  color: var(--active-text);
  flex-shrink: 0;
  width: 100%; /* Important for Bootstrap column width */
  height: 100%; /* Fills the container height */
  min-height: 0; /* Allow flex shrinking so inner scroll works */
  overflow: hidden;
}

/* Resizer Gutter */
.gutter {
  width: 5px;
  background: #f1f5f9;
  cursor: col-resize;
  flex-shrink: 0;
  transition: background 0.2s;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}
.gutter:hover,
.gutter.dragging {
  background: var(--primary-color);
}

/* Right Panel (Details) */
.split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg);
  min-width: 0;
  height: 100%; /* Fills the container height */
  min-height: 0; /* Required for flex scroll to work */
  border: 1px solid var(--border-main);
}

/* Independent Scroll Areas */
.tree-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 10px;
  min-height: 0;
}

/* FIX 3: Dedicated scroll area for method details */
#fileDetailBody {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

/* File Tree Styling */
.tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: max-content; /* lets deep paths expand beyond panel width so the scroll area scrolls */
}
.tree-item {
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 13px;
  border-radius: 4px;
  white-space: nowrap;
  color: var(--text-main);
}
.tree-item:hover {
  background-color: var(--bg-color);
}
.tree-icon {
  margin-right: 8px;
  color: var(--text-secondary);
  width: 16px;
  text-align: center;
}
.tree-group {
  margin-left: 20px;
  border-left: 1px solid var(--border-color);
  display: none;
  padding-left: 2px;
}
.tree-group.expanded {
  display: block;
}
.folder-caret {
  width: 12px;
  text-align: center;
  margin-right: 2px;
  font-size: 10px;
  color: #94a3b8;
}

/* Chat Area */
.chat-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* background-color: var(--bg-color); */
  min-height: 0;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}
.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}
.msg.bot {
  align-self: flex-start;
  align-items: flex-start;
  max-width: 90%;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.msg.bot .msg-bubble {
  /* background: var(--card-bg); */
  /* border: 1px solid var(--border-color); */
  position: relative;
  z-index: 1;
  backdrop-filter: blur(15px) saturate(183%);
  -webkit-backdrop-filter: blur(15px) saturate(183%);

  background-color: var(--newBg);
  border: 1px solid var(--border-main);
  border-radius: 10px;
}

.msg.user .msg-bubble {
  background: #c1c4f7;
  color: black;
  /* color: var(--sidebar-text); */
  border-bottom-right-radius: 2px;
  /* border: 1px solid var(--border-main); */
  word-break: break-all;
  width: 100%;
}

/* Input Area (Sticky Bottom) */
.input-wrapper {
  /* background: var(--card-bg); */
  /* border-top: 1px solid var(--border-color); */
  padding: 15px 0px;
  flex-shrink: 0;
}

.input-box-container {
  display: flex;
  flex-direction: column;
  /* border: 1px solid var(--border-color); */
  background: var(--bg-color);
  /* padding: 10px; */
  transition: border-color 0.2s;
  position: relative;

  background-color: var(--newBg);
  border-radius: 12px;
  /* box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px; */
  border: 1px solid var(--border-main);
}
.welcomeIcon {
  width: 40px;
  height: 40px;
  background-color: var(--active-new);
  display: inline-block;
  text-align: center;
  align-content: center;
  border-radius: 10px;
  margin-right: 0.5rem;
  color: white;
}

.input-box-container:focus-within {
  border-color: var(--primary-color);
}

.chat-textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  height: 60px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
}

.input-toolbar {
  display: flex;
  justify-content: space-between;
  /* align-items: center; */
  margin-top: 8px;
  position: relative;
  border-radius: 20px;
  /* box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; */
}
#promptInput {
  /* border: none; */
  resize: none;
  /* border-radius: 50px; */
  border: none;
  font-size: 14px;
  color: var(--sidebar-text);
}
#promptInput::placeholder {
  color: var(--sidebar-text);
  opacity: 1; /* override default opacity */
}

/* Chrome, Safari */
#promptInput::-webkit-input-placeholder {
  color: var(--sidebar-text);
}

/* Firefox */
#promptInput::-moz-placeholder {
  color: var(--sidebar-text);
}

/* Internet Explorer */
#promptInput:-ms-input-placeholder {
  color: var(--sidebar-text);
}

/* Edge (old) */
#promptInput::-ms-input-placeholder {
  color: var(--sidebar-text);
}
#promptInput.form-control:focus {
  box-shadow: none;
  border: none;
  background-color: transparent;
}
#assistantMode {
  /* outline: 1px solid var(--border-color); */
  background-color: var(--select-bg);
  color: var(--active-text);
}
.form-control:focus {
  box-shadow: none;
}
#assistantMode option {
  color: black;
}

.sendBtn {
  border: none;
  /* border: 1px solid var(--border-color); */
  background: var(--btn-color);
  /* width: 45px; */
  height: 45px;
  /* border-radius: 12px; */
  color: white;
  /* color: var(--btn-text); */
  /* position: absolute; */
  right: 10px;
  bottom: 0;
}
.sendBtn:hover {
  background-color: rgb(61, 0, 152);
  color: white;
}

.btn-primary:hover {
  background-color: var(--btn-color);
}

/* Code Blocks */
pre {
  background: var(--card-bg);
  color: var(--code-text);
  padding: 12px;
  /* border-radius: 6px; */
  font-size: 12px;
  overflow-x: auto;
  font-family: "Consolas", monospace;
  margin: 10px 0;
  border: 1px solid #333;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text-secondary);
}
.form-control {
  width: 100%;
  padding: 8px;
  /* border: 1px solid var(--border-color); */
  border-radius: 4px;
  background: white;
  color: black;
  font-size: 13px;
}

#promptInput.form-control {
  background-color: transparent;
  /* color: white; */
  color: var(--active-text);
}
/* #promptInput::placeholder {
  color: white;
} */

/* Loading Overlay */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 999;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* FIX 1: Method Answer Modal Styles */
#methodAnswerModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
}
#methodAnswerModal > div {
  width: 700px;
  max-height: 80%;
  background: var(--card-bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
#methodAnswerContent {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--newBg);
  color: var(--active-text);
}

/* Diff View (Retained) */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  height: 100%;
}
.diff-box {
  /* border: 1px solid var(--border-color); */
  border-radius: 4px;
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  overflow: auto;
  background: var(--bg-color);
  white-space: pre-wrap;
}

/* FIX 3: Make fileDetailBody the dedicated scroll area */
#fileDetailBody {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

/* Styling for Implementation Plan Sections */
.msg-bubble h3 {
  margin-top: 15px;
  margin-bottom: 10px;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
  font-size: 16px;
}

/* Status Badges for Conclusive Audit */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 11px;
  margin-right: 5px;
  text-transform: uppercase;
}
.status-built {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.status-partial {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}
.status-missing {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Code Synthesis Container */
.code-container {
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.code-header {
  background: #2d2d2d;
  color: #d4d4d4;
  padding: 8px 15px;
  font-size: 12px;
  font-family: monospace;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-block {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  padding: 15px;
  margin: 0;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}
.code-header {
  background: #2d2d2d;
  color: #aaa;
  padding: 5px 12px;
  font-size: 11px;
  font-family: sans-serif;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  margin-top: 10px;
  border-bottom: 1px solid #444;
}

.code-block {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  padding: 15px !important;
  border-radius: 0 0 6px 6px !important;
  font-family: "Consolas", "Monaco", monospace !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  overflow-x: auto;
  margin: 0 0 10px 0 !important;
  border: 1px solid #333 !important;
}

.temp-badge {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}

#sidebar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#actions.sideActive {
  display: flex;
}
/* ================= OVERLAY ================= */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 76%);
  display: none;
  z-index: 1040;
}

.sidebar-overlay.active {
  display: block;
}
.mobile-toggle {
  display: none;
}
.menuToggle {
  display: block;
}
.resBtn {
  /* flex: 1; */
  display: flex;
  align-items: center;
  gap: 10px;
}
.resBtn:first-of-type {
  background-color: #2563eb;
  color: white;
}

.profile-wrapper {
  position: relative;
}

.logout-tooltip {
  position: absolute;

    top: -68px;
    left: 0px;
    /* background: #fff; */
    /* border: 1px solid #ddd; */
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
}
/* 
.actions button {
  
  justify-content: center;
  gap: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50px;
  padding: 4px;
} */
.mobile-toggle {
  /* display: block; */
  /* position: fixed; */
  top: 10px;
  left: 5px;
  width: 40px;
  height: 40px;
  /* z-index: ; */
  background: var(--bg-color);
  padding: 6px 10px;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  /* right: 10px; */
}
.actions {
  display: none;
}

.actions button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  gap: 10px;
}
.actions button svg {
  width: 1rem;
  height: 1rem;
}
.comAction {
  /* display: none !important; */
}

/* history model css */

.history-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-main);
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
}

.history-item:hover {
  background: var(--bg-color);
}

.history-container {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid var(--border-main);
  border-radius: 6px;
}

.no-data {
  text-align: center;
  padding: 15px;
  color: #999;
}
@media screen and (max-width: 478px) {
  .history-chat-holder {
    height: auto;
    max-height: inherit;
  }
  #promptInput,
  .msg-bubble {
    font-size: 12px;
  }
  .resIcon {
    display: none;
  }
  .chat-history-container {
    padding: 0px;
  }
  .glass-card {
    width: 100%;
  }
  .nav-group {
    max-height: 77dvh;
    overflow: auto;
  }
}

@media (max-width: 1100px) {
  .logo-holder img {
    width: 5rem;
  }
  .search-box {
    display: none;
  }
  #topbar {
    /* padding: 0px 50px; */
    justify-content: space-between;
  }
  .logo-area-2 {
    display: flex;
    white-space: nowrap;
    padding: 13.5px 0px;
    /* font-size: 12px; */
    border: 0px;
  }

  #sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 1050;
    height: 100%;
  }

  #sidebar.mobileOpen {
    left: 0;
  }
  #collapsiconBtn {
    display: none;
  }

  #sideNavBtn {
    display: none;
  }
  .actions {
  }

  .menuToggle {
    right: 5px;
    left: auto;
  }

  .comAction {
    /* display: block !important; */
  }
  #graphMethodInput {
    width: 100% !important;
  }
  #login {
    width: 100% !important;
  }
}
@media (max-width: 1100px) {
  .mobile-toggle {
    display: block;
  }
}
