:root {
  /* GitHub Light Theme Colors - Based on Primer */
  --gh-bg-light: #ffffff;
  --gh-text-light: #1f2328;
  --gh-link-light: #0969da;
  --gh-border-light: #d1d9e0;
  --gh-header-light: #f6f8fa;
  --gh-button-light: #1f883d;
  --gh-button-hover-light: #1c8139;
  --gh-muted-light: #59636e;
  --gh-subtle-light: #eff2f5;
  --gh-shadow-light: 0px 1px 0px rgba(31, 35, 40, 0.04);

  /* GitHub Dark Theme Colors - Based on Primer */
  --gh-bg-dark: #0d1117;
  --gh-text-dark: #e6edf3;
  --gh-link-dark: #58a6ff;
  --gh-border-dark: #30363d;
  --gh-header-dark: #161b22;
  --gh-button-dark: #238636;
  --gh-button-hover-dark: #2ea043;
  --gh-muted-dark: #8b949e;
  --gh-subtle-dark: #161b22;
  --gh-shadow-dark: 0px 1px 0px rgba(0, 0, 0, 0.1);

  /* Status Colors */
  --awake-color: #1f883d;
  --sleeping-color: #8b949e;
  --error-color: #cf222e;

  /* Accent Colors */
  --accent-blue: #0969da;
  --accent-green: #1f883d;
  --accent-red: #cf222e;
  --accent-yellow: #9a6700;
  --accent-purple: #8250df;
  --accent-pink: #bf3989;

  /* Card Transparency */
  --card-alpha: 0.98;

  /* Transitions */
  --transition-default: all 0.2s ease;
}

/* Base Styles */
html {
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 14px;
  line-height: 1.5;
  color-scheme: dark;
}

body {
  background-size: cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  transition: var(--transition-default);
  background-color: var(--gh-bg-dark);
  color: var(--gh-text-dark);
}

a {
  text-decoration: none;
  transition: var(--transition-default);
  font-weight: 500;
  color: var(--gh-link-dark);
}

a:hover {
  text-decoration: underline;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: inherit;
  transition: var(--transition-default);
}

/* Card Theme (Dark Only) */
.card, .light, .dark {
  background-color: rgba(13, 17, 23, var(--card-alpha));
  color: var(--gh-text-dark);
  border: 1px solid var(--gh-border-dark);
  box-shadow: var(--gh-shadow-dark), 0 3px 6px rgba(0, 0, 0, 0.2);
}

.muted-text {
  color: var(--gh-muted-dark);
}

.awake {
  color: var(--accent-green);
}

.sleeping {
  color: var(--sleeping-color);
}

.error {
  color: var(--accent-red);
}

/* Card Styles */
.card {
  border-radius: 6px;
  padding: 16px;
  margin: 16px auto;
  width: 65%;
  text-align: center;
  transition: var(--transition-default);
}

.card {
  background-color: var(--gh-header-dark);
}

.card:hover {
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1250px) {
  .card {
    width: 60%;
  }
}

@media (max-width: 750px) {
  body {
    touch-action: pan-y;
  }

  .card {
    width: 75%;
  }
}

@media (max-width: 500px) {
  .card {
    width: 90%;
    padding: 12px;
  }
}

/* Container */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* GitHub-style Buttons */
.gh-button {
  display: inline-block;
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid;
  border-radius: 6px;
  transition: var(--transition-default);
  text-decoration: none;
}

.gh-button {
  background-color: var(--gh-button-dark);
  color: #ffffff;
  border-color: rgba(240, 246, 252, 0.1);
  box-shadow: 0 0 transparent, inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.gh-button:hover {
  background-color: var(--gh-button-hover-dark);
  text-decoration: none;
}

.gh-button:active {
  background-color: #1e7a31;
  box-shadow: inset 0 1px 0 rgba(0, 45, 17, 0.2);
}

/* Secondary button */
.gh-button-secondary {
  background-color: transparent !important;
  color: var(--gh-text-dark);
  border-color: var(--gh-border-dark);
}

.gh-button-secondary:hover {
  background-color: var(--gh-subtle-dark) !important;
  border-color: var(--gh-border-dark);
}

/* GitHub-style Headers */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2em;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.3em;
}

h1 {
  border-color: var(--gh-border-dark);
}

h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
}

h3 {
  font-size: 1.25em;
}

/* Last Updated Text */
#last-updated {
  font-size: 12px;
  opacity: 0.7;
}

#last-updated {
  color: var(--gh-muted-dark);
}

/* Device Status */
#device-status {
  margin: 16px 0;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}

#device-status {
  background-color: var(--gh-header-dark);
  border-color: var(--gh-border-dark);
}

/* Code blocks */
code, pre {
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  font-size: 12px;
}

pre {
  padding: 16px;
  overflow: auto;
  line-height: 1.45;
  border-radius: 6px;
}

pre {
  background-color: var(--gh-header-dark);
  border: 1px solid var(--gh-border-dark);
}

code {
  padding: 0.2em 0.4em;
  margin: 0;
  border-radius: 3px;
}

code {
  background-color: rgba(110, 118, 129, 0.4);
}
