/* ── Pixel Editor Taskbar ────────────────────────────────────────────────── */
/* Bottom-right dock showing minimized pixel editor instances per scope.      */

.pe-taskbar {
  position: fixed;
  bottom: 16px;
  right: 36px;
  display: flex;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;  /* only items themselves are clickable */
}

.pe-taskbar.pe-taskbar--empty {
  display: none;
}

.pe-taskbar-item {
  pointer-events: auto;
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg, rgba(10, 10, 20, 0.7));
  backdrop-filter: blur(var(--glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 20px));
  border: var(--glass-border, 1px solid rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.4));
  color: var(--color-text, #e8eaf0);
  cursor: pointer;
  transition: transform var(--transition-fast, 150ms ease),
              box-shadow var(--transition-fast, 150ms ease),
              border-color var(--transition-fast, 150ms ease),
              color var(--transition-fast, 150ms ease);
  animation: pe-taskbar-enter 220ms cubic-bezier(0.2, 1, 0.3, 1);
}

.pe-taskbar-item:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--color-primary-light, rgba(168, 77, 212, 0.5));
  color: var(--color-primary-light, #A84DD4);
  box-shadow: 0 12px 32px rgba(139, 45, 180, 0.35), 0 0 0 1px rgba(168, 77, 212, 0.3);
}

.pe-taskbar-item:active {
  transform: translateY(-2px) scale(1.02);
}

.pe-taskbar-item.pe-taskbar-item--leaving {
  animation: pe-taskbar-leave 180ms ease-in forwards;
  pointer-events: none;
}

/* Scope filter — hide items whose scope doesn't match the active panel.
   State (dirty count, file changes) is preserved; only display is suppressed. */
.pe-taskbar-item.pe-taskbar-item--filtered {
  display: none;
}

.pe-taskbar-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: none;  /* pass clicks to the .pe-taskbar-item parent */
}

.pe-taskbar-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.pe-taskbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-warning, #FBBF24);
  color: #1a1a2e;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  font-family: var(--font-family, sans-serif);
  pointer-events: none;
}

.pe-taskbar-badge.pe-taskbar-badge--hidden {
  display: none;
}

/* Pulse dot indicating external file changes detected while minimized */
.pe-taskbar-pulse {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-info, #60A5FA);
  box-shadow: 0 0 0 0 var(--color-info, #60A5FA);
  animation: pe-taskbar-pulse 1.6s infinite;
}

.pe-taskbar-pulse.pe-taskbar-pulse--hidden {
  display: none;
}

/* Custom tooltip (CSS-only) that doesn't clash with native title */
.pe-taskbar-item[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  padding: 6px 10px;
  background: var(--glass-bg, rgba(10, 10, 20, 0.92));
  border: var(--glass-border, 1px solid rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text, #e8eaf0);
  font-size: var(--font-size-xs, 0.75rem);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--transition-fast, 150ms ease),
              transform var(--transition-fast, 150ms ease);
}

.pe-taskbar-item:hover[data-tooltip]::before {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pe-taskbar-enter {
  0%   { transform: translateY(20px) scale(0.5); opacity: 0; }
  60%  { transform: translateY(-2px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes pe-taskbar-leave {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(20px) scale(0.6); opacity: 0; }
}

@keyframes pe-taskbar-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(96, 165, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}
