/* ================================================================
   panels.css — Left panel (elements library + layers).
   ================================================================ */

/* ===================== TABS ===================== */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: var(--s-3);
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--stroke-soft);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: none;
  transition: all var(--transition);
  font-size: var(--fz-sm);
  font-weight: 600;
}

.tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.tab.active {
  background: rgba(78,161,255,.10);
  color: var(--brand-blue);
  border-color: rgba(78,161,255,.28);
}

.tab svg { flex-shrink: 0; }

/* ===================== TAB PANES ===================== */
.tabpane {
  display: none;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.tabpane.active { display: flex; }

.group {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-left: var(--s-1);
}

/* ===================== ELEMENT GRID ===================== */
.add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}

.add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-2);
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  color: var(--text);
  cursor: none;
  transition: all var(--transition);
  font-size: var(--fz-xs);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.add::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 80px at var(--mx, 50%) var(--my, 50%),
              rgba(78,161,255,.15), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.add:hover {
  transform: translateY(-2px);
  border-color: rgba(78,161,255,.38);
  background: rgba(78,161,255,.06);
  box-shadow: var(--shadow-md);
}

.add:hover::before { opacity: 1; }

.add:active { transform: translateY(0); }

.add-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.04);
  color: var(--brand-blue);
  transition: transform var(--transition);
}

.add:hover .add-icon {
  transform: scale(1.08);
  background: rgba(78,161,255,.12);
}

/* ===================== FILE UPLOAD ===================== */
.file-upload {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(255,255,255,.02);
  border: 1px dashed var(--stroke);
  border-radius: var(--r-md);
  cursor: none;
  transition: all var(--transition);
  color: var(--muted);
  font-size: var(--fz-sm);
  font-weight: 600;
}

.file-upload:hover {
  border-color: rgba(78,161,255,.40);
  color: var(--brand-blue);
  background: rgba(78,161,255,.04);
}

.file-upload input { display: none; }
.file-upload svg { flex-shrink: 0; }

.hint {
  font-size: var(--fz-xs);
  color: var(--muted-2);
  line-height: 1.5;
  padding: 0 var(--s-1);
}

/* ===================== LAYERS LIST ===================== */
.layers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 40px;
}

.layer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-sm);
  cursor: none;
  transition: all var(--transition);
  font-size: var(--fz-sm);
  user-select: none;
}

.layer:hover {
  border-color: var(--stroke-hover);
  background: rgba(255,255,255,.04);
  transform: translateX(2px);
}

.layer.active {
  border-color: rgba(78,161,255,.40);
  background: rgba(78,161,255,.08);
  color: var(--brand-blue);
}

.layer.dragging {
  opacity: .5;
  transform: scale(.98);
}

.layer .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.iconbtn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: var(--r-xs);
  color: var(--muted-2);
  cursor: none;
  font-size: 12px;
  transition: all var(--transition);
  opacity: .5;
}

.iconbtn:hover { opacity: 1; background: rgba(255,255,255,.08); color: var(--text); }
.iconbtn.on    { opacity: 1; color: var(--brand-orange); }
