/* ====== Left Menu Styles ====== */

/* ====== Sidebar ====== */
#sidebar {
  width: 90px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #ffffff;
  overflow-y: auto;
  z-index: 10000;
  /* above menu-overlay (9999) so it’s visible */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* Sidebar for mobile */
@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-100%);
    /* hidden by default on mobile */
    left: 0;
  }

  /* show sidebar when JS adds .show (LeftMenuModule) */
  #sidebar.show {
    transform: translateX(0);
  }

  /* keep .active as alias, in case any old code uses it */
  #sidebar.active {
    transform: translateX(0);
  }

  .search-sidebar {
    left: 0;
  }

  .top-menu-bar {
    top: 40px;
  }

  .small-logo, .main-logo {
    display: none;
  }

  .sidebar-toggle-btn {
    margin-top: 60px;
  }

  .warning-box-header {
    margin-bottom: 4px;
  }

}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
  position: relative;
}

.sidebar-logo .small-logo {
  max-width: 35px;
  margin-bottom: 10px;
}

.sidebar-logo .main-logo {
  max-width: 80px;
  margin-bottom: 10px;
}

.nav-link {
  color: #333333;
  padding: 10px 5px;
  margin: 5px 0;
  border-radius: 0;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#sidebar .nav {
  flex: 1 1 auto;
}

.sidebar-lang {
  margin-top: auto;
  padding: 15px 0;
}

.menu-text {
  font-size: 10px;
  margin-top: 3px;
  line-height: 1.1;
}

.nav-link:hover, .nav-link.active {
  color: #1a9a9a;
  background-color: rgba(26, 154, 154, 0.1);
  border-left: 4px solid #ff7b00;
  text-decoration: none;
  font-weight: 500;
}

.menu-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  color: white;
  font-size: 14px;
}

.menu-icon i {
  color: white;
}

.red-circle {
  background-color: #ff3b30;
}

.blue-circle {
  background-color: #007aff;
}

.orange-circle {
  background-color: #ff9500;
}

.purple-circle {
  background-color: #af52de;
}

/* ====== Sidebar Toggle ====== */
.sidebar-toggle-btn {
  background: #fff;
  color: #656565;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1.2rem;
  transition: background 0.2s, transform 0.3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Toggle button position for desktop */
@media (min-width: 992px) {
  .sidebar-logo {
    justify-content: center;
  }
}

/* Toggle button position for mobile */
@media (max-width: 991.98px) {
  .sidebar-logo {
    justify-content: flex-start;
  }
}

.sidebar-toggle-btn:active,
.sidebar-toggle-btn:focus {
  background: #148080;
  outline: none;
}

/* Menu Background Overlay */
.menu-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.menu-bg-overlay.show {
  display: block;
  opacity: 1;
}

/* ===== Mobile Header (logo + sidebar toggle) ===== */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* z-index: 10001; */
  z-index: 199;
}

.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-header-logo {
  height: 32px;
  width: auto;
}

.mobile-header-title {
  font-size: 14px;
  font-weight: 500;
}

.mobile-sidebar-toggle-btn {
  background: #fff;
  border: none;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #656565;
}

@media (max-width: 991.98px) {
  .mobile-header {
    display: flex;
  }
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 9999;
  display: none;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

.menu-overlay.show {
  display: flex;
  transform: translateX(0);
  z-index: 99999;
}

@media (min-width: 768px) {
  .menu-overlay {
    width: 20%;
    min-width: 280px;
    transform: translateX(-100%);
  }

  .menu-overlay.show {
    transform: translateX(0);
  }
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #1a9a9a;
  color: white;
}

.menu-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overlay-logo {
  width: 30px;
  height: 30px;
}

.overlay-title {
  /* font-size: 14px; */
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  color: white;
}

.menu-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

.menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 15px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s;
}

.menu-item:hover {
  background-color: #e9ecef;
}

.menu-item i {
  margin-right: 15px;
  width: 24px;
  text-align: center;
  font-size: 18px;
}

.menu-footer {
  padding: 15px;
  border-top: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-footer-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 13px;
}

.menu-footer-link:hover {
  color: #1a9a9a;
  text-decoration: underline;
}

/* ===== Dark Mode Styles ===== */
[data-bs-theme="dark"] #sidebar {
  background-color: #0C1427;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .sidebar-logo {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .nav-link {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active {
  color: #63b3ed;
  background-color: rgba(99, 179, 237, 0.1);
  border-left-color: #63b3ed;
}

/* Menu Overlay Dark Mode */
[data-bs-theme="dark"] .menu-overlay {
  background-color: #0C1427;
}

[data-bs-theme="dark"] .menu-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .overlay-title {
  color: #fff;
}

[data-bs-theme="dark"] .menu-close-btn {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .menu-close-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .menu-item {
  color: #e2e8f0;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #63b3ed;
}

[data-bs-theme="dark"] .menu-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .menu-footer-link {
  color: #a0aec0;
}

[data-bs-theme="dark"] .menu-footer-link:hover {
  color: #63b3ed;
}

/* Menu Background Overlay */
[data-bs-theme="dark"] .menu-bg-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

[data-bs-theme="dark"] .sidebar-toggle-btn {
  background-color: #0C1427;
  border-color: #8695AA;
  color: #8695AA;
}

[data-bs-theme="dark"] .sidebar-toggle-btn:hover {
  background-color: #8695AA;
  border-color: #8695AA;
  color: #fff;
}

/* Adjust main content when sidebar is open on mobile */
@media (max-width: 991.98px) {
  #main-content {
    margin-left: 0 !important;
  }
}