:root {
  --app-bg-color: #f8f9fa;
  --app-text-color: #1c1c1c;
  --app-green-color: #1aab4b;
  --app-red-color: #e93827;
  --app-blue-color: #168dcf;
  --app-bg-white-color: #ffffff;
  --app-transition: all 0.3s ease-in-out;
}

html,
body {
  scroll-behavior: smooth;
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 14px;
}

.common-iframe {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  position: inherit;
  border-width: initial;
  border-style: none;
  border-color: initial;
  border-image: initial;
  background: transparent;
}

/* --- Sidebar Styling --- */
.sidebar {
  width: 320px;
  min-width: 320px; /* Ensure sidebar doesn't shrink */
  height: 100vh;
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
  z-index: 1030; /* Higher than header/footer */
  transform: translateX(-100%); /* Hides the sidebar on small screens */
  overflow-y: auto; /* Allow the sidebar to scroll if content exceeds its height */
}

/* Show sidebar on large screens (lg) and up */
@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0); /* Make it visible on desktop */
  }
}

/* Class to show sidebar on mobile when hamburger is clicked */
.sidebar.show-mobile {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 71px;
  background-color: var(--app-blue-color);
  color: var(--app-bg-white-color);
}

.btn-close-sidebar {
  background: #c8ebff;
  border: none;
  font-size: 1rem;
  line-height: 1;
  padding: 8px;
  color: #3e3e3e;
  cursor: pointer;
  transition: color 0.2s ease;
  border-radius: 50px;
}

.btn-close-sidebar:hover {
  background-color: #fff;
}

/* --- Main Content Styling --- */
.main-content-wrapper {
  flex-grow: 1; /* Take up all available horizontal space */
  position: relative;
  margin-left: 0; /* Default margin for mobile */
  transition: margin-left 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Hide horizontal scrollbar */
  height: 100vh;
}

/* Adjust margin for main content on desktop to make space for the sidebar */
@media (min-width: 992px) {
  .main-content-wrapper {
    margin-left: 320px;
  }
}

/* --- Fixed Header/Sub-header/Footer Styling --- */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem;
  background-color: #ffffff;
}

.fixed-header div.align-items-center {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixed-header a {
  white-space: nowrap;
}

.fixed-subheader {
  position: fixed;
  top: 71px; /* Adjust based on header height */
  left: 0;
  right: 0;
  z-index: 999;
  padding: 0.5rem 1rem;
  background-color: var(--app-blue-color);
  color: #fff;
  gap: 20px;
}

.fixed-tabmenu {
  position: fixed;
  top: 107px;
  left: 0;
  right: 0;
  z-index: 1001;
  background-color: #ffffff;
}

.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1010;
  padding: 1rem;
  background-color: #ffffff;
}

/* --- Hamburger button visibility --- */
/* It is visible on screens smaller than lg and hidden on lg and up */
#sidebar-toggle {
  display: block;
}
@media (min-width: 992px) {
  #sidebar-toggle {
    display: none;
  }
}

/* --- Scrollable Content Styling --- */
.scrollable-content {
  /* Now uses flex-grow to fill remaining vertical space */
  display: flex;
  flex-grow: 1;
  overflow-y: auto; /* Enable vertical scrolling for this section only */
  background-color: #f8f9fa;
}

@media (min-width: 992px) {
  .fixed-header,
  .fixed-subheader,
  .fixed-footer,
  .fixed-tabmenu {
    left: 320px; /* Adjust position on desktop to make space for sidebar */
  }
}

/* Tab Menu Styling */
.menu {
  width: 100%;
}
.menu ul {
  margin: 0;
  padding: 0;
  border-top: 3px solid #fff;
  border-bottom: 3px solid #fff;
  display: flex;
}
.menu ul li {
  list-style: none;
  background: #009996;
  border-right: 3px solid #fff;
  box-sizing: border-box;
  vertical-align: middle;
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
  justify-content: center;
  display: flex;
  align-items: center;
}
.menu ul li a {
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  text-align: center;
  display: block;
  padding: 5px;
}
.menu ul li.last-child {
  border: none;
}

.menu ul li:hover {
  background: #ff3366;
}
.menu ul li.active {
  background: #ff3366;
}

/* --- Submenu Folder Styling --- */
ul.nav {
  padding: 0 1rem;
}

.submenu-item {
  position: relative;
}

.submenu-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Add hover effect to indicate interactivity */
  transition: background-color 0.2s ease;
  font-weight: 600;
  color: var(--app-text-color);
  border: 1px solid transparent;
  border-radius: 2rem;
  padding: 5px 14px;
  font-size: 13px;
}

.submenu-toggle:hover {
  background-color: #e2ffec;
  color: var(--app-green-color);
}

.submenu-toggle.active,
.submenu-toggle:hover {
  background-color: #e2ffec;
  color: var(--app-green-color);
  border-color: var(--app-green-color);
}

.submenu-toggle .bi-chevron-right {
  transition: transform 0.3s ease-in-out;
}

.submenu-item .submenu-toggle.active .bi-chevron-right {
  transform: rotate(90deg);
}

.submenu {
  list-style: none;
  padding-left: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  position: relative;
  color: var(--app-text-color);
  padding-top: 5px;
}

.submenu li a {
  color: var(--app-text-color);
  transition: color 0.3s ease-in-out;
  font-size: 12px;
  line-height: 1rem;
}
.submenu li a:hover,
.submenu li a.active {
  color: var(--app-green-color);
}

.submenu.show {
  max-height: 200px; /* Adjust this value as needed to accommodate submenu content */
}

#subjecttxt {
  color: var(--app-blue-color);
}

#exercise,
#subjecttxt {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

#datetime {
  width: 185px;
  white-space: nowrap;
  text-align: right;
}

.content-menu {
  padding: 6px 1rem;
}

.water-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  text-align: center;
  display: flex;
  vertical-align: middle;
  align-items: center;
}
