/* ============================================
   GaiaMonitor Base Styles
   Reset, typography, shared primitives.
   ============================================ */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-chip);
  padding: var(--sp-1) var(--sp-2);
  outline: none;
}
input:focus, select:focus {
  border-color: var(--border-strong);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-panel);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* Panel primitives */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel-2);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.panel-status {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
}

/* Status dot */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot--green  { background: var(--accent-green); }
.dot--amber  { background: var(--accent-amber); }
.dot--red    { background: var(--accent-red); }
.dot--cyan   { background: var(--accent-cyan); }

/* Mono numbers */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Category chip */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-chip);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  user-select: none;
}
.cat-chip:hover {
  border-color: var(--border-strong);
}
.cat-chip.active {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

/* Grid lines for panels (telemetry feel) */
.panel-body--grid {
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 100% 32px, 32px 100%;
  background-position: 0 0;
  background-blend-mode: normal;
}

/* Hairline separator */
.separator {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-1) 0;
}

/* Toggle switch (mission control rectangular style) */
.toggle {
  position: relative;
  width: 32px;
  height: 14px;
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 10px;
  background: var(--text-tertiary);
  border-radius: 1px;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}
.toggle.on {
  background: var(--bg-elevated);
  border-color: var(--accent-cyan);
}
.toggle.on::after {
  transform: translateX(16px);
  background: var(--accent-cyan);
}

/* Collapsible chevron */
.collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform var(--duration-fast) var(--ease-out);
}
.collapse-btn.collapsed {
  transform: rotate(-90deg);
}

/* Min-width notice */
@media (max-width: 1279px) {
  body::before {
    content: 'Please view on a wider display (minimum 1280px)';
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-void);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 14px;
  }
  #app { display: none !important; }
}
