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

:root {
  --bg-primary: hsla(0, 0%, 0%, 1);
  --bg-hover: hsla(0, 0%, 100%, 0.03);
  --bg-overlay: hsla(0, 0%, 100%, 0.02);
  --text-primary: hsla(0, 0%, 100%, 1);
  --text-secondary: hsla(0, 0%, 53%, 1);
  --border-color: hsla(0, 0%, 20%, 1);
  --border-transparent: hsla(0, 0%, 0%, 0);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  interpolate-size: allow-keywords;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
    "Cantarell", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  position: relative;
  padding-bottom: 2rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  font-family: "Courier New", monospace;
}

.uptime-status {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: transparent;
}

.uptime-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.uptime-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
  font-weight: 300;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: transparent;
  border-radius: 0;
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.stat-card.large {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .stat-card.large {
    grid-column: span 2;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
}

.card-header h2 {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: "Courier New", monospace;
}

.stat-value {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
}

.cpu-cores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-block: 1rem;
}

.cpu-core {
  background: transparent;
  border-radius: 0;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.cpu-core-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Courier New", monospace;
}

.cpu-core-value {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
}

.progress-bar,
.temp-bar {
  width: 100%;
  height: 1rem;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-fill,
.temp-fill {
  height: 100%;
  background: var(--text-primary);
  transition: width var(--transition-normal);
  border-radius: 0;
}

.temp-fill {
  background: var(--text-primary);
}

.stat-collection {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid var(--border-color);
}

.stat-item:not(:has(~ .stat-item)) {
  border-bottom: none;
}

.stat-item.with-bar {
  flex-direction: column;
  row-gap: 0.5rem;
}

.stat-label-flex {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition-normal);
}

.stat-value {
  font-weight: 300;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
}

.stat-subsection {
  border: 1px solid var(--border-color);
  padding: 0 1rem;
  margin-top: 1rem;
}

.stat-subsection-header {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.subsection-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  opacity: 0.7;
  transition: opacity var(--transition-normal);
}

.subsection-link:hover {
  opacity: 1;
}

footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
}

#last-update {
  color: var(--text-primary);
}

.diary-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.diary-entry:last-child {
  border-bottom: none;
}

.diary-entry-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.diary-entry-content {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
  font-weight: 300;
  overflow: hidden;
  position: relative;
  max-height: 4.8rem;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.diary-empty-state {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
  color: var(--text-secondary);
}

.diary-entry-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-decoration: none;
  font-family: "Courier New", monospace;
  border-bottom: 1px solid var(--border-transparent);
  transition: border-color var(--transition-fast);
}

.diary-entry-link:hover {
  border-bottom-color: var(--text-secondary);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .stat-card.large {
    grid-column: span 1;
  }

  .uptime-status {
    position: static;
    margin-top: 1rem;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Interactive Chart Styles */
.stat-item.interactive {
  cursor: pointer;
  transition: background-color var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.stat-item.interactive:hover {
  background-color: var(--bg-hover);
}

.stat-item.interactive:hover .stat-label {
  color: var(--text-primary);
}

.chart-container {
  padding-top: 1rem;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 0;
  opacity: 0;
}

.chart-container[style*="display: block"] {
  height: auto;
  opacity: 1;
}

.chart-canvas {
  width: 100% !important;
  height: 300px !important;
  display: block;
}
