/* ==========================================================================
   Module Tab Bar — shared workspace navigation bar (all module pages)
   ========================================================================== */

.module-tab-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  background: var(--workspace-bg-secondary, #161b22);
  border-bottom: 1px solid var(--workspace-border-default, #30363d);
  flex-shrink: 0;
  overflow-x: auto;
}

.module-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--workspace-text-secondary, #8b949e);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.module-tab-btn:hover {
  background: var(--workspace-bg-hover, rgba(177, 186, 196, 0.08));
  color: var(--workspace-text-primary, #e6edf3);
  text-decoration: none;
}

.module-tab-btn.active {
  position: relative;
  background: var(--workspace-bg-active, rgba(177, 186, 196, 0.12));
  color: var(--workspace-text-primary, #e6edf3);
}

/* Active tab right-side accent — shared indicator dimensions:
   4px wide, 20% inset, 2px inner radius (matches selector-nav.css) */
.module-tab-btn.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 4px;
  border-radius: 2px 0 0 2px;
  background: var(--module-accent-color, var(--accent-blue, #388bfd));
}

/* Status badges (WIP, Beta) on tab labels */
.tab-status-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tab-status-wip {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

.tab-status-beta {
  background: rgba(130, 80, 223, 0.2);
  color: #a371f7;
}

/* ==========================================================================
   Tab Drag-to-Reorder — visual feedback during tab reordering
   ========================================================================== */

.module-tab-btn[draggable="true"] {
  cursor: pointer;
}

.module-tab-btn[draggable="true"]:active {
  cursor: pointer;
}

.module-tab-btn.tab-dragging {
  opacity: 0.3;
  border-style: dashed;
}

.module-tab-btn.tab-drag-before {
  position: relative;
  margin-left: 12px;
}

.module-tab-btn.tab-drag-before::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 1px;
  background: var(--module-accent-color, var(--accent-blue, #388bfd));
}

.module-tab-btn.tab-drag-after {
  position: relative;
  margin-right: 12px;
}

.module-tab-btn.tab-drag-after::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 1px;
  background: var(--module-accent-color, var(--accent-blue, #388bfd));
}

/* ==========================================================================
   Module Tab Context Menu — right-click actions
   ========================================================================== */

.module-ctx-menu {
  background: var(--color-canvas-overlay, #2d333b);
  border: 1px solid var(--workspace-border-default, #30363d);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 4px 0;
  min-width: 180px;
  font-size: 12px;
}

.module-ctx-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--color-fg-default, #e6edf3);
  transition: background-color 0.1s ease;
}

.module-ctx-item:hover {
  background: var(--color-accent-subtle, rgba(47, 129, 247, 0.15));
}

.module-ctx-icon {
  width: 20px;
  text-align: center;
  margin-right: 8px;
  color: var(--color-fg-muted, #768390);
}

.module-ctx-item:hover .module-ctx-icon {
  color: var(--color-accent-fg, #58a6ff);
}

.module-ctx-label {
  flex: 1;
}

.module-ctx-separator {
  height: 1px;
  background: var(--workspace-border-default, #30363d);
  margin: 4px 8px;
}

.module-ctx-uninstall .module-ctx-icon {
  color: var(--color-danger-fg, #f85149);
}

.module-ctx-uninstall:hover .module-ctx-icon {
  color: var(--color-danger-fg, #f85149);
}

/* ==========================================================================
   Color Picker Panel — inline swatches inside context menu
   ========================================================================== */

.module-ctx-color-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--workspace-border-default, #30363d);
}

.module-ctx-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.1s,
    border-color 0.1s;
  padding: 0;
}

.module-ctx-swatch:hover {
  transform: scale(1.2);
  border-color: var(--color-fg-default, #e6edf3);
}

.module-ctx-swatch-default {
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  position: relative;
}

.module-ctx-swatch-default::after {
  content: "\00d7";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}
