/* TileForge Studio — Tileset Library Panel */

.tslib-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-panel-alt);
  border-bottom: 1px solid var(--border);
}

.tslib-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tslib-add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  width: 22px;
  height: 22px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tslib-add-btn:hover {
  filter: brightness(1.2);
}

.tslib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 4px;
  padding: 6px;
  overflow-y: auto;
  max-height: 180px;
}

.tslib-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tslib-card:hover {
  background: var(--bg-input);
  border-color: var(--border);
}

.tslib-card-active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.tslib-thumb {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
}

.tslib-thumb-img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: 48px;
  max-height: 48px;
}

.tslib-thumb-missing {
  color: var(--text-dim);
  font-size: 18px;
}

.tslib-label {
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.tslib-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

.tslib-more {
  padding: 4px 8px 6px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.tslib-more-link {
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
}

.tslib-more-link:hover {
  text-decoration: underline;
}

/* Context menu disabled item */
.menu-dropdown-item.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
