/* :root { */
/*   --body-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); */
/*   --msger-bg: #fff; */
/*   --border: 2px solid #ddd; */
/*   --left-msg-bg: #ececec; */
/*   --right-msg-bg: #579ffb; */
/* } */

:root {
  /* --body-bg: linear-gradient(135deg, #1e1e2e 0%, #2a2a3c 100%); */
  --body-bg: #2a2a3c;
  /* --msger-bg: #fff; */
  --msger-bg: #2a2a3c;
  --border: 2px solid #ddd;
  --left-msg-bg: #ececec;
  --right-msg-bg: #579ffb;
  --left-thought-bg: #ececec;
  --right-thought-bg: #579ffb;
  --user-chat-width: 70%;
  --sidebar-width: 260px;
  --sidebar-inline-padding: 12px;
  --sidebar-mask: linear-gradient(90deg, #000, #000 84%, transparent 89%, transparent);
  font-size: small;
}



/* Responsive additions */
body {
    display: grid;
    grid-template-columns:
        minmax(150px, 0.5fr)
        minmax(300px, 1.5fr)
        minmax(150px, 0.5fr);
    gap: 1rem;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
	background-color: #2a2a3c;
	/* background-image: var(--body-bg); */
}

.container {
    grid-area: 1 / 3 / 2 / 4;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
}

.history {
    grid-area: 1 / 1 / 3 / 2;
    min-width: 150px;
    overflow: hidden;
}

.msger {
    grid-area: 1 / 2 / 5 / 3;
    min-width: 300px;
    max-width: 100%;
}


.settings-container {
    grid-area: 1 / 3 / 2 / 4;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 150px;
}

.docs-container {
    grid-area: 2 / 3 / 5 / 4;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 150px;
}

.plan-container {
    grid-area: 5 / 3 / 6 / 4;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 150px;
}

.nested-grid {
  display: grid;
  /* grid-template-columns: 1fr 1fr; /\* Or subgrid *\/ */
  /* Options for spacing the nested grid: */
  gap: 15px; /* Sets both row and column gap */
  /* row-gap: 20px;
  column-gap: 10px; */ /* Sets row and column gap separately */
  grid-template-columns: subgrid;
}

.sub-item1 {
  border: 1px solid black;
  padding: 8px;
  width: 75%;
}

.sub-item2 {
  border: 1px solid black;
  padding: 8px;
  /* width: 25%; */
}


@media (max-width: 1200px) {
    body {
        grid-template-columns: minmax(180px, 1fr) minmax(400px, 2fr);
        grid-template-rows: auto auto;
        gap: 1rem 2rem;
    }

    .msger {
        grid-area: 1 / 2 / 5 / 3;
		height: auto;
        min-height: 70vh;
    }

	.history {
		grid-area: 2 / 1 / 3 / 2;
		min-width: unset;
		height: auto;
		max-height: 35vh;
	}

	.settings-container {
		grid-area: 1 / 1 / 2 / 2;
		min-width: unset;
		height: auto;
		max-height: 75vh;
		display: flex;
		flex-direction: column;
	}

	.right-sidebar3 {
		grid-area: 2 / 1 / 3 / 2;
		min-width: unset;
		height: auto;
		max-height: 25vh;
		display: flex;
		flex-direction: column;
	}

	.docs-container {
		grid-area: 3 / 1 / 5 / 2;
		min-width: unset;
		height: auto;
		max-height: 25vh;
		display: flex;
		flex-direction: column;
	}

	.plan-container {
		grid-area: 5 / 1 / 6 / 2;
		min-width: unset;
		height: auto;
		max-height: 25vh;
		display: flex;
		flex-direction: column;
	}

}

/* --- Mobile Layout (for phones and narrow windows) --- */
@media (max-width: 768px) {
    body {
        /* On mobile, switch from grid to a single-column flexbox layout */
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    /* Give each section an order and control its size */
    .msger {
        order: 1; /* Chat appears at the top */
        height: 60vh;
    }
    .history {
        order: 2; /* Discussions below chat */
        height: auto;
        max-height: 40vh;
    }
    .settings-container {
        order: 3; /* Settings below discussions */
        height: auto;
    }
    .docs-container {
        order: 4; /* Docs at the bottom */
        height: auto;
    }

    /* Allow the side panels to scroll internally if their content is too long */
    .left-sidebar, .left-sidebar2, .right-sidebar1, .right-sidebar3, .right-sidebar4 {
        overflow-y: auto;
    }
}


/* Hide scrollbars on list containers */
#list-container1,
#list-container2,
#list-container4 {
  /* Hide scrollbar for Firefox */
  scrollbar-width: none;

  /* Hide scrollbar for IE/Edge */
  -ms-overflow-style: none;

  /* Enable smooth scrolling */
  scroll-behavior: smooth;

  /* Required for scroll to work */
  overflow-y: auto;
}

/* Hide scrollbar for WebKit browsers */
#list-container1::-webkit-scrollbar,
#list-container2::-webkit-scrollbar,
#list-container4::-webkit-scrollbar  {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

/* Prevent parent sidebars from scrolling */
.left-sidebar,
.left-sidebar2,
.right-sidebar1 {
  overflow: hidden;
}

/* .left-sidebar, .right-sidebar3, .right-sidebar1 { */
.left-sidebar, .left-sidebar2, .right-sidebar1 {
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* overflow: auto; */
    /* max-height: calc(100vh - 2rem); */
	overflow: visible;
    /* overflow-y: auto; */
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* /\* This new rule restores scrolling to the task list itself *\/ */
/* .right-sidebar1 .collapsible-content { */
/*     max-height: 40vh; /\* Adjust this height as needed *\/ */
/*     overflow-y: auto; */
/*     padding-right: 5px; /\* Adds a little space so the scrollbar doesn't hug the content *\/ */
/* } */

.right-sidebar3 {
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: auto;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative; /* Add this line */
}

.right-sidebar4 {
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: auto;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.right-sidebar4 label {
  display: flex;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  /* color: #a0aec0; */
  color: #a0aec0;
  font-weight: 500;
}

.right-sidebar4 select {
  width: 85%;
  padding: 0.75rem 1rem;
  border: 1px solid #2d3748;
  border-radius: 6px;
  background-color: #2a2a3c;
  color: #ffffff;
  font-size: 0.9rem;
  appearance: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.left-sidebar::-webkit-scrollbar,
.left-sidebar2::-webkit-scrollbar,
.right-sidebar3::-webkit-scrollbar,
.right-sidebar1::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.container {
    height: calc(100vh - 2rem);
    gap: 1rem;
    overflow: hidden; /* Contain sidebar contents */
}

/* Modern Dropdown Styling */
.right-sidebar3 form {
  /* margin-bottom: 1.5rem; */
  margin-bottom: 0.0rem;
}

.right-sidebar3 label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #a0aec0;
  font-weight: 500;
  font-size: 0.9rem;
}

.right-sidebar3 select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #2d3748;
  border-radius: 6px;
  background-color: #2a2a3c;
  color: #ffffff;
  font-size: 0.9rem;
  appearance: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.right-sidebar3 select:hover {
  border-color: #4a5568;
  background-color: #3b3b52;
}

.right-sidebar3 select:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.right-sidebar3 button[type="submit"] {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #4299e1;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.right-sidebar3 button[type="submit"]:hover {
  background-color: #3182ce;
}

/* Modern Dropdown Options Styling */
.right-sidebar3 select option {
  padding: 0.5rem;
  background-color: #2a2a3c;
  color: #ffffff;
}

.right-sidebar3 select option:hover {
  background-color: #4299e1 !important;
}

.right-sidebar3, .right-sidebar1 {
    flex: 0 0 auto; /* Prevent growing/shrinking */
    height: auto;
    max-height: calc(33vh - 1rem); /* Divide container height */
    overflow-y: auto;
}

.right-sidebar4 button[type="submit"] {
  width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #4299e1;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.right-sidebar4 button[type="submit"]:hover {
  background-color: #3182ce;
}


/* Add padding to chat messages */
.msg {
  display: flex;
  align-items: flex-end;
  margin: 10px 0 10px 0; /* Added top margin */
}

/* Standardize button sizes */
.msger-send-btn,
.file-upload-btn,
.toggle-btn {
  height: 100%;
  min-width: 30px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border-color: #a0aec0;
  color: #a0aec0;
}

/* Standardize button sizes */
.file-upload-btn,
.toggle-btn {
  padding: 10px;
}

.msger {
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    flex-shrink: 0; /* Prevent chat area from shrinking */
	flex-flow: column wrap;
	justify-content: space-between;
	margin: 5px 10px;
	/* border: var(--border); */
	border-radius: 5px;
	background: var(--msger-bg);
	box-shadow: 0 15px 15px -5px rgba(0, 0, 0, 0.2);
}

.msger-header {
  /* display: flex; */
  font-size: medium;
  justify-content: space-between;
  padding: 10px;
  text-align: center;
  border-bottom: var(--border);
  background: #1e1e2e;
  color: #ddd;
}

.msger-chat {
    flex: 1;
    overflow-y: auto;
    /* min-height: 300px; */
    background-color: #2c2c42;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.msger-chat::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.msg {
  display: flex;
  align-items: flex-end;
  margin-bottom: 10px;
}

.msg-img {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  background: #ddd;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 50%;
}
.msg-bubble {
  /* max-width: 450px; */
    max-width: 80%;
    word-break: break-word;
    overflow-wrap: break-word;
	padding: 15px;
	border-radius: 15px;
	background: var(--left-msg-bg);
}
.msg-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.msg-info-name {
  margin-right: 10px;
  font-weight: bold;
}
.msg-info-time {
  font-size: 0.85em;
}

.left-msg .msg-bubble {
  border-bottom-left-radius: 0;
}

.right-msg {
  flex-direction: row-reverse;
}
.right-msg .msg-bubble {
  background: var(--right-msg-bg);
  color: #fff;
  border-bottom-right-radius: 0;
}
.right-msg .msg-img {
  margin: 0 0 0 10px;
}

.thought-style {
    background-color: #f9f9f9;  /* Lighter background for thoughts */
    border-left: 5px solid #FF9800;  /* Orange border for thoughts */
    font-style: italic;
    padding: 10px;
    margin: 10px 0;
}

.thought {
  display: flex;
  align-items: flex-end;
  margin-bottom: 10px;
}

.thought-img {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  background: #ddd;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 50%;
}
.thought-bubble {
  max-width: 450px;
  padding: 15px;
  border-radius: 15px;
  background: var(--left-thought-bg);
}
.thought-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.thought-info-name {
  margin-right: 10px;
  font-weight: bold;
}
.thought-info-time {
  font-size: 0.85em;
}

.right-thought {
  flex-direction: row-reverse;
}
.right-thought .thought-bubble {
  background: var(--right-msg-bg);
  color: #fff;
  border-bottom-right-radius: 0;
}
.right-thought .thought-img {
  margin: 0 0 0 10px;
}

.msger-inputarea {
    display: flex;
    padding: 0; /* Padding is now on the .form-item parent */
    /* align-items: center; */
    gap: 10px;
    width: 100%; /* Changed from 40vw to 100% of its container */
    background: transparent;
}

.msger-inputarea * {
  padding: 10px;
  border: none;
  border-radius: 3px;
  font-size: 1em;
}

.msger-input {
    flex: 1;
    background: #ddd;
    border: none;
    padding: 10px;
    border-radius: 3px;
    font-size: 1em;
    resize: none;
    overflow-y: hidden;
    max-height: 150px; /* Add this line */
    box-sizing: border-box; /* Add this for more accurate height calculation */
}

.msger-send-btn {
  margin-left: 10px;
  background: rgb(0, 196, 65);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.23s;
}
.msger-send-btn:hover {
  background: rgb(0, 180, 50);
}
.file-upload-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* border: 2px solid #ccc; */
    border: 2px solid #a0aec0;
	color: #a0aec0;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
	background: #2a2a3c;
    transition: background-color 0.3s, color 0.3s;
}
.msger-send-btn {
    padding: 8px 16px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 5px;
}
.msger-send-btn:hover, .file-upload-btn:hover {
    background-color: #0056b3;
    color: white;
}

/* Top Section Styling */
#top-section {
    flex: 1;
    background-color: #e0e0e0;
}

/* Bottom Section Styling */
#bottom-section {
    flex: 1;
    background-color: #d0d0d0;
}

/* Styling for divs inside the top section */
#top-section .sub-div {
    background-color: #c0c0c0;
    margin-bottom: 10px;
    padding: 10px;
}

/* Side-by-side container in bottom section */
.side-by-side-container {
    display: flex;
    justify-content: space-between;
}

/* Styling for divs inside the bottom section */
.side-div {
    flex: 1;
    background-color: #b0b0b0;
    padding: 10px;
    margin-right: 10px;
}

/* Remove margin from the last side-div */
.side-div:last-child {
    margin-right: 0;
}

.form-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #1e1e2e;
    border-top: 1px solid #ddd;
    flex-wrap: nowrap;
	justify-content: space-evenly;
	/* justify-content: flex-start; */
	/* justify-content: space-between; */
}
.form-item {
    display: inline-block;
    /* margin: 0 10px; /\* Add spacing between forms if desired *\/ */
    gap: 10px;
	background: #2a2a3c;
	border-radius: 6px;
    border-width: 2px;
    /* border-style: outset; */
}

.form-item3 {
    display: inline-block;
    margin: 0 10px; /* Add spacing between forms if desired */
    gap: 10px;
	background: #2a2a3c;
	border-radius: 6px;
    border-width: 2px;
    /* border-style: outset; */
}

.form-container2 {
    display: flex;
    gap: 1rem; /* Increased gap slightly for better spacing */
    padding: 1rem;
    background: #1e1e2e;
    border-top: 1px solid #ddd;
    flex-wrap: wrap; /* Allows controls to stack on smaller screens */
    align-items: center;
}

.form-item2 {
    display: flex;
    flex-grow: 1;  /* This tells the input's container to fill available space */
    min-width: 250px; /* Prevents the input from becoming too small */
    background: #2a2a3c;
    border-radius: 6px;
    border-width: 2px;
}

/* Add these new rules */
#list-container1, #list-container2, #list-container4  {
    max-height: 50vh;
    overflow-y: auto;
}

.left-sidebar {
    /* display: flex; */
    flex-direction: column;
    gap: 1rem;
}

.left-sidebar2 {
    /* display: flex; */
    flex-direction: column;
    gap: 1rem;
}

.right-sidebar3, .right-sidebar1 {
    /* flex: 1; */
    display: flex;
    flex-direction: column;
}

select, button {
    max-width: 100%;
    box-sizing: border-box;
}
.login {
    width: 280px;
    height: 100vh;
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 15px;
    overflow-y: auto;
}
.login h2 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}
.signup {
    width: 280px;
    height: 100vh;
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 15px;
    overflow-y: auto;
}
.signup h2 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.list-item3 {
    background: #2a2a3c;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap; /* Prevent text from wrapping to the next line */
    overflow: hidden; /* Hide the overflowed text */
    text-overflow: ellipsis; /* Display an ellipsis when the text overflows */
}

.list-item1 {
    background: #2a2a3c;
    padding: 10px 40px 10px 10px; /* Added right-side padding for the button */
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* This is crucial for positioning the child button */
}
.list-item1:hover {
    background: #3b3b52;
}

/* .delete-chat-btn { */
/*     position: absolute; */
/*     right: 10px; */
/*     top: 50%; */
/*     transform: translateY(-50%); */
/*     background-color: transparent; /\* Makes button background invisible *\/ */
/*     color: #e53e3e;                /\* A friendly red for the icon *\/ */
/*     border: none; */
/*     border-radius: 4px; */
/*     padding: 5px; */
/*     font-size: 14px; */
/*     cursor: pointer; */
/*     display: none;                 /\* Hide button by default *\/ */
/*     line-height: 1;                /\* Helps vertically align the icon *\/ */
/* } */

/* .list-item1:hover .delete-chat-btn, */
/* .list-item1.selected .delete-chat-btn { */
/*     display: inline-block; /\* Show on hover OR when selected *\/ */
/* } */

/* .delete-chat-btn:hover { */
/*     color: #c53030; /\* Darker red on hover *\/ */
/* } */

.list-container1 {
    list-style-type: none;
    padding: 0;
    width: 200px; /* or any specific width for the container */
}

.list-item4 {
    background: #2a2a3c;
    padding: 10px 40px 10px 10px; /* Right padding makes space for the button */
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* This is the line that fixes the positioning */
}
.list-item4:hover {
    background: #3b3b52;
}

.delete-plan-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e53e3e; /* Red background */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    cursor: pointer;
    display: none; /* Hide the button by default */
    transition: background-color 0.2s;
}

/* Show the button when hovering over the parent list item */
.list-item4:hover .delete-plan-btn {
    display: inline-block;
}

.delete-plan-btn:hover {
    background-color: #c53030; /* Darker red on hover */
}

.delete-research-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e53e3e; /* Red background */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    cursor: pointer;
    display: none; /* Hide the button by default */
    transition: background-color 0.2s;
}

/* Show the button when hovering over the parent list item */
.list-item4:hover .delete-research-btn {
    display: inline-block;
}

.delete-research-btn:hover {
    background-color: #c53030; /* Darker red on hover */
}


/* --- Styles for the new Edit Plan Button --- */
.edit-plan-btn {
    position: absolute;
    right: 45px; /* Position it to the left of the delete button */
    top: 50%;
    transform: translateY(-50%);
    /* background: transparent; */
    background-color: #007bff;
    border: none;
    color: #a0aec0; /* A neutral gray color */
    border-radius: 4px;
    /* padding: 2px 8px; /\* Adjust padding for the 'X' *\/ */
    /* padding: 5px; */
    /* border-radius: 4px; */
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: none; /* Hide the button by default */
    line-height: 1.2; /* Helps with vertical alignment */
    transition: background-color 0.2s;
}

.edit-plan-btn:hover {
    color: yellow; /* Brighten on hover */
}

/* --- Styles for the new Edit Research Button --- */
.edit-research-btn {
    position: absolute;
    right: 45px; /* Position it to the left of the delete button */
    top: 50%;
    transform: translateY(-50%);
    /* background: transparent; */
    background-color: #007bff;
    border: none;
    color: #a0aec0; /* A neutral gray color */
    border-radius: 4px;
    /* padding: 2px 8px; /\* Adjust padding for the 'X' *\/ */
    /* padding: 5px; */
    /* border-radius: 4px; */
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: none; /* Hide the button by default */
    line-height: 1.2; /* Helps with vertical alignment */
    transition: background-color 0.2s;
}

.edit-research-btn:hover {
    color: yellow; /* Brighten on hover */
}


/* Update the existing hover rule to show both buttons */
/* .list-item1:hover .delete-plan-btn, */
.list-item4:hover .edit-plan-btn {
    display: inline-block;
}


.list-container4 {
    list-style-type: none;
    padding: 0;
    width: 200px; /* or any specific width for the container */
}


.list-item2 {
    background: #2a2a3c;
    padding: 10px 40px 10px 10px; /* Right padding makes space for the button */
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* This is the line that fixes the positioning */
}
.list-item2:hover {
    background: #3b3b52;
}

.delete-doc-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e53e3e; /* Red background */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    cursor: pointer;
    display: none; /* Hide the button by default */
    transition: background-color 0.2s;
}

/* Show the button when hovering over the parent list item */
.list-item2:hover .delete-doc-btn {
    display: inline-block;
}

.delete-doc-btn:hover {
    background-color: #c53030; /* Darker red on hover */
}

/* --- Styles for the new Edit Doc Button --- */
.edit-doc-btn {
    position: absolute;
    right: 45px; /* Position it to the left of the delete button */
    top: 50%;
    transform: translateY(-50%);
    /* background: transparent; */
    background-color: #007bff;
    border: none;
    color: #a0aec0; /* A neutral gray color */
    border-radius: 4px;
    /* padding: 2px 8px; /\* Adjust padding for the 'X' *\/ */
    /* padding: 5px; */
    /* border-radius: 4px; */
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: none; /* Hide the button by default */
    line-height: 1.2; /* Helps with vertical alignment */
    transition: background-color 0.2s;
}

.edit-doc-btn:hover {
    color: yellow; /* Brighten on hover */
}

/* Update the existing hover rule to show both buttons */
/* .list-item1:hover .delete-doc-btn, */
.list-item2:hover .edit-doc-btn {
    display: inline-block;
}


.list-container2 {
    list-style-type: none;
    padding: 0;
    width: 200px; /* or any specific width for the container */
}
.selected {
    background: #4a4a6a;
}
.expandingInput {
    width: 100%;
    min-height: 3em; /* Minimum height */
    resize: none; /* Prevent manual resizing */
    overflow: hidden; /* Hide overflow */
    display: block;
}
#fileInput {
    display: none !important;
}
#fileInput2 {
    display: none !important;
}

#planInput {
    display: none !important;
}

#uploadBtn {
    display: none !important;
}

.toggle-btn {
    padding: 6px 8px;
    font-size: 14px;
    /* border: none; */
    cursor: pointer;
    /* border-radius: 6px; */
    border-radius: 6px;
    background-color: #2a2a3c;
    /* color: #ddd; */
	color: #a0aec0;
	border-color: #a0aec0;
    /* border-width: 2px; */
    border-style: outset;
    transition: background-color 0.3s, color 0.3s;
}

.toggle-btn:hover {
    background: #3b3b52;
    color: white;
}

.toggle-btn.on {
    background-color: #4a4a6a;
    color: white;
}

.logout-btn {
    padding: 6px 6px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    background-color: #ddd;
    color: black;
    transition: background-color 0.3s, color 0.3s;
}

.adminmode-btn {
    padding: 6px 6px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    background-color: #ddd;
    color: black;
    transition: background-color 0.3s, color 0.3s;
}

.response-style {
  max-width: 450px;
  padding: 15px;
  border-radius: 15px;
  background: var(--left-msg-bg);
}

.thought-style {
    background: rgba(60, 50, 60, 0.8); /* Light transparent background */
    border-left: 5px solid #FF9800;
    font-style: italic;
    max-width: 450px;
    padding: 10px;
    margin: 10px 0;
    color: #ddd;
    backdrop-filter: blur(5px); /* Applies blur effect */
}


.highlight {
    background-color: rgba(255, 235, 59, 0.3);
}
/* Updated CSS for vertical centering */
.msg-text-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    width: 100%;
}

.msg-text-content {
    flex-grow: 1;
    margin-right: 15px;
}

.magnify-glass {
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    opacity: 0.6;
    flex-shrink: 0;
    position: relative;
    /* Add these lines to prevent the icon from being selected */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* Standard */
}

/* Keep existing hover/active styles */
.magnify-glass:hover {
    opacity: 1;
    transform: scale(1.2);
}

.magnify-glass.active {
    opacity: 1;
    transform: scale(1.4);
    filter: brightness(1.2);
}

.msg-text-container {
    position: relative; /* Add this */
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Adjust if you want space between items */
  /* margin-bottom: 1rem; /\* Optional spacing *\/ */
}

.header-container h2 {
  /* margin-right: 110px; (This line is now gone) */

  /* ADD THESE FOUR LINES */
  flex-shrink: 1;         /* Allows the h2 to shrink */
  min-width: 0;           /* A key property to allow text in a flex item to shrink */
  white-space: nowrap;    /* Keeps the title on one line */
  overflow: hidden;         /* Hides the text that overflows */
  text-overflow: ellipsis;  /* Adds the '...' */
}

/* .header-container h2 { */
/*   margin-right: 110px; */
/* } */

.header-container svg {
  width: 20px;  /* Adjust size as needed */
  height: 20px;
}

.header-container svg {
  background-color: var(--body-bg); /* Use your site's theme variable */
  width: 40px;  /* Adjust as needed */
  height: 40px;
  /* border-radius: 0px; /\* Optional for rounded corners *\/ */
}

/* .header-container { */
/*   display: flex; */
/*   align-items: center; */
/*   justify-content: space-between; /\* Adjust if you want space between items *\/ */
/*   /\* margin-bottom: 1rem; /\\* Optional spacing *\\/ *\/ */
/* } */

/* .header-container svg { */
/*   width: 20px;  /\* Adjust size as needed *\/ */
/*   height: 20px; */
/* } */

/* .header-container svg { */
/*   background-color: var(--body-bg); /\* Use your site's theme variable *\/ */
/*   width: 40px;  /\* Adjust as needed *\/ */
/*   height: 40px; */
/*   /\* border-radius: 0px; /\\* Optional for rounded corners *\\/ *\/ */
/* } */

.settings-header-container {
  display: flex;
  align-items: center;
  justify-content: space-evenly; /* Adjust if you want space between items */
  /* margin-bottom: 1rem; /\* Optional spacing *\/ */
}


.footer-container {
  display: flex;
  /* align-items: flex-end; */
  justify-content: space-between; /* Adjust if you want space between items */
  padding: 2px;
  /* margin-bottom: 1rem; /\* Optional spacing *\/ */
}


.new-chat-button {
  background: transparent; /* No background */
  border: none; /* Remove default button border */
  max-width: 5vw;
  padding: 10px; /* Add padding for spacing */
  cursor: pointer; /* Make it clickable */
  display: flex; /* Align contents properly */
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  transition: background-color 0.3s, color 0.3s;
}

.new-chat-button:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}

.input-container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Adjust if you want space between items */
  margin-bottom: 1rem; /* Optional spacing */
}

/* .header-container h2 { */
/*   margin: 0; */
/* } */

.upload-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid gray;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: #a0aec0;
  transition: background-color 0.3s, color 0.3s;
}

.new-course-button {
  display: inline-flex;
  align-items: center;
  /* border:2 1px solid gray; */
  padding: 0px 0px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.new-course-button:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}

.new-persona-button {
  display: inline-flex;
  align-items: center;
  /* border:2 1px solid gray; */
  padding: 0px 0px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.new-persona-button:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}

#new-persona {
    position: absolute;
	left: 72.5%; /* Adjust based on your button position */
	top: 31.5%;
    transform: translateX(-5%);
    margin-left: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

#new-persona.visible {
    opacity: 1;
    visibility: visible;
    margin-left: 15px;
}


.new-persona-button {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.new-persona-button:hover {
  opacity: 0.8;
}


.upload-arrow {
	color: #a0aec0;
    transition: background-color 0.3s, color 0.3s;
	cursor: pointer;
}

.upload-arrow:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}

.new-task-button {
	color: #a0aec0;
    transition: background-color 0.3s, color 0.3s;
	cursor: pointer;
}

.new-task-button:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}

.new-api-button {
	color: #a0aec0;
    transition: background-color 0.3s, color 0.3s;
	cursor: pointer;
}

.new-api-button:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}


.new-model-button {
  display: inline-flex;
  align-items: center;
  /* border: 1px solid gray; */
  padding: 0px 0px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--body-bg);
  transition: background-color 0.3s, color 0.3s;
}

.new-model-button:hover {
    background: #3b3b52;
    color: white;
	opacity: 0.8;
}

#new-project {
    position: absolute;
	left: 72.5%; /* Adjust based on your button position */
	top: 31.5%;
    transform: translateX(-5%);
    margin-left: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

#new-project.visible {
    opacity: 1;
    visibility: visible;
    margin-left: 15px;
}

#new-api {
    position: absolute;
	left: 82.0%; /* Adjust based on your button position */
	top: 51.5%;
    transform: translateX(-5%);
    margin-left: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

#new-api.visible {
    opacity: 1;
    visibility: visible;
    margin-left: 15px;
}


#new-task {
    position: absolute;
	left: 85.0%; /* Adjust based on your button position */
	top: 65%;
    transform: translateX(-5%);
    margin-left: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

#new-task.visible {
    opacity: 1;
    visibility: visible;
    margin-left: 15px;
}

.hidden-input {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease; /* Animate the fade-in */
    position: absolute;
    box-sizing: border-box; /* This is crucial for matching dimensions */
    z-index: 10;            /* Ensures it appears on top of the dropdown */

    /* These styles make the input look like the dropdown */
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border: 1px solid #4a5568; /* A slightly more visible border */
    border-radius: 6px;
    background-color: #2a2a3c;
    color: #ffffff;
}

.hidden-input.visible {
    opacity: 1;
    visibility: visible;
}

.new-course-button {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.new-course-button:hover {
  opacity: 0.8;
}

#new-plan {
    position: absolute;
	left: 3.25%; /* Adjust based on your button position */
	top: 61.0%;
    transform: translateX(-5%);
    margin-left: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

#new-plan.visible {
    opacity: 1;
    visibility: visible;
    margin-left: 15px;
}

#new-research-plan {
    position: absolute;
	left: 72.5%; /* Adjust based on your button position */
	top: 31.5%;
    transform: translateX(-5%);
    margin-left: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

#new-research-plan.visible {
    opacity: 1;
    visibility: visible;
    margin-left: 15px;
}

.hidden-input2 {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease; /* Animate the fade-in */
    position: absolute;
    box-sizing: border-box; /* This is crucial for matching dimensions */
    z-index: 10;            /* Ensures it appears on top of the dropdown */

    /* These styles make the input look like the dropdown */
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border: 1px solid #4a5568; /* A slightly more visible border */
    border-radius: 6px;
    background-color: #2a2a3c;
    color: #ffffff;
}

.hidden-input2.visible {
    opacity: 1;
    visibility: visible;
}

.new-plan-button {
  color: #a0aec0;
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.new-plan-button:hover {
  background: #3b3b52;
  color: white;
  opacity: 0.8;
}

.new-research-button {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.new-research-button:hover {
  opacity: 0.8;
}


.new-student-button {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.new-student-button:hover {
  opacity: 0.8;
}


.custom-arrow {
      font-size: 2em; /* Adjust size if needed */
      color: blue; /* Change to your desired color */
    }

/* General styling for the container */
.slider-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    /* background-color: #f7f7f7; */
    padding: 5px;
    border-radius: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 5px auto; /* Center it for demonstration */
}

.slider-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* The Slider Itself */
.slider {
    -webkit-appearance: none; /* Removes default browser styling */
    appearance: none;
    width: 100%; /* Full width of its container */
    height: 8px;
    /* background: #ddd; /\* The slider track color *\/ */
    border-radius: 5px;
    outline: none; /* Removes the focus outline */
    opacity: 0.9;
    transition: opacity .2s;
}

.slider:hover {
    opacity: 1; /* Makes it fully opaque on hover */
}

/* The Slider Thumb (the part you drag) */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; /* Width of the thumb */
    height: 20px; /* Height of the thumb */
    background: #0075FF; /* Thumb color */
    border-radius: 50%; /* Makes it a circle */
    cursor: pointer; /* Pointer cursor on hover */
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.slider::-moz-range-thumb { /* Same styling for Firefox */
    width: 20px;
    height: 20px;
    background: #0075FF;
    border-radius: 50%;
    cursor: pointer;
}

.slider-value::-webkit-inner-spin-button,
.slider-value::-webkit-outer-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge */
    margin: 0;
}


/* The main container for positioning */
.dropdown-container {
    position: relative; /* This is the positioning anchor for the menu */
    display: flex;
}

/* The button that triggers the dropdown */
.dropdown-btn {
    padding: 2px 8px;
    font-size: 14px;
    /* border: none; */
    cursor: pointer;
    border-radius: 6px;
    background-color: #2a2a3c;
    /* color: #ddd; */
	color: #a0aec0;
	border-color: #a0aec0;
    /* border-width: 2px; */
    border-style: outset;
    transition: background-color 0.3s, color 0.3s;
    /* background-color: #007bff; */
    /* color: white; */
    /* padding: 12px 20px; */
    /* font-size: 16px; */
    /* border: none; */
    /* border-radius: 6px; */
    /* cursor: pointer; */
    /* transition: background-color 0.3s; */
}

.dropdown-btn:hover {
    /* background-color: #0056b3; */
    background: #3b3b52;
    color: white;
}

/* The drop-up menu itself */
.dropdown-menu {
    display: none; /* Hide the menu by default */
    position: absolute;
    top: 100%; /* Position it above the container */
    left: 0;
    margin-bottom: 5px; /* Add a small gap between button and menu */
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 6px;
    z-index: 100;
}

/* This class is added by JavaScript to show the menu */
.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: black;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none; /* Prevents text from being highlighted on click */
}

/* This adds a bit of space between the checkbox and the tool name */
.dropdown-item input[type="checkbox"] {
    margin-right: 10px;
    vertical-align: middle;
}

/* Change color of links on hover */
.dropdown-item:hover {
    background-color: #f1f1f1;
}

/* Keep rounded corners consistent */
.dropdown-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}


/* The main container for positioning */
.dropup-container {
    position: relative; /* This is the positioning anchor for the menu */
    display: flex;
}

/* The button that triggers the dropup */
.dropup-btn {
    padding: 2px 8px;
    font-size: 14px;
    /* border: none; */
    cursor: pointer;
    border-radius: 6px;
    background-color: #2a2a3c;
    /* color: #ddd; */
	color: #a0aec0;
	border-color: #a0aec0;
    /* border-width: 2px; */
    border-style: outset;
    transition: background-color 0.3s, color 0.3s;
    /* background-color: #007bff; */
    /* color: white; */
    /* padding: 12px 20px; */
    /* font-size: 16px; */
    /* border: none; */
    /* border-radius: 6px; */
    /* cursor: pointer; */
    /* transition: background-color 0.3s; */
}

.dropup-btn:hover {
    /* background-color: #0056b3; */
    background: #3b3b52;
    color: white;
}

/* The drop-up menu itself */
.dropup-menu {
    display: none; /* Hide the menu by default */
    position: absolute;
    bottom: 100%; /* Position it above the container */
    left: 0;
    margin-bottom: 5px; /* Add a small gap between button and menu */
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 6px;
    z-index: 100;
}

/* This class is added by JavaScript to show the menu */
.dropup-menu.show {
    display: block;
}

.dropup-item {
    display: block;
    padding: 12px 16px;
    color: black;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none; /* Prevents text from being highlighted on click */
}

/* This adds a bit of space between the checkbox and the tool name */
.dropup-item input[type="checkbox"] {
    margin-right: 10px;
    vertical-align: middle;
}

/* Change color of links on hover */
.dropup-item:hover {
    background-color: #f1f1f1;
}

/* Keep rounded corners consistent */
.dropup-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.dropup-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}



.rectangular-container {
    position: relative;
    /* width: 300px; */
    /* height: 100px; */
    /* background-color: #f0f0f0; */
    /* border: 1px solid #ccc; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding: 0 20px; */
    box-sizing: border-box;
}

.triangle-button {
    width: 0;
    height: 0;
    border-style: solid;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.triangle-button:hover {
    opacity: 0.8;
}

.left-triangle {
    border-width: 50px 50px 50px 0;
    border-color: transparent #3498db transparent transparent;
}

.right-triangle {
    border-width: 50px 0 50px 50px;
    border-color: transparent transparent transparent #e74c3c;
}

* Style for the new sidebar toggle button */
.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: #a0aec0; /* Match other header icons */
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    margin-right: 10px; /* Add space between button and "Discussions" text */
    transition: color 0.2s ease;
}

.sidebar-toggle-btn:hover {
    color: white;
}

/* --- Styles for the Collapsed State --- */

/* This rule changes the grid layout to shrink the first column */
body.settings-collapsed {
    /* Adjust grid to make the first column much smaller */
    grid-template-columns: minmax(50px, 0.25fr) 1fr 30px;
}

/* These rules hide the text and list when collapsed */
body.settings-collapsed .settings-container right-sidebar4 h2,
body.settings-collapsed .right-sidebar4 #list-container1,
body.settings-collapsed .right-sidebar4 #chat-form {
    display: none;
}

/* This rule re-centers the remaining icons vertically */
body.settings-collapsed .right-sidebar4 .header-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Add space between the icons in collapsed view */
}


/* This rule changes the grid layout to shrink the first column */
body.discussions-collapsed {
    /* Adjust grid to make the first column much smaller */
    grid-template-columns: 30px 1fr minmax(50px, 0.25fr);
}

/* These rules hide the text and list when collapsed */
body.discussions-collapsed .left-sidebar h2,
body.discussions-collapsed .left-sidebar #list-container1 #list-container4,
body.discussions-collapsed .left-sidebar #chat-form {
    display: none;
}

body.discussions-collapsed .left-sidebar2 h2,
body.discussions-collapsed .left-sidebar2 #list-container1 #list-container4,
body.discussions-collapsed .left-sidebar2 #chat-form {
    display: none;
}

/* This rule re-centers the remaining icons vertically */
body.discussions-collapsed .left-sidebar .header-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Add space between the icons in collapsed view */
}

/* This rule re-centers the remaining icons vertically */
body.discussions-collapsed .left-sidebar2 .header-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Add space between the icons in collapsed view */
}


/* /\* Style for the new toggle collapse button *\/ */
/* .toggle-collapse-btn { */
/*     background: transparent; */
/*     border: none; */
/*     color: #a0aec0; /\* Match other header icons *\/ */
/*     cursor: pointer; */
/*     font-size: 1.2rem; */
/*     padding: 10px; */
/*     margin-right: 2rem; /\* Add space between button and "Discussions" text *\/ */
/*     transition: color 0.2s ease; */
/* } */

.toggle-collapse-btn:hover {
    color: white;
}

/* Hide the content when the parent section is collapsed */
.is-collapsed .collapsible-content {
    display: none;
}

/* Rotate the chevron icon down when collapsed */
.is-collapsed .toggle-collapse-btn {
    transform: rotate(180deg);
}

/* .header-left-items { */
/*     display: flex; */
/*     align-items: center; */
/* 	padding: 2px; */
/* 	gap: 1em; */
/* } */

.header-left-items {
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  padding: 2px;
  gap: 1em;
  min-width: 0; /* <--- ADD THIS LINE */
}

.header-left {
	display: flex;
	justify-content: space-between;
}

/* --- Current Plan Styles --- */
.current-plan {
    margin-top: 1rem;
}

.current-plan-steps {
    list-style-type: none;
    padding-left: 0;
}

.current-step {
    margin-bottom: 5px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 4px;
}

.step-header:hover {
    background-color: #3b3b52;
}

.step-label {
    display: flex;
    align-items: center;
    flex-grow: 1;
    cursor: pointer;
}

.step-text {
    padding-left: 8px;
}

.step-toggle {
    cursor: pointer;
    width: 16px;
    text-align: center;
    transition: transform 0.2s ease;
    color: #a0aec0;
}

.step-toggle.is-placeholder {
    cursor: default;
}

.current-step.is-expanded > .step-header > .step-toggle {
    transform: rotate(90deg);
}

.step-assignment {
    background-color: #1e1e2e;
    color: #fff;
    border: 1px solid #4a5568;
    border-radius: 4px;
    font-size: 0.8rem;
    padding: 2px 4px;
}

ul.nested-steps {
    list-style-type: none;
    padding-left: 24px; /* Indent sub-tasks */
    display: none; /* Hidden by default */
}

.current-step.is-expanded > ul.nested-steps {
    display: block; /* Show when parent is expanded */
}

/* Style for the dynamically created source explanation bubble */
.source-explanation-bubble {
    background-color: #4a4a6a; /* A different color to distinguish it */
    color: #e0e0e0;
    padding: 12px;
    border-radius: 12px;
    margin-top: 8px;          /* Space between the paragraph and the explanation */
    margin-left: 60px;        /* Indent it to align under the main bubble's text */
    max-width: calc(100% - 70px); /* Ensure it doesn't overflow the container */
    word-wrap: break-word;
    font-size: 0.9em;
    border: 1px solid #5a5a7a;
    animation: fadeIn 0.3s ease-in-out; /* Add a subtle fade-in effect */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Delete Confirmation Dialogue Styles --- */
.delete-confirmation-bubble {
    background-color: #4a4a6a;
    color: #e0e0e0;
    padding: 10px;
    border-radius: 8px;
    margin-top: 5px;
    animation: fadeIn 0.3s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.delete-confirmation-bubble span {
    margin-right: 10px;
}

.delete-confirmation-bubble .btn-group {
    display: flex;
    gap: 8px;
}

.delete-confirmation-bubble button {
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.delete-confirmation-bubble .confirm-btn {
    background-color: #e53e3e; /* Red */
    color: white;
}

.delete-confirmation-bubble .confirm-btn:hover {
    background-color: #c53030;
}

.delete-confirmation-bubble .cancel-btn {
    background-color: #718096; /* Gray */
    color: white;
}

.delete-confirmation-bubble .cancel-btn:hover {
    background-color: #4a5568;
}

/* --- Styles for the Discussion Delete Button --- */
.delete-chat-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e53e3e; /* Red background */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px; /* Adjust padding for the 'X' */
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2; /* Helps center the 'X' vertically */
    cursor: pointer;
    display: none; /* Hide the button by default */
    transition: background-color 0.2s;
}

/* /\* Show the button when hovering over the parent OR when the item is selected *\/ */
/* .list-item1:hover .delete-chat-btn, */
/* .list-item1.selected .delete-chat-btn { */
/*     display: inline-block; */
/* } */

.delete-chat-btn:hover {
    background-color: #c53030; /* Darker red on hover */
}

/* --- Styles for the new Edit Chat Button --- */
.edit-chat-btn {
    position: absolute;
    right: 45px; /* Position it to the left of the delete button */
    top: 50%;
    transform: translateY(-50%);
    /* background: transparent; */
    background-color: #e53e3e; /* Red background */
    border: none;
    color: #a0aec0; /* A neutral gray color */
    border-radius: 4px;
    /* padding: 2px 8px; /\* Adjust padding for the 'X' *\/ */
    /* padding: 5px; */
    /* border-radius: 4px; */
    cursor: pointer;
    display: none; /* Hide the button by default */
    line-height: 1; /* Helps with vertical alignment */
    transition: color 0.2s;
}

.edit-chat-btn:hover {
    color: white; /* Brighten on hover */
}

/* Update the existing hover rule to show both buttons */
.list-item1:hover .delete-chat-btn,
.list-item1:hover .edit-chat-btn,
.list-item1.selected .delete-chat-btn,
.list-item1.selected .edit-chat-btn {
    display: inline-block;
}

/* --- Styles for Header Button Group --- */
.header-right-items {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Controls space between the two buttons */
}

.view-toggle-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    border: 1px solid #a0aec0;
    cursor: pointer;
    border-radius: 5px;
    background-color: transparent;
    color: #a0aec0;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap; /* Prevents text from wrapping */
}

.view-toggle-btn:hover {
    background-color: #3b3b52;
    color: white;
}

/* The button that triggers the dropdown */
.dropdown-btn {
    padding: 2px 8px;
    font-size: 14px;
    /* border: none; */
    cursor: pointer;
    border-radius: 6px;
    background-color: #2a2a3c;
    /* color: #ddd; */
	color: #a0aec0;
	border-color: #a0aec0;
    /* border-width: 2px; */
    border-style: outset;
    transition: background-color 0.3s, color 0.3s;
    /* background-color: #007bff; */
    /* color: white; */
    /* padding: 12px 20px; */
    /* font-size: 16px; */
    /* border: none; */
    /* border-radius: 6px; */
    /* cursor: pointer; */
    /* transition: background-color 0.3s; */
}

.dropdown-btn:hover {
    /* background-color: #0056b3; */
    background: #3b3b52;
    color: white;
}

/* /\* The drop-up menu itself *\/ */
/* .dropdown-menu { */
/*     display: none; /\* Hide the menu by default *\/ */
/*     position: absolute; */
/*     bottom: 0%; /\* Position it above the container *\/ */
/*     left: 0; */
/*     margin-bottom: 5px; /\* Add a small gap between button and menu *\/ */
/*     background-color: #ffffff; */
/*     min-width: 180px; */
/*     box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); */
/*     border-radius: 6px; */
/*     z-index: 1; */
/* } */

/* /\* This class is added by JavaScript to show the menu *\/ */
/* .dropdown-menu.show { */
/*     display: block; */
/* } */

/* .dropdown-item { */
/*     display: block; */
/*     padding: 12px 16px; */
/*     color: black; */
/*     cursor: pointer; */
/*     transition: background-color 0.2s; */
/*     user-select: none; /\* Prevents text from being highlighted on click *\/ */
/* } */

/* /\* This adds a bit of space between the checkbox and the tool name *\/ */
/* .dropdown-item input[type="checkbox"] { */
/*     margin-right: 10px; */
/*     vertical-align: middle; */
/* } */

/* /\* Change color of links on hover *\/ */
/* .dropdown-item:hover { */
/*     background-color: #f1f1f1; */
/* } */

/* /\* Keep rounded corners consistent *\/ */
/* .dropdown-item:first-child { */
/*     border-top-left-radius: 6px; */
/*     border-top-right-radius: 6px; */
/* } */

/* .dropdown-item:last-child { */
/*     border-bottom-left-radius: 6px; */
/*     border-bottom-right-radius: 6px; */
/* } */

/* --- Styles for Side-by-Side Instructor Controls --- */

/* New container for the instructor controls */
.instructor-controls-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem; /* Space below this line of controls */
	flex-direction: row-reverse;
    /* align-items: flex-start; /\* Aligns items to the top *\/ */
}

/* Make the permissions container take up available space */
.permissions-container {
    position: relative; /* Stays the same */
    flex-grow: 1; /* Allows it to stretch */
	justify-content: center;
	align-content: center;
}

/* The permissions menu now needs to be positioned absolutely */
.permissions-menu {
    display: none;
    position: absolute; /* This is the key change */
    width: 100%;      /* Make it the same width as the button */
    z-index: 10;      /* Ensure it appears on top */
    background-color: #2a2a3c;
    border: 1px solid #4a5568;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 1rem;
}

/* New style for the side-by-side view toggle button */
.view-toggle-btn-side {
    padding: 0.75rem 1rem; /* Match height of permissions button */
    font-size: 0.9em;
    border: 1px solid #a0aec0;
    cursor: pointer;
    border-radius: 6px;
    background-color: transparent;
    color: #a0aec0;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap; /* Prevents text from wrapping */
    flex-shrink: 0; /* Don't allow this button to shrink */
}

.view-toggle-btn-side:hover {
    background-color: #3b3b52;
    color: white;
}

/* --- Styles for the new Code Bubble --- */
.code-bubble-wrapper {
    display: flex;
    flex-direction: column;
    margin-left: 60px; /* Aligns with the indented text bubbles */
    margin-top: 10px;
    margin-bottom: 10px;
    max-width: 80%;
}

.code-bubble {
    background-color: #1e1e2e; /* Dark background for code */
    border: 1px solid #4a5568;
    border-radius: 8px;
    overflow: hidden; /* Ensures the corners are rounded */
    font-family: 'Courier New', Courier, monospace; /* Monospaced font */
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2d3748;
    padding: 5px 10px;
    color: #a0aec0;
    font-size: 0.85em;
    font-family: sans-serif; /* Use a regular font for the header */
}

.copy-code-btn {
    background: transparent;
    border: 1px solid #a0aec0;
    color: #a0aec0;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.2s, color 0.2s;
}

.copy-code-btn:hover {
    background-color: #4a5568;
    color: white;
}

.code-content {
    padding: 15px;
    white-space: pre-wrap; /* Preserves whitespace and wraps long lines */
    word-wrap: break-word;
    color: #e0e0e0;
    max-height: 400px; /* Prevents very long code blocks from taking over */
    overflow-y: auto; /* Adds a scrollbar if the code is too long */
}

/*
  REPLACE all previous CSS for .study-plan-centered and its media queries
  with this entire block to fix the positioning.
*/
.study-plan-centered {
    position: fixed;
    top: 60px;
    left: 62%;

    /* This is the key: It ONLY affects horizontal centering */
    transform: translateX(-50%);

    width: 60vw;
    max-width: 800px;
    height: calc(100vh - 80px); /* Leaves a 20px margin at the bottom */
    max-height: 850px;
    z-index: 1000;
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* --- Responsive Adjustments --- */

/* For tablets and smaller devices (screen width 768px or less) */
@media (max-width: 768px) {
  .study-plan-centered {
    width: 85vw;
    top: 40px;
    height: calc(100vh - 60px); /* Leaves a 20px margin at the bottom */
  }
}

/* For mobile phones (screen width 480px or less) */
@media (max-width: 480px) {
  .study-plan-centered {
    width: 95vw;
    top: 15px;
    height: calc(100vh - 30px); /* Leaves a 15px margin at the bottom */
    border-radius: 4px;
  }
}

.external-source-centered {
    position: fixed;
    top: 60px;
    left: 62%;

    /* This is the key: It ONLY affects horizontal centering */
    transform: translateX(-50%);

    width: 60vw;
    max-width: 800px;
    height: calc(100vh - 80px); /* Leaves a 20px margin at the bottom */
    max-height: 850px;
    z-index: 1000;
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* --- Responsive Adjustments --- */

/* For tablets and smaller devices (screen width 768px or less) */
@media (max-width: 768px) {
  .external-source-centered {
    width: 85vw;
    top: 40px;
    height: calc(100vh - 60px); /* Leaves a 20px margin at the bottom */
  }
}

/* For mobile phones (screen width 480px or less) */
@media (max-width: 480px) {
  .external-source-centered {
    width: 95vw;
    top: 15px;
    height: calc(100vh - 30px); /* Leaves a 15px margin at the bottom */
    border-radius: 4px;
  }
}


.project-documents-centered {
    position: fixed;
    top: 60px;
    left: 62%;

    /* This is the key: It ONLY affects horizontal centering */
    transform: translateX(-50%);

    width: 60vw;
    max-width: 800px;
    height: calc(100vh - 80px); /* Leaves a 20px margin at the bottom */
    max-height: 850px;
    z-index: 1000;
    background-color: #1e1e2e;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* --- Responsive Adjustments --- */

/* For tablets and smaller devices (screen width 768px or less) */
@media (max-width: 768px) {
  .project-documents-centered {
    width: 85vw;
    top: 40px;
    height: calc(100vh - 60px); /* Leaves a 20px margin at the bottom */
  }
}

/* For mobile phones (screen width 480px or less) */
@media (max-width: 480px) {
  .project-documents-centered {
    width: 95vw;
    top: 15px;
    height: calc(100vh - 30px); /* Leaves a 15px margin at the bottom */
    border-radius: 4px;
  }
}

/* Add a close button to the centered plan */
.study-plan-centered .header-container {
    position: relative;
}
.close-centered-plan-btn {
    position: absolute;
    top: -5px;
    right: 0;
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.close-centered-plan-btn:hover {
    color: white;
}

/* Make content scrollable in centered view */
.study-plan-centered .collapsible-content {
    flex-grow: 1;
    overflow-y: auto;
    /* Custom scrollbar for centered view */
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2a2a3c;
}
.study-plan-centered .collapsible-content::-webkit-scrollbar {
    width: 8px;
}
.study-plan-centered .collapsible-content::-webkit-scrollbar-track {
    background: #2a2a3c;
}
.study-plan-centered .collapsible-content::-webkit-scrollbar-thumb {
    background-color: #4a5568;
    border-radius: 4px;
}

/* --- Study Plan Controls: Tools & Sources --- */
.study-plan-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #4a5568;
}

/* --- Sources Bar --- */
.sources-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #2a2a3c;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid #4a5568;
}
.sources-select-bar {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #a0aec0;
    text-align: left;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.sources-select-bar:hover {
    background-color: #3b3b52;
}
.sources-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
.sources-action-btn:hover {
    background-color: #4a5568;
    color: white;
}
/* Ensure the form doesn't add extra space */
.sources-action-form {
    margin: 0;
    padding: 0;
    line-height: 0;
}

/* Add this to the end of your style.css file */

#task-action-bar {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 24px; /* Indent to align with sub-task content */
}

.action-bar-button {
    /* Style to mimic the 'Select Course' dropdown */
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #2d3748;
    border-radius: 6px;
    background-color: #2a2a3c;
    color: #a0aec0; /* A muted text color */
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-bar-button:hover {
    border-color: #4a5568;
    background-color: #3b3b52;
}

/* REPLACE the entire 'Per-Step Controls Bar' block with this */

/* --- Styles for Per-Step Controls Bar & Content --- */

.step-content-wrapper {
  display: none; /* This is the new collapsible container */
  padding-left: 24px; /* Indent content to align with sub-tasks */
}

/* Show the wrapper when the parent step is expanded */
.current-step.is-expanded > .step-content-wrapper {
  display: block;
}

.step-controls-bar {
  display: flex; /* Always flex now, no longer hidden by default */
  align-items: center;
  gap: 0.5rem;
  padding-top: 8px;
  margin-bottom: 8px;
}

.step-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2a2a3c;
  border: 1px solid #4a5568;
  color: #a0aec0;
  cursor: pointer;
  padding: 6px;
  border-radius: 5px;
  transition: background-color 0.2s, color 0.2s;
}

.step-control-btn:hover {
  background-color: #3b3b52;
  color: white;
}

.step-tools-btn {
  padding: 6px 12px;
  font-size: 0.8em;
}

.step-upload-form {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.step-controls-bar .dropdown-container {
  position: relative;
}

.step-tools-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  background-color: #ffffff;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  border-radius: 6px;
  z-index: 10;
}

.step-tools-menu.show {
  display: block;
}

.task-sources-list {
    display: none;
}

/* Add to your style.css file */
.task-sources-list {
    padding-top: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.attached-source-item {
    background-color: #4a4a6a;
    color: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block; /* Or block if you want them on new lines */
}

/* --- Styles for Expanding and Collapsing Study Plan Steps --- */

/* By default, hide the list of sub-steps within a task */
.nested-steps {
  display: none;
  padding-left: 24px; /* Indent sub-steps */
  margin-top: 0.5rem;
}

/* When the parent .current-step has the .is-expanded class, show its sub-steps */
.current-step.is-expanded > .nested-steps {
  display: block;
}

/* REPLACE any previous styles for the action bar and nested-steps with this block */

/* --- Study Plan Task Expansion --- */

/* By default, hide the list of sub-steps */
.nested-steps {
  display: none;
  padding-left: 24px;
  margin-top: 0.5rem;
}

/* When the parent .current-step is expanded, show its sub-steps */
.current-step.is-expanded > .nested-steps {
  display: block;
}

/* --- Shared Task Action Bar --- */

/* Add this to your main CSS file (e.g., style.css) */

/* Hide the action bar by default */
#task-action-bar {
    display: none;
    padding: 6px 10px 6px 45px; /* Indent to align with step text */
    background-color: #1e1e2e; /* A slightly different background */
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin-top: -1px; /* Overlap border with header */
    gap: 8px; /* Space between buttons */
	justify-content: space-between;
	align-items: center;
}

/* Styling for the buttons inside the action bar */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background-color: #2a2a3c;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
	color: #a0aec0;
	border-color: #a0aec0;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #e9e9e9;
}

/* Make the SVG icons look clean */
.action-btn svg {
    width: 14px;
    height: 14px;
    stroke: #555;
}

/* The button that triggers the dropup */
.add-document-btn {
    padding: 2px 8px;
    font-size: 14px;
    /* border: none; */
    cursor: pointer;
    border-radius: 6px;
    background-color: #2a2a3c;
    /* color: #ddd; */
	color: #a0aec0;
	border-color: #a0aec0;
    /* border-width: 2px; */
    border-style: outset;
    transition: background-color 0.3s, color 0.3s;
    /* background-color: #007bff; */
    /* color: white; */
    /* padding: 12px 20px; */
    /* font-size: 16px; */
    /* border: none; */
    /* border-radius: 6px; */
    /* cursor: pointer; */
    /* transition: background-color 0.3s; */
}

.add-document-btn:hover {
    /* background-color: #0056b3; */
    background: #3b3b52;
    color: white;
}

.new-source-button {
  background-color: var(--body-bg); /* Use your site's theme variable */
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.new-source-button:hover {
  opacity: 0.8;
}

.myql-header {
	display: flex;
	align-items: center;
}

.myql-header-logo {
	display: flex;
	align-items: center;
}

.logo-text {
	display: flex;
	align-items: center;
}

/* .sidebar-toggle-btn { */
/* 	max-height: 2rem; */
/* } */
