/* ============================================
   _base.css
   Reset, Body, Scrollbars, Panel Container, Header, Icon Buttons
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  /* Use VS Code's native UI font throughout */
  font-family: var(--font-sans);
  font-size: var(--vscode-font-size, 14px);
  font-weight: var(--vscode-font-weight, 400);
  line-height: 1.4;
  color: var(--vscode-foreground, var(--text-primary));
  background: var(--vscode-sideBar-background, var(--bg-primary));
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
  transition: var(--theme-transition);
}

#root {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Refined scrollbars - track matches background, thumb slightly darker */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
  border: 2px solid var(--bg-primary);  /* Creates padding effect around thumb */
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}

/* Firefox scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) var(--bg-primary);
}

/* ============================================
   Panel Container
   ============================================ */

.atopile-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 320px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
}

/* ============================================
   Sidebar Panel Base
   Unified base styles for all sidebar content panels
   ============================================ */

.sidebar-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* ============================================
   Header
   ============================================ */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Edge-to-edge: minimal horizontal padding */
  position: relative;
  padding: 0 var(--spacing-xs);
  border-bottom: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  /* Match VS Code native header height (35px is standard for view titles) */
  height: 35px;
  min-height: 35px;
  /* Ensure header stays above disconnected overlay so settings gear is always accessible */
  z-index: calc(var(--z-modal) + 100);
}

.panel-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.header-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  /* Match VS Code native view title styling */
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  letter-spacing: 0;
}

.header-logo {
  width: 18px;
  height: 18px;
  display: block;
}

.header-actions {
  display: flex;
  gap: 2px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn.active {
  background: var(--bg-hover);
  color: var(--accent);
}

/* Version badge in header - don't push to far right */
.header-title .version-badge {
  margin-left: 0;
  font-size: var(--font-size-xxs);
  padding: 1px 5px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-sm);
}
