/* ========== Global Styles ========== */

/* Remove default margins and paddings, set base font family, and disable scrolling */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  overflow: hidden;
}

/* ========== Preview Mode Layout ========== */

/* Force full-screen layout for preview mode, ignoring normal margins and positioning */
.isPreview {
  margin-left: 0 !important;
  margin-top: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
  position: fixed;
}

/* Adjusted height when nav is hidden */
.no-mfe-nav {
  height: calc(100vh - 45px) !important;
}

/* ========== Main Container Layout ========== */

/* Default layout for main container with sidebar and header offsets */
#main {
  margin-left: 45px; /* Sidebar width offset */
  margin-top: 45px;  /* Header height offset */
  height: calc(100vh - -5px); /* Slight oversize to avoid clipping issues */
  width: calc(100vw - 45px);
  position: fixed;
}

/* ========== Toast Notifications ========== */

/* Position toast top and centered horizontally */
.p-toast {
  top: 50px !important;
  left: 50%;
  translate: -50%; /* Centers toast element */
}

/* ========== Context Menu ========== */

/* Offset context menu by 45px to align with sidebar/header positioning */
.p-contextmenu {
  transform: translate(-45px, -45px) !important;
}

/* ========== Main Layout Variants ========== */

/* When nav is expanded, adjust main content margin and width */
#main.open {
  margin-left: 170px;
  width: calc(100% - 170px);
}

/* Fullscreen layout for login page (no sidebar or header) */
#main.login {
  margin-left: 0;
  margin-top: 0;
  height: 100vh;
  width: 100vw;
}

/* Layout for device view */
#main.device {
  margin-left: 0;
  margin-top: 0;
  width: 100vw;
  height: calc(100vh - 75px);
}
