/* ---------- GLOBAL ---------- */
body {
  margin: 0;
  overflow: hidden;
  background: #e9edf3;
  font-family: "Inter", Arial, sans-serif;
  color: #1b1b1c;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- TOP NAVBAR ---------- */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62px;
  background: rgba(245, 245, 255, 0.5);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(140, 148, 170, 0.4);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 20;
}

.topbar img {
  height: 42px;
  margin-right: 15px;
}

.topbar-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 260px;
  position: absolute;
  top: 118px;
  left: 12px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 15px 18px 16px 18px;
  border: 1px solid rgba(120, 130, 150, 0.35);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 15;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.sidebar.collapsed {
  transform: translateX(-280px);
  opacity: 0;
  pointer-events: none;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 17px;
  margin-bottom: 10px;
  font-weight: 600;
}

.sidebar h3 {
  font-size: 14px;
  margin: 14px 0 6px 0;
  font-weight: 600;
  opacity: 0.9;
}

.sidebar label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.9;
}

.sidebar label span {
  float: right;
  opacity: 0.9;
}

/* ---------- BUTTONS (SIDEBAR ONLY) ---------- */
.sidebar button {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  font-size: 13px;
  background: #e0e3ec;
  border: 1px solid #7f889f;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.18s ease;
}

.sidebar button:hover {
  background: #cfd6e5;
  transform: translateY(-1px);
}

.sidebar button.active {
  background: #4c5eff;
  color: white;
  border-color: #2830cc;
}

/* ---------- SIDEBAR TOGGLE BUTTON ---------- */
#sidebarToggleBtn {
  position: absolute;
  top: 78px;
  left: 12px;
  z-index: 21;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 130, 150, 0.6);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#sidebarToggleBtn span.label {
  font-size: 12px;
}

/* ---------- MODEL LIST ---------- */
.model-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.model-buttons button {
  width: 100%;
  text-align: left;
  font-size: 13px;
  background: #f2f4fb;
}

.model-buttons button.active {
  background: #4c5eff;
  color: #fff;
}

/* ---------- TOGGLES ---------- */
.sidebar input[type="checkbox"] {
  transform: scale(1.1);
  margin-right: 6px;
  cursor: pointer;
}

/* ---------- CANVAS ---------- */
#viewer-canvas {
  width: 100%;
  height: 100vh;
  display: block;
}

.viewer-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, #fafcff 0, #dfe4ee 40%, #c7ced9 100%);
}

/* ---------- ERROR TEXT ---------- */
#errorText {
  display: none;
  color: #dd2222;
  font-weight: 600;
  margin-top: 4px;
}

/* Small spacing before file input */
#fileInput {
  margin-top: 8px;
  width: 100%;
}

  .sidebar {
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
  }

  .sidebar::-webkit-scrollbar {
    width: 8px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }

  .sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
