html {
  height: 100%;
}

body {
  background: linear-gradient(135deg, #fbf9ff, #faf8ff);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main {
  flex: 1;
}

footer {
  text-align: center;
  background-color: #333;
  color: #fff;
  padding: 10px 0;
  width: 100%;
}

nav.navbar {
  position: sticky;
  top: 0;
  z-index: 1100; /* Increased z-index to ensure navbar stays above all elements */
  background: linear-gradient(90deg, #4c00c2, #7b00ff) !important;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Optional: Add shadow for better layering */
}

.navbar-nav .nav-link, .navbar-brand {
  font-size: 0.7rem;
  color: white !important; 
}

.dropdown-menu {
  top: calc(100% + 0.5rem); 
  margin-top: 0; 
  border-radius: 10px; 
  display: none; 
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease, border-radius 0.3s ease;
  z-index: 1050; /* Ensure dropdowns appear below the navbar */
}

.dropdown-item {
  color: black !important; 
  border-radius: 10px; 
  padding: 0.5rem 1rem; 
  font-size: 0.7rem; 
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: #D6B0FF !important; 
  color: black !important; 
}

.user-info {
  text-align: center;
  margin-bottom: 0;
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.user-info a.btn-outline-primary {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-width: 1px;
  margin-left: 10px;
}

.user-info i {
  margin-right: 3px;
}

.navbar-nav .nav-item img {
  max-height: 20px;
  display: block;
  margin: 0 auto;
}

.navbar-nav .nav-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
  border-radius: 10px;
  transition: background-color 0.3s ease, border-radius 0.3s ease; 
}

.nav-item:hover .nav-link {
  background-color: #D6B0FF;
  border-radius: 10px;
}

.dropdown-menu.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

@media (max-width: 767.98px) {
  /* Only for mobile view */
  
  body {
    overflow-y: auto; /* Allow body scrolling on mobile */
  }

  nav.navbar {
    overflow-y: auto; /* Allow navbar scrolling if content overflows on mobile */
  }

  .collapse.navbar-collapse {
    max-height: 100vh; /* Limit height of navbar to the viewport on mobile */
    overflow-y: auto;  /* Enable scrolling within the navbar on mobile */
  }

  .user-info {
    justify-content: center !important;
    margin-bottom: 10px; 
  }
}