/* General Layout */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  display: flex;
  height: 100vh;
  background-color: #f4f4f4;
}

/* Left-hand menu */
.menu {
  background-color: #222831;
  color: white;
  width: 60px; /* Compact width */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-right: 2px solid #ddd;
  position: relative;
  overflow: hidden;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  position: relative; /* For absolute positioning of text */
  box-sizing: border-box; /* Prevent padding from affecting layout */
}

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

/* Fixed icon container */
.menu-item-icon {
  font-size: 24px;
  width: 30px; /* Fixed width for the icon */
  height: 30px; /* Fixed height */
  text-align: center;
  flex-shrink: 0; /* Prevent shrinking */
}

/* Text that appears on hover */
.menu-item-text {
  font-size: 16px;
  color: white;
  position: absolute; /* Position the text outside the menu */
  left: 60px; /* Right of the menu's edge */
  top: 50%; /* Align vertically */
  transform: translateY(-50%); /* Center vertically */
  white-space: nowrap; /* Prevent wrapping */
  background-color: #222831; /* Match menu background */
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: 0; /* Initially hidden */
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Show text on hover */
.menu-item:hover .menu-item-text {
  opacity: 1;
  visibility: visible;
}

.badge {
  position: absolute;
  top: 5px;
  right: 10px;
  background-color: darkgreen;
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  padding: 2px 6px;
  display: none; /* Hidden by default */
}

.menu-item:hover .badge {
  transform: scale(1.1); /* Optional hover effect */
}

/* Main content area */
.content {
  flex: 1;
  padding: 20px;
  overflow: auto;
}

.user-info-icon {
  position: absolute;
  bottom: 0px;
  width: 40px;
  height: 40px;
  margin: 10px;
  background-color: #555;
  color: white;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  display: flex;
}

.userinfo-popup {
  position: absolute;
  bottom: 10px;
  left: 70px;
  background-color: lightgoldenrodyellow;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
}

.userinfo-popup.hidden {
  display: none;
}

.userinfo-popup button {
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.userinfo-popup button:hover {
  background-color: #d32f2f;
}

/** Error toast **/
/* Error Popup */
.error-popup {
  position: fixed;
  top: -100px; /* Start hidden above the viewport */
  left: 50%;
  transform: translateX(-50%);
  background-color: #f44336; /* Red background */
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-size: 16px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 300px;
  max-width: 90%;
  transition: top 0.5s ease; /* Smooth sliding animation */
}

/* Hidden state */
.error-popup.hidden {
  top: -100px; /* Hide above the viewport */
}

/* Button to dismiss */
.error-popup button {
  margin-left: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
}

.error-popup button:hover {
  background-color: rgba(255, 255, 255, 0.3);
}


/** Offline banner. */
.offline-banner {
  position: fixed;
  bottom: -50px; /* Initially hidden below the screen */
  left: 0;
  width: 100%;
  background-color: #ff4d4d; /* Red color for offline state */
  color: white;
  text-align: center;
  padding: 10px 0;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000; /* Ensure it stays on top */
  transition: transform 0.3s ease-in-out;
  transform: translateY(0); /* Default position */
}

.offline-banner.visible {
  transform: translateY(-50px); /* Slide into view */
}

.offline-banner.hidden {
  transform: translateY(50px); /* Slide down (hidden) */
}

