body {
  font-size: 1.075rem;
}

td {
  border-style: none;
}

.bd-placeholder-img {
  font-size: 1.125rem;
  text-anchor: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

body, html {
  height: 100%;
  margin: 0;
}

.gradient-dots {
  /* Gradient background */
  background: 
    /* radial-gradient(#0b4872 1px, transparent 0), /* light dots */
    linear-gradient(135deg, #02102a, #061a36 80%);     /* main gradient */
  /*
  background-size: 20px 20px, 100% 100%; /* dot spacing and gradient stretch */
  /* background-repeat: repeat, no-repeat; */
  
}

@media (min-width: 768px) {
  .bd-placeholder-img-lg {
    font-size: 3.5rem;
  }
}

.feather {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

/*
 * Sidebar
 */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  background: linear-gradient(135deg, #02102a, #061a36 80%);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  z-index: 100;
  padding-top: 10px;
  padding-bottom: 80px;
  word-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 767.98px) {
  /* Mobile body padding for fixed navbar */
  body {
    padding-top: 0 !important; /* Remove global padding, use Bootstrap approach */
  }
  
  /* Main content area adjustment for fixed navbar */
  #contentMain {
    margin-top: 60px; /* Space for fixed navbar */
    padding-top: 15px;
  }
  
  /* Mobile navbar styling */
  .navbar.fixed-top {
    height: 60px;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #02102a, #061a36 80%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Ensure navbar-toggler is visible */
  .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.5rem;
  }
  
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }
  
  /* Sidebar mobile adjustments */
  .sidebar {
    position: relative;
    top: 0;
    left: 0;
    height: auto;
    min-height: auto;
    z-index: 1;
    width: 100%;
    margin-top: 0;
    border-top: none;
    background: linear-gradient(135deg, #02102a, #061a36 80%);
  }
  
  .sidebar .position-sticky {
    padding-top: 0 !important;
  }
  
  .sidebar hr {
    margin: 5px 10px 12px 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  /* Hide sidebar by default on mobile, show when collapsed */
  .sidebar:not(.show) {
    display: none;
  }
  
  .sidebar.show {
    display: block;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 1020;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  }
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: 100vh; /* Changed from calc(100vh - 48px) to full height */
  overflow-x: hidden;
  overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
}

.sidebar .nav-link {
  font-weight: 600;
  font-size: 1.05rem;
  color: #f0f0f0;
  margin: 6px 0px 6px 0px;
  padding: 9px 12px;
  border: none;
  border-radius: 32px;
  background: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  box-shadow: none;
  letter-spacing: 0.01em;
}

.sidebar .nav-link.active {
  color: #fff;
  background: #003FC7;
  border-radius: 32px;
  font-weight: 700;
  box-shadow: none;
  border: none;
  transform: none;
}

.sidebar .nav-link:hover {
  background-color: rgba(0, 63, 199, 0.10);
  color: #fff;
  transform: none;
}

.sidebar .nav-link .feather {
  margin-right: 10px;
  color: #fff;
  transition: all 0.3s ease;
  width: 20px;
  height: 20px;
}

/* Remove old border and box-shadow for nav-link */
.sidebar .nav-link,
.sidebar .nav-link.active {
  border: none !important;
  box-shadow: none !important;
}

/* Responsive font size for main menu */
@media (max-width: 1199.98px) {
  .sidebar .nav-link {
    font-size: 1.05rem;
    padding: 9px 10px;
  }
}
@media (max-width: 991.98px) {
  .sidebar .nav-link {
    font-size: 0.98rem;
    padding: 8px 8px;
    margin: 5px 0;
  }
}

.sidebar .subitem {
  font-size: 0.95rem;
  margin: 2px 0px 2px 0px;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 10px 12px 10px 28px;
  margin-right: 6px;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  font-weight: 400;
  border-radius: 0 6px 6px 0;
  transition: all 0.3s ease;
  position: relative;
}

.sidebar .subitem a {
  color: #e0e0e0;
  text-decoration: none;
  display: block;
  transition: color 0.3s ease;
}

.sidebar .subitem:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-left-color: rgba(255, 255, 255, 0.4);
  transform: translateX(4px);
}

.sidebar .subitem:hover a {
  color: #ffffff;
}

.sidebar .subitem.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-left-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar .subitem.active a {
  color: #ffffff;
  font-weight: 500;
}

.menuPoint {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  color: #000000;
  border: 1px solid rgba(235, 235, 235, 0.918);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Enhanced submenu container styling */
.sidebar .nav-item .nav.flex-column {
  margin-top: 8px;
  margin-bottom: 8px;
  padding-left: 4px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  margin-left: 4px;
  position: relative;
}

.sidebar .nav-item .nav.flex-column::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  border-radius: 1px;
}

/* Active parent menu item styling */
.sidebar .nav-item.active > .nav-link {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Active parent menu item with submenu */
.sidebar .nav-item.active > .nav-link::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid rgba(255, 255, 255, 0.8);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

/* Smooth transitions for all interactive elements */
.sidebar * {
  transition: all 0.3s ease;
}

/* Enhanced focus states for accessibility */
.sidebar .nav-link:focus,
.sidebar .subitem a:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Subtle animation for submenu appearance */
.sidebar .nav-item .nav.flex-column {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-heading {
  font-size: .75rem;
  text-transform: uppercase;
}

/*
 * Navbar
 */

.navbar-brand {
  padding-top: 1px;
  padding-bottom: 3px;
  font-size: 1rem;
  text-align: center;
}

.navbar .navbar-toggler {
  top: .25rem;
  right: 1rem;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar .form-control {
  padding: .75rem 1rem;
  border-width: 0;
  border-radius: 0;
}

.form-control-dark {
  color: #fff;
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

.accordion-button {
  background-color: #EFEFEF;
  margin-bottom: 2px;
}

/* ------------------------------------------------------------ */
/* *******************************
message-area
******************************** */

.message-area {
  height: 100vh;
  overflow: hidden;
  padding: 30px 0;
  background: #f5f5f5;
}

.chat-area {
  position: relative;
  width: 100%;
  background-color: #fff;
  border-radius: 0.3rem;
  height: 90vh;
  overflow: hidden;
  min-height: calc(100% - 1rem);
}

.chatlist {
  outline: 0;
  height: 100%;
  overflow: hidden;
  width: 300px;
  float: left;
  padding: 15px;
}

.chat-area .modal-content {
  border: none;
  border-radius: 0;
  outline: 0;
  height: 100%;
}

.chat-area .modal-dialog-scrollable {
  height: 100% !important;
}

.chatbox {
  width: auto;
  overflow: hidden;
  height: 100%;
}

.chatbox .modal-dialog,
.chatlist .modal-dialog {
  max-width: 100%;
  margin: 0;
}

.msg-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-area .form-control {
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
  color: #222;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ccc;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0.25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.chat-area .form-control:focus {
  outline: 0;
  box-shadow: inherit;
}

a.add img {
  height: 36px;
}

.chat-area .nav-tabs {
  border-bottom: 1px solid #dee2e6;
  align-items: center;
  justify-content: space-between;
  flex-wrap: inherit;
}

.chat-area .nav-tabs .nav-item {
  width: 100%;
}

.chat-area .nav-tabs .nav-link {
  width: 100%;
  color: #180660;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
  text-transform: capitalize;
  margin-top: 5px;
  margin-bottom: -1px;
  background: 0 0;
  border: 1px solid transparent;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
}

.chat-area .nav-tabs .nav-item.show .nav-link,
.chat-area .nav-tabs .nav-link.active {
  color: #222;
  background-color: #fff;
  border-color: transparent transparent #000;
}

.chat-area .nav-tabs .nav-link:focus,
.chat-area .nav-tabs .nav-link:hover {
  border-color: transparent transparent #000;
  isolation: isolate;
}

.chat-list h3 {
  color: #222;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: capitalize;
  margin-bottom: 0;
}

.chat-list p {
  color: #343434;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: capitalize;
  margin-bottom: 0;
}

.chat-list a.d-flex {
  margin-bottom: 15px;
  position: relative;
  text-decoration: none;
}

.chat-list .active {
  display: block;
  content: '';
  clear: both;
  position: absolute;
  bottom: 3px;
  left: 34px;
  height: 12px;
  width: 12px;
  background: #00DB75;
  border-radius: 50%;
  border: 2px solid #fff;
}

.msg-head h3 {
  color: #222;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0;
}

.msg-head p {
  color: #343434;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
  text-transform: capitalize;
  margin-bottom: 0;
}

.msg-head {
  padding-left: 15px;
  /* border-bottom: 1px solid #ccc; */
}

.moreoption {
  display: flex;
  align-items: center;
  justify-content: end;
}

.moreoption .navbar {
  padding: 0;
}

.moreoption li .nav-link {
  color: #222;
  font-size: 16px;
}

.moreoption .dropdown-toggle::after {
  display: none;
}

.moreoption .dropdown-menu[data-bs-popper] {
  top: 100%;
  left: auto;
  right: 0;
  margin-top: 0.125rem;
}

.msg-body ul {
  overflow: hidden;
  padding-left: 1rem;
}

.msg-body ul li {
  list-style: none;
  margin: 15px 0;
}

.msg-body ul li.sender {
  display: block;
  width: 100%;
  position: relative;
}

.msg-body ul li.sender:before {
  display: block;
  clear: both;
  content: '';
  position: absolute;
  top: -6px;
  left: -7px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 12px 15px 12px;
  border-color: transparent transparent #f5f5f5 transparent;
  -webkit-transform: rotate(-37deg);
  -ms-transform: rotate(-37deg);
  transform: rotate(-37deg);
}

.senderDiv {
  color: #000;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 400;
  padding: 15px;
  background: #f5f5f5;
  display: inline-block;
  border-bottom-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  margin-bottom: 0;
}

.senderDiv div b {
  display: block;
  color: #180660;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 500;
}

.msg-body ul li.replyer {
  display: block;
  width: 100%;
  text-align: right;
  position: relative;
}

.msg-body ul li.replyer:before {
  display: block;
  clear: both;
  content: '';
  position: absolute;
  bottom: 12px;
  right: -7px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 12px 15px 12px;
  border-color: transparent transparent #0b2a59 transparent;
  -webkit-transform: rotate(37deg);
  -ms-transform: rotate(37deg);
  transform: rotate(37deg);
}

.msg-body ul li.replyer p {
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 400;
  padding: 15px;
  background: #0e3570;
  display: inline-block;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 10px;
  margin-bottom: 0;
}

.msg-body ul li.replyer p b {
  display: block;
  color: #061061;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 500;
}

.msg-body ul li.replyer:after {
  display: block;
  content: '';
  clear: both;
}

.time {
  display: block;
  color: #000;
  font-size: 0.8rem;
  line-height: 1.5;
  font-weight: 400;
}

li.replyer .time {
  margin-right: 20px;
}

.divider {
  position: relative;
  z-index: 1;
  text-align: center;
}

.msg-body h6 {
  text-align: center;
  font-weight: normal;
  font-size: 1.2rem;
  line-height: 1.5;
  color: #222;
  background: #fff;
  display: inline-block;
  padding: 0 5px;
  margin-bottom: 0;
}

.divider:after {
  display: block;
  content: '';
  clear: both;
  position: absolute;
  top: 12px;
  left: 0;
  border-top: 1px solid #EBEBEB;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.send-box {
  padding: 15px;
  border-top: 1px solid #ccc;
}

.send-box form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.send-box .form-control {
  display: block;
  width: 85%;
  padding: 0.375rem 0.75rem;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #222;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ccc;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0.25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.send-box button {
  border: none;
  background: #3867d6;
  padding: 0.375rem 5px;
  color: #fff;
  border-radius: 0.25rem;
  font-size: 14px;
  font-weight: 400;
  width: 24%;
  margin-left: 1%;
}

.send-box button i {
  margin-right: 5px;
}

.send-btns .button-wrapper {
  position: relative;
  width: 125px;
  height: auto;
  text-align: left;
  margin: 0 auto;
  display: block;
  background: #F6F7FA;
  border-radius: 3px;
  padding: 5px 15px;
  float: left;
  margin-right: 5px;
  margin-bottom: 5px;
  overflow: hidden;
}

.send-btns .button-wrapper span.label {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  width: 100%;
  cursor: pointer;
  color: #343945;
  font-weight: 400;
  text-transform: capitalize;
  font-size: 13px;
}

#upload {
  display: inline-block;
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.send-btns .attach .form-control {
  display: inline-block;
  width: 120px;
  height: auto;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #343945;
  background-color: #F6F7FA;
  background-clip: padding-box;
  border: 1px solid #F6F7FA;
  border-radius: 3px;
  margin-bottom: 5px;
}

.send-btns .button-wrapper span.label img {
  margin-right: 5px;
}

.button-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  text-align: center;
  margin: 0 auto;
}

button:focus {
  outline: 0;
}

.add-apoint {
  display: inline-block;
  margin-left: 5px;
}

.add-apoint a {
  text-decoration: none;
  background: #F6F7FA;
  border-radius: 8px;
  padding: 8px 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  color: #343945;
}

.add-apoint a svg {
  margin-right: 5px;
}

.chat-icon {
  display: none;
}

.closess i {
  display: none;
}



@media (max-width: 767px) {
  .chat-icon {
      display: block;
      margin-right: 5px;
  }
  .chatlist {
      width: 100%;
  }
  .chatbox {
      width: 100%;
      /*
      position: absolute;
      left: 1000px;
      transition: all 0.5s ease;
      */
      right: 0;
      background: #fff;
  }
  .showbox {
      left: 0 !important;
      transition: all 0.5s ease;
  }
  .msg-head h3 {
      font-size: 14px;
  }
  .msg-head p {
      font-size: 12px;
  }
  .msg-head .flex-shrink-0 img {
      height: 30px;
  }
  .send-box button {
      width: 28%;
  }
  .send-box .form-control {
      width: 70%;
  }
  .chat-list h3 {
      font-size: 14px;
  }
  .chat-list p {
      font-size: 12px;
  }
  .msg-body ul li.sender p {
      font-size: 13px;
      padding: 8px;
      border-bottom-left-radius: 6px;
      border-top-right-radius: 6px;
      border-bottom-right-radius: 6px;
  }
  .msg-body ul li.replyer p {
      font-size: 13px;
      padding: 8px;
      border-top-left-radius: 6px;
      border-top-right-radius: 6px;
      border-bottom-left-radius: 6px;
  }
}

.loader {
  display: inline-block;
  font-size: 24px;
  animation: spin 1s linear infinite;
}

.hidden {
  display: none;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* ------------------------------------------------------------ */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.15s ease-in-out;
}
.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}
.form-check-label {
  font-size: 0.9rem;
}
.btn-group .btn {
  border-radius: 0.375rem;
  margin-right: 0.5rem;
}
.btn-group .btn:last-child {
  margin-right: 0;
}
/* ------------------------------------------------------------ */
.rotating-loader {
  all: initial;
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 5px solid #2196f3;
  border-top: 5px solid #f5f5f5;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  animation: spinWaiting 1s linear infinite;
  box-sizing: border-box;
  margin: 8px auto;
}
@keyframes spinWaiting {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* Responsive menu font sizes for screens below 1200px */
@media (max-width: 1199.98px) {
  .sidebar .nav-link {
    font-size: 1rem;
    padding: 10px 12px;
  }
  
  .sidebar .subitem {
    font-size: 0.9rem;
    padding: 8px 12px 8px 28px;
  }
}

/* Additional responsive adjustment for even smaller screens */
@media (max-width: 991.98px) {
  .sidebar .nav-link {
    font-size: 0.95rem;
    padding: 8px 10px;
    margin: 2px 4px;
  }
  
  .sidebar .subitem {
    font-size: 0.85rem;
    padding: 6px 10px 6px 24px;
    margin-right: 4px;
  }
  
  .sidebar .nav-item .nav.flex-column {
    margin-left: 12px;
  }
}

/* ------------------------------------------------------------ */
/* *******************************
CHAT INTERFACE STYLES
******************************** */

/* Chat Container */
.chat-container {
  height: calc(100vh - 100px);
}

/* Mobile chat container adjustments */
@media (max-width: 767.98px) {
  .chat-container {
    height: calc(100vh - 140px); /* Account for mobile navbar + content padding */
    margin-top: 0;
  }
  
  /* Ensure main content doesn't get clipped */
  .content-main-bg {
    padding-top: 15px;
    margin-top: 0;
  }
  
  /* Mobile chat page header adjustments */
  .chat-page-header {
    margin-bottom: 10px;
    padding: 10px 0;
  }
}

.chatbox {
  background: white; 
  border-radius: 10px; 
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
  overflow: hidden;
  border: 1px solid #BFBFBF;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Chat Header */
.chat-header {
  padding: 16px 20px; 
  border-bottom: 1px solid #e9ecef; 
  background: linear-gradient(-135deg, #051937 0%, #003d73 100%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.chat-header .prompt-select {
  flex: 1; 
  max-width: 400px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  font-weight: 500;
}

.chat-header .ai-icon {
  font-size: 1.2rem;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1; 
  padding: 20px; 
  overflow-y: auto; 
  background: #f8f9fa;
  min-height: 0;
}

.messages-container ul {
  list-style: none; 
  padding: 0; 
  margin: 0;
}

/* Message Items */
.message-item {
  margin-bottom: 16px;
  display: flex;
}

.message-item.user-message {
  justify-content: flex-end;
}

.message-item.ai-message {
  justify-content: flex-start;
}

/* Message Bubbles */
.message-bubble {
  padding: 12px 16px;
  position: relative;
  max-width: 80%;
  overflow-x: auto;
}

.message-bubble.user-bubble {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.message-bubble.ai-bubble {
  background: white;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.message-bubble p {
  margin: 0; 
  font-size: 0.95rem; 
  line-height: 1.4;
}

.message-bubble .message-content {
  font-size: 0.95rem; 
  line-height: 1.5;
  color: #333;
}

/* Message Time */
.message-time {
  font-size: 0.75rem; 
  display: block; 
  text-align: right;
}

.message-time.user-time {
  opacity: 0.8;
}

.message-time.ai-time {
  color: #6c757d;
}

.ai-details {
  margin-top: 8px;
  gap: 8px;
}

.ai-details.ai-time {
  color: #6c757d;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
}

.ai-details.ai-time .ai-service {
  color: #007bff;
  font-weight: 500;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
}

.ai-details.ai-time .ai-model {
  color: #28a745;
  font-weight: 500;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
}

/* AI Avatar */
.ai-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #051937, #003d73);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.ai-avatar i {
  font-size: 0.9rem;
}

/* Message Content Container */
.message-content {
  flex: 1; 
  max-width: calc(100% - 12px);
}

/* System Messages */
.system-message {
  font-size: 0.7em; 
  color: #6c757d; 
  display: block; 
  margin-bottom: 4px;
  max-width: 70%;
}

/* File Attachment Header */
.file-attachment-header {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  opacity: 0.9;
  cursor: pointer;
  padding: 4px 6px;
  transition: all 0.2s ease;
}

.file-attachment-header:hover {
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
}

.file-attachment-header .paperclip-icon {
  font-size: 0.75rem;
}

.file-attachment-header .chevron-icon {
  font-size: 0.6rem; 
  margin-left: auto;
}

/* Message Files Container */
.message-files {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

.file-item {
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: rgba(255,255,255,0.15);
}

/* Chat Input Container */
.chat-input-container {
  background: white;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
  position: relative;
  width: 100%;
}

/* File Preview Container */
.file-preview-container {
  display: none;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  padding: 12px;
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  max-height: 300px;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.close-files-btn {
  padding: 4px 8px;
  border-radius: 6px;
}

/* File Preview Grid */
.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
}

/* File Preview Card */
.file-preview-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  overflow: hidden;
}

.file-preview-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

/* File Preview Section */
.file-preview-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.file-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.file-preview-icon {
  font-size: 2rem;
}

.file-preview-icon.pdf {
  color: #dc3545;
}

.file-preview-icon.word {
  color: #007bff;
}

.file-preview-icon.audio {
  color: #28a745;
}

.file-preview-icon.video {
  color: #fd7e14;
}

.file-preview-icon.text {
  color: #17a2b8;
}

.file-preview-icon.default {
  color: #6c757d;
}

/* File Remove Button */
.file-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-remove-btn:hover {
  background: #dc3545;
}

/* File Info */
.file-info {
  text-align: center;
  font-size: 0.8rem;
}

.file-name {
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
  word-break: break-word;
}

.file-size {
  color: #6c757d;
  font-size: 0.75rem;
}

/* Input Controls Wrapper */
.input-controls-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f8f9fa;
  border-radius: 20px;
  padding: 6px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease;
}

.input-controls-wrapper:focus-within {
  border-color: #007bff;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1px;
}

.attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.attach-btn:hover {
  background: #e9ecef;
}

.speak-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.speak-btn:hover {
  background: #e9ecef;
}

/* Message Input Wrapper */
.message-input-wrapper {
  flex: 1;
}

.message-input {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 8px 12px;
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.4;
  outline: none;
  resize: none;
}

/* Send Button */
.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #007bff, #0056b3);
  box-shadow: 0 2px 4px rgba(0,123,255,0.3);
  transition: all 0.2s ease;
}

.send-btn:hover {
  transform: scale(1.05);
}

/* Generated File Display */
.generated-file-container {
  margin: 8px 0;
}

.generated-image {
  max-width: 500px; 
  border-radius: 8px; 
  margin-bottom: 8px;
}

.generated-video {
  max-width: 500px; 
  border-radius: 8px;
}

.generated-file-link {
  color: #6c757d; 
  font-size: 0.7rem;
}

/* Content Main Background */
.content-main-bg {
  background-color: #f8f9fa;
}

/* Hidden Class */
.hidden {
  display: none;
}

/* ------------------------------------------------------------ */

/* AI Model Dropdown Styles */
.message-item, .message-content, .message-bubble { 
  overflow: visible !important; 
}

.dropdown-menu { 
  z-index: 1060 !important; 
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

#chatHistory { 
  overflow: visible; 
}

.ai-message .message-content { 
  position: relative; 
  overflow: visible; 
}

/* Responsive dropdown improvements */
.js-again-menu {
  font-size: 0.875rem;
}

.js-again-menu .dropdown-item {
  transition: background-color 0.15s ease-in-out;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.js-again-menu .dropdown-item:last-child {
  border-bottom: none;
}

.js-again-menu .dropdown-item:hover {
  background-color: #f8f9fa;
}

.js-again-menu .dropdown-item:active {
  background-color: #e9ecef;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
  .js-again-menu {
    min-width: 200px !important;
    max-width: 280px !important;
    margin-right: 10px !important;
  }
  
  .js-again-menu .dropdown-item {
    padding: 0.75rem 1rem;
  }
  
  /* Force inline layout for AI meta on mobile */
  .js-ai-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }
  
  .js-ai-meta .ai-meta-logo-wrapper {
    flex-shrink: 0 !important;
    display: inline-flex !important;
  }
  
  .js-ai-meta .js-ai-meta-text {
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Make footer logos smaller on mobile */
  .ai-meta-logo-wrapper img {
    width: 10px !important;
    height: 10px !important;
  }
  
  /* Avatar logos responsive */
  .ai-avatar .ai-logo {
    width: 14px !important;
    height: 14px !important;
  }
}

/* AI service name highlighting */
.js-ai-meta-text {
  font-weight: 500; /* Bootstrap's fw-medium equivalent */
}

/* Subtle highlight for AI service name in meta text */
.js-ai-meta-text strong,
.js-ai-meta-text .fw-semibold {
  color: var(--bs-primary);
  font-weight: 600; /* Bootstrap's fw-semibold */
}

/* Touch device improvements */
@media (pointer: coarse) {
  .js-again-menu .dropdown-item {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
}

/* Custom scrollbar for dropdown */
.js-again-menu::-webkit-scrollbar {
  width: 6px;
}

.js-again-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.js-again-menu::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.js-again-menu::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ------------------------------------------------------------ */

/* Responsive message bubble widths */
@media (max-width: 767.98px) {
  .message-bubble {
    max-width: 90%;
  }
}

@media (max-width: 575.98px) {
  .message-bubble {
    max-width: 95%;
  }
}

/* Mobile toggle button styling */
.sidebar .btn-link {
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 0.25rem 0.5rem;
}

.sidebar .btn-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar .navbar-brand {
  color: #ffffff;
  text-decoration: none;
}

.sidebar .navbar-brand:hover {
  color: #ffffff;
  opacity: 0.8;
}

/* Logout Section Styling - ChatGPT Style */
.logout-section {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 16px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, #02102a, #061a36 80%);
  box-sizing: border-box;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007bff, #0056b3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.user-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-email {
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.logout-btn {
  background: transparent;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.logout-btn .feather {
  width: 18px;
  height: 18px;
}

/* Logout Modal Styling */
.logout-modal {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.logout-modal .modal-body {
  padding: 2rem;
}

.logout-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  background: linear-gradient(135deg, #dc3545, #c82333);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-icon .feather {
  width: 24px;
  height: 24px;
  color: white;
}

.logout-modal h5 {
  font-weight: 600;
  color: #333;
}

.logout-modal .text-muted {
  color: #6c757d !important;
  font-size: 0.95rem;
}

.logout-modal .btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
}

.logout-modal .btn-secondary {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}

.logout-modal .btn-secondary:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  color: #495057;
}

.logout-modal .btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  border: none;
}

.logout-modal .btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #a02622);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------ */
/* *******************************
SYNTAX HIGHLIGHTING STYLES
******************************** */

/* Custom styles for syntax highlighting in chat */
.ai-bubble .hljs {
    background: #f6f8fa !important;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    margin: 8px 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.45;
    overflow-x: auto;
}

.ai-bubble .hljs code {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.ai-bubble pre {
    margin: 8px 0;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
}

.ai-bubble pre code {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.45;
}

/* Dark theme support for code blocks 
@media (prefers-color-scheme: dark) {
    .ai-bubble .hljs {
        background: #2d3748 !important;
        border-color: #4a5568;
    }
    
    .ai-bubble pre {
        background: #2d3748;
        border-color: #4a5568;
    }
}
*/

/* Chat Page Header (above chatbox) */
.chat-page-header {
  margin: 5px 0px 5px 0px;
  background: #f8f9fa;
  padding: 0px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Custom Prompt Dropdown Styles */
.custom-prompt-dropdown .dropdown-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 320px;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid #BFBFBF;
  font-size: 1.05rem;
  padding: 10px 16px;
  position: relative;
  padding-right: 36px; /* Make space for the arrow */
}
.custom-prompt-dropdown .dropdown-toggle::after {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
}

.custom-prompt-dropdown .dropdown-main {
  font-weight: 600;
  color: #222;
  font-size: 1.08rem;
  line-height: 1.2;
}
.custom-prompt-dropdown .dropdown-desc {
  font-size: 0.93rem;
  color: #888;
  line-height: 1.1;
  margin-top: 2px;
}
.custom-prompt-dropdown .dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 8px 16px;
}

/* Two-line dropdown styles */
.prompt-select {
/*  max-width: 420px; */
  background: #f0f1f5;
  border-radius: 8px;
  font-size: 1.05rem;
  padding: 10px 16px;
  min-height: 48px;
  line-height: 1.2;
  color: #222;
  font-weight: 500;
}
.prompt-select option {
  white-space: pre-line;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 1.01rem;
  color: #222;
  background: #f5f6fa;
  border-bottom: 1px solid #e0e0e0;
}
  /* Chat History Loading Buttons Styling */
.load-history-btn {
    transition: all 0.3s ease;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 500;
}

.load-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.load-history-btn .badge {
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 12px;
}

.hide-history-btn {
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hide-history-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

#chatHistoryButtons {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 20px;
    border: 1px solid #dee2e6;
}

/* Loading spinner styling */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Error alert styling */
.alert {
    border-radius: 8px;
    border: none;
}
