* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#glcanvas {
  width: 100%;
  height: 100%;
}

#close-btn {
  cursor: pointer;
  float: right;
  font-size: 20px;
  color: #65676b;
}

.posture-info {
  font-size: 14px; 
  vertical-align:middle;
  height: 22px;
  line-height: 22px;
}

.robot-preview td {
  border: 1px solid #8b8989;
  border-radius: 2px;
  margin: 2px;
  cursor: pointer;
  display: none;
  position: relative;
}

.robot-preview td:hover { 
    outline:none;
    border: 2px;
    border-color:#2b7ec1;
    box-shadow:0 0 10px #0b3353;
}

.robot-preview td:hover .tooltiptext { 
    visibility: visible;
}

/* Tooltip text */
.robot-preview td .tooltiptext {
  display: inline-block;
  position: absolute;
  bottom: 2%;
  left: 20px;
  visibility: hidden;
  width: 60px;
  background-color: rgb(245, 232, 148);

  color: #2e2e2e;
  text-align: center;
  padding: 3px 0;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  opacity: 0.8;
 
  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
}

/* General Body and Container */
body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5; /* Facebook-like background */
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling (copied and adapted from dashboard.php's assumed styles) */
.sidebar {
  width: 60px;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: #fff;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  padding: 15px 10px;
  transition: all 0.4s ease;
}

.sidebar:hover {
  width: 190px;
}

.sidebar-links {
  list-style: none;
  margin-top: 20px;
  height: 80%;
  overflow-y: auto;
}

.sidebar-links h4 span {
  opacity: 0;
}

.sidebar:hover .sidebar-links h4 span {
  opacity: 1;
}

.sidebar-links h4 {
  color: #65676b;
  margin: 5px 0;
  white-space: nowrap;
  position: relative;
}

.sidebar-links .menu-separator {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  transform: scaleX(1);
  transform: translateY(-50%);
  background-color: #e4e6eb;
  transform-origin: right;
  transition-duration: 0.2s;
}

.sidebar:hover .sidebar-links .menu-separator {
  transition-delay: 0s;
  transform: scaleX(0);
}

.sidebar-links li a {
  display: flex;
  align-items: center;
  gap: 0 20px;
  color: #050505;
  font-weight: 500;
  font-size: 12px;
  padding: 10px 10px;
  white-space: nowrap;
  text-decoration: none;
}

.sidebar-links li a:hover {
  background-color: #e4e6eb;
  border-radius: 4px;
}
.sidebar-links .material-symbols-outlined {
  margin-right: 5px;
  font-size: 22px;
  color: #65676b;
}

.canvas-container {
  width: 100%;
  height: 100vh;
  position: relative;
  padding: 2px;
}

/*.robot-select {*/
.ui-panel {
  display: none;
  background-color: #fffc;
  opacity: 0.8;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-radius: 8px;
  max-width: 340px;
  min-width: 250px;
  padding: 15px;
  z-index: 500;
  position: fixed;
  top: 50px;
  left: 160px;
}

.ui-panel p {
  font-size: 12px;
  padding-top: 5px;
}

/* Full-screen overlay */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Timer watch container */
.watch {
  width: 100px;
  height: 100px;
  border: 8px solid #3498db;
  border-radius: 50%;
  position: relative;
}

/* Watch hand (animating) */
.hand {
  position: absolute;
  width: 2px;
  height: 40px;
  background-color: #e74c3c;
  top: 10px;
  left: 49px;
  transform-origin: bottom center;
  animation: rotate 1s linear infinite;
}

/* Animation for rotation */
@keyframes rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 868px) {
  /* Styles applied when the viewport width is 768px or wider */

  body {
    display: block;
  }

  .sidebar:hover {
    width: auto;
  }
  .sidebar {
    width: 100%;
    height: 60px;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1000; /* Ensure it stays on top */
  }
  
  .sidebar-links li {
    width: 11%;
    text-align: center;
    float: left;
  }

  .sidebar-links li a {
    display: block;
    text-align: center;
    align-content: center;
    margin: 0;
  }

  .sidebar-links .menu-text {
    display: none;
  }

  .sidebar-links {
      width: 100%;
      display: inline; /* Hide main links on small screens */
      list-style-type: none;
      margin: 0;
      padding-left: 0;
      overflow: hidden;
      align-content: center;
  }

  .sidebar-links h4 span {
    opacity: 1;
  }
  
  .sidebar-links h4 {
    color: #65676b;
    margin: 10px 0;
    white-space: nowrap;
    position: relative;
    display: none;
  }
  
  .sidebar-links .menu-separator {
    display: none;
  }

  .canvas-container {
      height: calc(100vh - 60px);
  }

  .ui-panel {
    top: 80px;
    left: 20px;
  }
}