
/* Custom scrollbar styles */
.grid-stack-item-content::-webkit-scrollbar, #characters::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.grid-stack-item-content::-webkit-scrollbar-track, #characters::-webkit-scrollbar-track {
  background: rgb(60, 50, 70); /* darker track */
  border-radius: 6px;
}

.grid-stack-item-content::-webkit-scrollbar-thumb, #characters::-webkit-scrollbar-thumb {
  background: rgb(110, 100, 130); /* mid-tone thumb */
  border-radius: 6px;
  border: 2px solid rgb(60, 50, 70); /* inner spacing via border */
}

.grid-stack-item-content::-webkit-scrollbar-thumb:hover, #characters::-webkit-scrollbar-thumb:hover {
  background: rgb(130, 120, 150);
}

/* Firefox scrollbar support */
.grid-stack-item-content, #characters {
  scrollbar-width: thin;
  scrollbar-color: rgb(110, 100, 130) rgb(60, 50, 70);
}


.grid-stack-item-content {
  background: rgb(76, 67, 82);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}
.grid-stack-item-content h2 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  border-bottom: 1px solid #e2d1d1;
  padding-bottom: 2px;
}
.grid-stack-item-content label {
  font-size: 0.8rem;
  font-weight: bold;
  margin-top: 4px;
  display: block;
}
.grid-stack-item-content input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
  background: rgb(200, 200, 200);
  padding: 4px;
  box-sizing: border-box;
}
textarea {
  resize: vertical;
}
.grid-cols {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}
.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.checkbox-list label {
  font-weight: normal;
  white-space: nowrap;
}
#grid-wrapper {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.grid-stack {
  flex: 1;
  min-width: 0;
  min-height: 200%;
  background: #352842;
  padding: 5px;
  position: relative;
}
/* Make grid widgets fully utilize space */
.grid-stack-item {
  display: flex !important;
  flex-direction: column;
}
.grid-stack-item > .grid-stack-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grid-cols input[type="number"],
.grid-cols input[type="text"] {
  min-width: 0;
  flex: 1;
}
.grid-cols > div {
  display: flex;
  flex-direction: column;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.form-grid > div {
  display: flex;
  flex-direction: column;
}

#context-menu {
  position: absolute;
  z-index: 10000;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  padding: 5px 0;
  border-radius: 4px;
  display: none;
  min-width: 150px;
}
#context-menu .menu-item {
  padding: 8px 12px;
  cursor: pointer;
}
#context-menu .menu-item:hover {
  background: #eee;
}
.submenu {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  min-width: 180px;
  z-index: 10001;
  }
.menu-item:hover > .submenu {
  display: block;
}