/* Sidebar Styles */
.sidebar {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  z-index: 30;
  overflow-y: auto;
  height: calc(100vh - 65px);
  position: fixed;
  width: 85px;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  padding: 0.5rem 0.4rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  top: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
  display: none;
}

/* Expanded state */
.sidebar.expanded {
  width: 245px;
}

/* UPDATED: Toggle button styles with hamburger/cross icon */
.sidebar-toggle {
  color: #444;
  position: absolute;
  top: 0.6rem;
  left: 50%;
  font-size: 18px;
  transform: translateX(-50%);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  z-index: 1000;
}

.sidebar.expanded .sidebar-toggle {
  left: 84%;
  transform: translateX(0);
}

/* UPDATED: Hide hamburger icon when expanded */
.sidebar-toggle .fa-bars {
  display: block;
  font-size: 20px;
}

.sidebar-toggle .fa-xmark {
  display: none;
  font-size: 20px;

}

.sidebar.expanded .sidebar-toggle .fa-bars {
  display: none;
}

.sidebar.expanded .sidebar-toggle .fa-xmark {
  display: block;
}

.sidebar-toggle:hover {
  border-color: #bbb;
}

.sidebar-toggle i {
  font-size: 14px;
  color: #555;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 130px);
  list-style: none;
  padding: 0;
  gap: 5px;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

.menu-item {
  position: relative;
  list-style-type: none;
  width: 90%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.menu-link {
  color: #4a4a4a;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  padding: 8px 2px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  margin-left: 7px;
}

.menu-link:hover {
  color: #0a9aa3;
  background-color: #f8fbfb;
  border: 1px solid #c8d8d9;
  transform: translateX(2px);
}

.menu-link.active {
  color: #0a9aa3;
  background-color: #f8fbfb;
  border: 1px solid #c8d8d9;
  font-weight: 500;
}

/* Highlighted menu items (Quotation and Invoice) */
.menu-link.highlighted {
  color: #0a9aa3;
  background: linear-gradient(135deg, #f0fafa 0%, #e8f8f8 100%);
  border: 1.5px solid #b5e3e5;
  box-shadow: 0 1px 3px rgba(10, 154, 163, 0.1);
}

.menu-link.highlighted .menu-icon {
  color: #0a9aa3;
}

.menu-link.highlighted .menu-text {
  color: #0a9aa3;
  font-weight: 500;
}

.menu-link.highlighted .menu-arrow i {
  color: #0a9aa3;
}

.menu-link.highlighted:hover {
  background: linear-gradient(135deg, #e6f6f6 0%, #ddf4f4 100%);
  border-color: #9ad9db;
  transform: translateX(2px);
}

.menu-icon {
  min-width: 52px;
  text-align: center;
  border-radius: 10px;
  position: relative;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #5a5a5a;
}

.menu-icon>i {
  font-size: 18px;
}

.menu-link:hover .menu-icon,
.menu-link.active .menu-icon,
.menu-link.highlighted .menu-icon {
  color: #0a9aa3;
}

.menu-text {
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  flex: 1;
  font-size: 14px;
}

/* Show text when sidebar is expanded */
.sidebar.expanded .menu-text {
  opacity: 1;
  visibility: visible;
}

.menu-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(65, 65, 65);
}

.menu-arrow>i {
  margin-right: 5px;
}

/* Show arrow when sidebar is expanded */
.sidebar.expanded .menu-arrow {
  opacity: 1;
  visibility: visible;
}

.menu-link.expanded .menu-arrow i {
  transform: rotate(180deg);
}

.menu-link:hover .menu-arrow i,
.menu-link.active .menu-arrow i,
.menu-link.highlighted .menu-arrow i {
  color: #088992;
}

/* Submenu Styles */
.submenu {
  display: none;
  list-style-type: none;
  padding-left: 0px;
  margin-left: 18px;
  margin-top: 6px;
  max-height: 200px;
  background: linear-gradient(135deg, rgba(10, 154, 163, 0.08) 0%, rgba(10, 154, 163, 0.12) 100%);
  border-radius: 6px;
  padding: 8px;
  padding-right: 0px;
  transition: max-height 0.3s ease, padding 0.3s ease;
  border-left: 2px solid rgba(10, 154, 163, 0.3);
}

.submenu.open {
  display: block;
}

.submenu-link {
  display: block;
  padding: 9px 12px;
  color: #5a5a5a;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-radius: 5px;
  margin-bottom: 2px;
}

.submenu-link:hover {
  color: #0a9aa3;
  background-color: rgba(255, 255, 255, 0.6);
  transform: translateX(3px);
  padding-left: 15px;
}

.submenu-link.active {
  color: #0a9aa3;
  background-color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  border-left: 2px solid #0a9aa3;
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

@media (max-width: 768px) {
  .sidebar {
    opacity: 0;
    position: fixed;
    /* max-height: 86%; */
    /* height: 100vh; */
    height: calc(100vh - 0px);

    width: 240px;
    left: -240px;
    /* top: 110px; */
    z-index: 999;
    overflow-y: hidden;
    padding: 0px;
    margin: 0px;
    transform: none;
  }

  .sidebar.mobile-open {
    opacity: 1;
    left: 0;
    width: 240px;
    transform: none;
  }

  .sidebar.mobile-open .menu-text,
  .sidebar.mobile-open .menu-arrow {
    opacity: 1;
    visibility: visible;
  }

  .sidebar-menu {
    margin-top: 15px;
    /* height: 100%; */
    max-height: calc(100vh - 10px);

    overflow-y: auto;
    padding-bottom: 10px;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .sidebar-toggle {
    display: none;
  }
}

/* Main Content adjustment */
.main-content {
  margin-top: 20px;
  border-radius: 5px;
  position: relative;
  top: 50px;
  left: 80px;
  width: calc(100% - 80px);
  transition: all 0.5s ease;
  text-overflow: none;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* border: 5px solid black; */
}

.sidebar.expanded~.main-content {
  left: 260px;
  width: calc(100% - 260px);
}

@media (max-width:768px) {
  .main-content{
    left: 0px;
    width: calc(100% - 0px);
  }
}
/* #history-main {} */
#footer-placeholder {
  border-radius: 5px;
  position: absolute;
  /* top: 60px; */
  left: 85px;
  /* bottom: 0px; */
 /* height:100vh ; */
  width: calc(100% - 85px);
  transition: all 0.5s ease;
  text-overflow: none;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content:flex-end;
    /* border: 5px solid black; */

}

.sidebar.expanded~#footer-placeholder {
  left: 260px;
  width: calc(100% - 260px);
}

@media (max-width: 768px) {
  #footer-placeholder {
    top: 90px;
    left: 0px;
    width: calc(100% - 0px);
    border-radius: 5px;
  position: relative;
  /* top: 60px; */
  /* left: 85px; */
  /* bottom: 0px; */
  /* height: 100vh; */
  /* width: calc(100% - 85px); */
  transition: all 0.5s ease;
  text-overflow: none;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content:flex-end;
  }
}

/* Tooltip outside sidebar */
.global-tooltip {
  position: fixed;
  margin-top: -15px;
  background: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 20000;
  
}
/* Active parent menu */
.menu-link.active {
  color: #0a9aa3;
  background-color: #f8fbfb;
  border: 1px solid #c8d8d9;
  font-weight: 500;
}

/* Active submenu item */
.submenu-link.active {
  color: #0a9aa3;
  background-color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  border-left: 3px solid #0a9aa3;
}

/* Rotate arrow when submenu expanded */
.menu-link.expanded .menu-arrow i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}
.menu-arrow i {
  transition: transform 0.3s ease;
}
