/* PC Info — animated, theme-token-driven Dashboard widget. Every color reads a
   custom property from src/styles/colorSchemes.css (no hard-coded hex), and all
   ambient/loop animations are disabled under prefers-reduced-motion. */

.dw-pcinfo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

/* Ambient drifting glows behind the content. */
.dw-pcinfo-ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

.dw-pcinfo-ambient-a {
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  animation: dw-pcinfo-drift 14s ease-in-out infinite;
}

.dw-pcinfo-ambient-b {
  bottom: -70px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--green) 16%, transparent), transparent 70%);
  animation: dw-pcinfo-drift 18s ease-in-out infinite reverse;
}

.dw-pcinfo > .dw-pcinfo-header,
.dw-pcinfo > .dw-pcinfo-tabs,
.dw-pcinfo > .dw-pcinfo-body,
.dw-pcinfo > .dw-pcinfo-footer {
  position: relative;
  z-index: 1;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.dw-pcinfo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dw-pcinfo-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--green), color-mix(in srgb, var(--green) 70%, #000));
  color: color-mix(in srgb, var(--green) 18%, #000);
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--green) 55%, transparent);
}

.dw-pcinfo-heading {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dw-pcinfo-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dw-pcinfo-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-pcinfo-headmeta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  text-align: right;
}

.dw-pcinfo-host {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-pcinfo-stamp {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}

.dw-pcinfo-refresh {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.dw-pcinfo-refresh:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.dw-pcinfo-refresh:disabled {
  cursor: default;
  opacity: 0.7;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.dw-pcinfo-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.dw-pcinfo-tabs::-webkit-scrollbar {
  display: none;
}

.dw-pcinfo-tab {
  flex: 1 1 0;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.dw-pcinfo-tab.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent);
}

.dw-pcinfo-tab-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--text-muted);
}

.dw-pcinfo-tab.is-active .dw-pcinfo-tab-label {
  color: var(--text);
  font-weight: 650;
}

/* ── Body ────────────────────────────────────────────────────────────────── */

.dw-pcinfo-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.dw-pcinfo-enter {
  animation: dw-pcinfo-enter 360ms ease both;
}

.dw-pcinfo-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px;
}

.dw-pcinfo-split {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.dw-pcinfo-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.dw-pcinfo-hero-main {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Illustrations */
.dw-pcinfo-illu {
  position: relative;
  flex: 0 0 auto;
  width: clamp(96px, 30%, 132px);
  aspect-ratio: 1 / 1;
}

.dw-pcinfo-illu-gpu {
  aspect-ratio: 130 / 100;
  width: clamp(110px, 32%, 130px);
}

.dw-pcinfo-illu-board {
  aspect-ratio: 134 / 128;
}

.dw-pcinfo-illu-svg {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.dw-pcinfo-breathe {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  animation: dw-pcinfo-breathe 4.5s ease-in-out infinite;
}

.dw-pcinfo-breathe-cpu {
  inset: 14px;
  border-radius: 14px;
  animation-duration: 3.8s;
}

/* Rings */
.dw-pcinfo-ring {
  display: block;
  transform: rotate(-90deg);
}

/* Summary gauges */
.dw-pcinfo-gauges {
  display: flex;
  gap: 10px;
}

.dw-pcinfo-gauge {
  flex: 1 1 0;
  text-align: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 6px;
}

.dw-pcinfo-gauge-ring {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto;
}

.dw-pcinfo-gauge-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dw-pcinfo-gauge-label {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dw-pcinfo-spark {
  display: block;
  width: 100%;
}

/* Facts grid */
.dw-pcinfo-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}

.dw-pcinfo-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dw-pcinfo-fact-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.dw-pcinfo-fact-value {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Big rings (OS uptime, memory, battery) */
.dw-pcinfo-bigring {
  position: relative;
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
}

.dw-pcinfo-bigring-sm {
  width: 116px;
  height: 116px;
}

.dw-pcinfo-bigring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dw-pcinfo-bigring-value {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.dw-pcinfo-bigring-unit {
  margin-top: 3px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}

.dw-pcinfo-bigring-sub {
  margin-top: 4px;
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-muted);
}

/* Key/value rows */
.dw-pcinfo-rows {
  display: flex;
  flex-direction: column;
}

.dw-pcinfo-rows-grow,
.dw-pcinfo-split > .dw-pcinfo-rows {
  flex: 1 1 220px;
  min-width: 0;
}

.dw-pcinfo-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 11.5px;
  border-bottom: 1px solid var(--hairline);
}

.dw-pcinfo-row:last-child {
  border-bottom: 0;
}

.dw-pcinfo-label {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.dw-pcinfo-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  color: var(--text);
  word-break: break-word;
}

.dw-pcinfo-mono {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
}

.dw-pcinfo-muted {
  color: var(--text-muted);
}

.dw-pcinfo-strong {
  color: var(--text);
}

/* Stat clusters (cores/threads/GHz, GB total/free) */
.dw-pcinfo-title-lg {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.dw-pcinfo-subtle {
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-muted);
}

.dw-pcinfo-stats {
  display: flex;
  gap: 18px;
  margin-top: 10px;
}

.dw-pcinfo-stat {
  display: flex;
  flex-direction: column;
}

.dw-pcinfo-stat-value {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.dw-pcinfo-stat-value.is-accent {
  color: var(--accent);
}

.dw-pcinfo-stat-label {
  margin-top: 3px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* Panels (CPU live load, throughput) */
.dw-pcinfo-panel {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.dw-pcinfo-panel-head,
.dw-pcinfo-throughput-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.dw-pcinfo-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dw-pcinfo-block-title {
  margin-bottom: 6px;
}

.dw-pcinfo-panel-metric,
.dw-pcinfo-throughput-rate {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.dw-pcinfo-panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Memory sticks */
.dw-pcinfo-sticks {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  height: 50px;
}

.dw-pcinfo-stick {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dw-pcinfo-stick-body {
  position: relative;
  width: 100%;
  height: 40px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.dw-pcinfo-stick-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, var(--green), color-mix(in srgb, var(--green) 55%, var(--surface)));
  border-radius: 0 0 4px 4px;
  transition: height 200ms ease;
}

.dw-pcinfo-stick-pins {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 3px 4px;
  opacity: 0.4;
}

.dw-pcinfo-stick-pins span {
  height: 1px;
  background: var(--text);
}

.dw-pcinfo-stick-cap {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 8.5px;
  color: var(--text-muted);
}

/* VRAM badge */
.dw-pcinfo-vram {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.dw-pcinfo-vram-value {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.dw-pcinfo-vram-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* Displays */
.dw-pcinfo-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.dw-pcinfo-display,
.dw-pcinfo-drive {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.dw-pcinfo-display-text,
.dw-pcinfo-drive-text {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.dw-pcinfo-display-name,
.dw-pcinfo-drive-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-pcinfo-display-sub,
.dw-pcinfo-drive-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Storage volumes */
.dw-pcinfo-vol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.dw-pcinfo-vol {
  text-align: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
}

.dw-pcinfo-vol-ring {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto;
}

.dw-pcinfo-vol-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dw-pcinfo-vol-mount {
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.dw-pcinfo-vol-pct {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
}

.dw-pcinfo-vol-label {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.dw-pcinfo-vol-sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
}

.dw-pcinfo-drives {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dw-pcinfo-drive-size {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

/* Network */
.dw-pcinfo-net {
  gap: 10px;
}

.dw-pcinfo-throughput {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.dw-pcinfo-throughput-rate {
  color: var(--green);
}

.dw-pcinfo-adapter {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
}

.dw-pcinfo-adapter-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.dw-pcinfo-adapter-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.dw-pcinfo-adapter-id {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dw-pcinfo-adapter-name {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-pcinfo-adapter-type {
  font-size: 10.5px;
  color: var(--text-muted);
}

.dw-pcinfo-adapter-speed {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.dw-pcinfo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.dw-pcinfo-dot.is-on {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.dw-pcinfo-packet {
  position: relative;
  height: 14px;
  margin: 8px 2px 2px;
}

.dw-pcinfo-packet-line {
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.dw-pcinfo-packet-dot {
  position: absolute;
  top: 4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
  animation: dw-pcinfo-packet 2.2s linear infinite;
}

.dw-pcinfo-adapter-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Audio equalizer */
.dw-pcinfo-eq {
  flex: 0 0 auto;
  width: 110px;
  height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding-bottom: 6px;
}

.dw-pcinfo-eq-bar {
  width: 7px;
  height: 70px;
  border-radius: 4px;
  background: linear-gradient(0deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--surface)));
  transform-origin: bottom;
  transform: scaleY(0.4);
  animation: dw-pcinfo-eq 0.9s ease-in-out infinite;
}

/* Footer */
.dw-pcinfo-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 10.5px;
  color: var(--text-faint);
}

.dw-pcinfo-foot-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-pcinfo-foot-arch {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-family: var(--app-mono-font-family, ui-monospace, monospace);
}

.dw-pcinfo-foot-hint {
  font-family: var(--app-ui-font-family);
  color: var(--amber);
}

/* States */
.dw-pcinfo-empty,
.dw-pcinfo-section-empty {
  padding: 10px 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.dw-pcinfo-error {
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  border-radius: 6px;
  color: var(--text);
  background: color-mix(in srgb, var(--red) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
}

/* ── Animations ──────────────────────────────────────────────────────────── */

.dw-pcinfo-spin {
  animation: dw-pcinfo-spin 900ms linear infinite;
  transform-origin: center;
}

.dw-pcinfo-core {
  animation: dw-pcinfo-core 1.8s ease-in-out infinite;
}

.dw-pcinfo-fan {
  animation: dw-pcinfo-fan 3s linear infinite;
}

.dw-pcinfo-fan-slow {
  animation-duration: 3.6s;
}

.dw-pcinfo-trace {
  animation: dw-pcinfo-trace 1.4s linear infinite;
}

.dw-pcinfo-wifi {
  animation: dw-pcinfo-wifi 1.8s ease-in-out infinite;
}

@keyframes dw-pcinfo-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dw-pcinfo-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dw-pcinfo-drift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(18px, -14px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes dw-pcinfo-breathe {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes dw-pcinfo-core {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 1;
  }
}

@keyframes dw-pcinfo-fan {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dw-pcinfo-trace {
  to {
    stroke-dashoffset: -36;
  }
}

@keyframes dw-pcinfo-packet {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    transform: translateX(132px);
    opacity: 0;
  }
}

@keyframes dw-pcinfo-eq {
  0%,
  100% {
    transform: scaleY(0.28);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes dw-pcinfo-wifi {
  0%,
  100% {
    opacity: 0.18;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dw-pcinfo-ambient,
  .dw-pcinfo-breathe,
  .dw-pcinfo-enter,
  .dw-pcinfo-spin,
  .dw-pcinfo-core,
  .dw-pcinfo-fan,
  .dw-pcinfo-trace,
  .dw-pcinfo-wifi,
  .dw-pcinfo-packet-dot,
  .dw-pcinfo-eq-bar,
  .dw-pcinfo-stick-fill {
    animation: none !important;
    transition: none !important;
  }

  .dw-pcinfo-eq-bar {
    transform: scaleY(0.7);
  }
}
