body {
  margin: 0px;
}
.header {
  padding: 12px;
  text-align: center;
  background: rgb(59, 58, 58);
  color: white;
  font-size: 30px;
  height: 30px;
}

.bar {
  width: 30px;
  height: 5px;
  background-color: rgb(10, 10, 10);
  margin: 4px 4px;

}




.sidebar {
  height: 100%;
  width: 0;
  position: fixed; 
  z-index: 1; 
  top: 0;
  left: 0;
  background-color: #111; 
  overflow-x: hidden;
  padding-top: 60px; 
  transition: 0.5s; 
  align-items: flex-start;;
}


.sidebar a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 25px;
  color: #818181;
  display: block;
  transition: 0.3s;
}


.sidebar a:hover, .sidebar button:hover {
  color: #f1f1f1;
}

.sidebar button {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 25px;
  color: #818181;
  display: block;
  transition: 0.3s;
  background-color: #111; 
  background: none;
  border: none;
  cursor: pointer;
}


.sidebar .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}


.openbtn {
  font-size: 20px;
  cursor: pointer;
  height: 50px;
  width: 50px;
  border: none;
  background-color:rgb(59, 58, 58);
  border-radius: 5px;
}

.openbtn:hover {
  background-color: #444;
  transition: 0.5s; 
}

#main {
  transition: margin-left .5s; 
  position: absolute;
  top: 3px;
  left: 20px;
  
}


.sidebarSubmenu {
  max-height: 0;               
  overflow: hidden;            /*Hide the content when collapsed */
  opacity: 0;                  /*Initial opacity is 0 (invisible) */
  transition: max-height 0.5s ease-out, opacity 0.5s ease-out; /* Smooth transition for height and opacity */
}

.sidebarSubmenu.show {
    max-height: 200px;           /* Max height when expanded */
    opacity: 1;                  /* Fully visible when expanded */
}


.user-profile {
  position: absolute; 
  top: 3px; 
  right: 10px; 
  display: flex; 
  cursor: pointer;
  border-radius: 5px;
  padding: 5px 5px 5px 5px;
}

.user-profile:hover {
  background-color: #444;
  transition: 0.5s; 
}


.profile-menu {
  background-color: rgb(27, 25, 25);
  position: absolute;
  top: 50px;
  right: 10px;
  width: 225px;
  border-radius: 5px;
  transform: scale(0);  /* Initial state: scale down and translate diagonally */
  transform-origin: top right;               /* Expand from the top right corner */
  opacity: 0;                                /* Initially invisible */
  transition: transform 0.5s ease, opacity 0.5s ease;
  overflow: hidden;                          /*Hide overflow when collapsed */
}


.profile-menu p{
  font-size: 16px;
  color: rgb(255, 255, 255);
  text-align: left;
  margin-left: 5px;
  margin-bottom: 2px;
  
}
.profile-menu form{
  text-align: left;
  margin-left: 5px 0;
  padding: 0;
  background-color: none;
  background: none;
  border: none;
  height: 25px;

  
}
.profile-menu button{
  font-size: 12px;
  color: rgb(0, 238, 255);
  text-align: left;
  background-color: none;
  background: none;
  border: none;
  display: block;
  width: auto;
  padding: 5px 9px;
  margin: 0;
  box-sizing: border-box;
  
  
}
.profile-menu button:hover{
  border: 5px;
  border-radius: 5px;
  text-decoration: underline;
  cursor: pointer;
  
}
.profile-menu.show {
  transform: scale(1);       /*Fully expand both vertically and horizontally, no translation */
  opacity: 1;                                /* Fully visible */
}


main {
  margin: 15px;
}





@media screen and (max-height: 450px) {
  .sidebar {padding-top: 15px;}
  .sidebar a {font-size: 18px;}

  .profile-menu {
    right: 0;                   /*Make it full width on mobile*/
    left: 0;
    max-width: 100%;            /*Full width on mobile*/
  }
}