/* Clean themed dashboard stylesheet */
/* =============================================================
   THEME VARIABLES
   ============================================================= */
:root {
  --bg-start: #345d9d;
  --bg-end: #c2a633;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.65);
  --card: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.18);
  --card-highlight: rgba(255, 255, 255, 0.15);
  --table-head: rgba(255, 255, 255, 0.12);
  --row-hover: rgba(255, 255, 255, 0.05);
  --btn-bg: rgba(255, 255, 255, 0.15);
  --btn-border: rgba(255, 255, 255, 0.3);
  --btn-bg-hover: rgba(255, 255, 255, 0.22);
  --badge-doc: #345d9d;
  --badge-dc2: #c2a633;
  --badge-doge: #8b4789;
  --badge-accepted: #05a532;
  --badge-rejected: #d93025;
  --shadow-card: 0 8px 32px rgba(31, 38, 135, 0.37);
  --shadow-logo: 0 4px 15px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --fast: 160ms ease;
}
[data-theme="light"] {
  --bg-start: #e8f0ff;
  --bg-end: #fff8e1;
  --text: #1a1f29;
  --text-dim: rgba(0, 0, 0, 0.55);
  --card: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.08);
  --card-highlight: rgba(0, 0, 0, 0.06);
  --table-head: rgba(0, 0, 0, 0.06);
  --row-hover: rgba(0, 0, 0, 0.04);
  --btn-bg: rgba(0, 0, 0, 0.06);
  --btn-border: rgba(0, 0, 0, 0.15);
  --btn-bg-hover: rgba(0, 0, 0, 0.12);
  --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-logo: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* ============================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font);
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text);
  padding: 20px 0 40px;
  min-height: 100vh;
  transition: background 0.45s, color 0.25s;
}
.theme-fade {
  animation: themeFade 0.55s ease;
}
@keyframes themeFade {
  0% {
    opacity: 1;
  }
  35% {
    opacity: 0.18;
  }
  100% {
    opacity: 1;
  }
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px;
}
h1 {
  text-align: center;
  margin: 10px 0 34px;
  font-size: 2.4em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.35);
}
.logo {
  height: 56px;
  width: 56px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--card);
  padding: 8px;
  box-shadow: var(--shadow-logo);
}
.chain-logo {
  height: 22px;
  width: 22px;
  object-fit: contain;
  vertical-align: middle;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px;
  margin: 0 0 28px;
}
.stat-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  position: relative;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: background 0.25s, border-color 0.25s;
}
.stat-card:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    circle at 85% 15%,
    var(--card-highlight),
    transparent 60%
  );
  opacity: 0.55;
}
.stat-card h3 {
  font-size: 0.78em;
  font-weight: 600;
  margin: 0 0 8px;
  opacity: 1;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card .value {
  font-size: 2.35em;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 4px;
}
.stat-card .unit {
  font-size: 0.75em;
  opacity: 1;
}
.stat-card .subtext,
#hashrate-subtext {
  font-size: 0.63em;
  opacity: 1;
  letter-spacing: 0.4px;
  margin-top: 2px;
  line-height: 1.25;
}

.section {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 0 0 30px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--card-border);
  transition: background 0.25s, border-color 0.25s;
}
.section h2 {
  margin: 0 0 18px;
  font-size: 1.38em;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.table-wrapper {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.9em;
}
th {
  background: var(--table-head);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65em;
  letter-spacing: 1px;
  text-align: left;
}
tr:hover {
  background: var(--row-hover);
}
.col-num {
  text-align: right;
}
.no-data {
  text-align: center;
  padding: 34px 8px;
  opacity: 1;
  font-style: italic;
}
.hash-short {
  font-family: "Courier New", monospace;
  font-size: 0.82em;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--badge-doc);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(5, 165, 50, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(5, 165, 50, 0);
  }
}
.live-indicator {
  width: 11px;
  height: 11px;
  background: var(--badge-doc);
  border-radius: 50%;
  animation: pulse 2.4s infinite;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 18px;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1;
}
.badge-doc {
  background: var(--badge-doc);
  color: #fff;
}
.badge-dc2 {
  background: var(--badge-dc2);
  color: #fff;
}
.badge-doge {
  background: var(--badge-doge);
  color: #fff;
}
.badge-accepted {
  background: var(--badge-accepted);
  color: #fff;
}
.badge-rejected {
  background: var(--badge-rejected);
  color: #fff;
}
#block-only-badge {
  background: #a60000;
}

#total-hashrate-conf {
  color: #fff !important;
}

.copy-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.copy-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.6em;
  line-height: 1;
  transition: background var(--fast), border-color var(--fast);
}
.copy-btn:hover {
  background: var(--btn-bg-hover);
}
.copy-btn:active,
.copy-btn.copied {
  background: var(--badge-doc);
  border-color: var(--badge-doc);
  color: #fff;
}

/* Toolbar container utility */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin: -10px 0 20px 0;
}
/* Group maintenance buttons together so they appear adjacent */
.maintenance-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto; /* push group to right end */
}
.maintenance-group .mini-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.55em;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1.1;
  border: 1px solid var(--btn-border);
}
[data-theme="light"] .maintenance-group .mini-option {
  background: rgba(0, 0, 0, 0.08);
}
.maintenance-group .mini-option input[type="checkbox"],
.maintenance-group .mini-option input[type="number"] {
  accent-color: #05a532;
  font-size: 1em;
  padding: 2px 4px;
}
.maintenance-group .mini-option input[type="number"] {
  width: 70px;
  background: transparent;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  color: var(--text);
}
.maintenance-status {
  font-size: 0.55em;
  opacity: 1;
  min-width: 120px;
}

/* Explorer links */
.explorers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
  font-size: 0.7em;
  letter-spacing: 0.5px;
  opacity: 1;
}
.explorers a {
  text-decoration: none;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--fast), border-color var(--fast),
    color var(--fast);
}
.explorers a:hover {
  background: var(--btn-bg-hover);
}
.explorers a .chain-tag {
  background: var(--badge-doc);
  color: #fff;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.9em;
  line-height: 1;
}
.explorers a.dc2 .chain-tag {
  background: var(--badge-dc2);
}

/* Hash link inside block tables */
a.hash-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color var(--fast), color var(--fast);
}
a.hash-link:hover {
  border-bottom-color: var(--badge-doc);
}
tbody tr td a.hash-link {
  font-family: "Courier New", monospace;
}
[data-theme="light"] a.hash-link:hover {
  border-bottom-color: var(--badge-dc2);
}

/* Toolbar action button (Flush Hashrate) */
.toolbar-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7em;
  letter-spacing: 0.5px;
  transition: background var(--fast), border-color var(--fast),
    color var(--fast);
  backdrop-filter: blur(6px);
}
/* .toolbar-btn.push-right no longer used (group handles alignment) */
.toolbar-btn:hover {
  background: var(--btn-bg-hover);
}
/* Slightly stronger background in light mode for contrast */
[data-theme="light"] .toolbar-btn {
  background: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.18);
}

.update-time {
  text-align: center;
  opacity: 1;
  margin-top: 24px;
  font-size: 0.8em;
  letter-spacing: 0.5px;
}

@media (max-width: 1050px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .stat-card .value {
    font-size: 2.1em;
  }
}
@media (max-width: 780px) {
  h1 {
    font-size: 1.9em;
  }
  body {
    padding-top: 12px;
  }
  .stat-card {
    padding: 16px 18px;
  }
}
@media (max-width: 560px) {
  .stat-card .value {
    font-size: 1.75em;
  }
  th,
  td {
    padding: 8px 9px;
  }
  .chain-logo {
    height: 18px;
    width: 18px;
  }
  #hashrate-subtext {
    font-size: 0.6em;
  }
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--card-border);
}
::-webkit-scrollbar-thumb {
  background: var(--btn-border);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--badge-dc2);
}

/* Floating theme toggle */
.theme-toggle-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  padding: 10px 14px;
  font-size: 0.65em;
  letter-spacing: 0.5px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: background 0.25s, border-color 0.25s, transform 0.2s, color 0.25s;
}
.theme-toggle-fab:hover {
  transform: translateY(-2px);
  background: var(--card-highlight);
}
.theme-toggle-fab:active {
  transform: translateY(0);
}
.theme-toggle-fab .icon {
  font-size: 1.1em;
  line-height: 1;
}
.theme-toggle-fab .label {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .theme-toggle-fab {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    font-size: 0.6em;
  }
  .theme-toggle-fab .label {
    display: none;
  }
}


/* DOC logo in dashboard title */
.dashboard-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-title .dashboard-logo {
  height: 1.35em;
  width: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

/* Miner 24h history lookup */
.miner-lookup-form {
  margin-bottom: 22px;
}
.miner-lookup-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85em;
  opacity: 0.85;
}
.miner-lookup-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.miner-lookup-controls input {
  flex: 1 1 480px;
  min-width: 240px;
  padding: 12px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--text);
  font-size: 1em;
}
.miner-lookup-controls button {
  padding: 12px 20px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.miner-lookup-controls button:hover { background: var(--btn-bg-hover); }
.miner-lookup-controls button:disabled { opacity: 0.6; cursor: default; }
.miner-lookup-status {
  margin-top: 8px;
  font-size: 0.78em;
  opacity: 0.82;
}
.miner-history-result {
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
}
.miner-history-query {
  font-family: "Courier New", monospace;
  word-break: break-all;
  margin-bottom: 14px;
  opacity: 0.85;
}
.miner-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.miner-history-metric {
  background: var(--table-head);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.miner-history-metric span { font-size: 0.75em; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.7px; }
.miner-history-metric strong { font-size: 1.5em; }
.miner-history-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.78em;
  opacity: 0.8;
  margin-bottom: 6px;
}
.miner-history-chart {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
}
.miner-history-chart svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}
.miner-chart-grid { stroke: var(--card-border); stroke-width: 1; }
.miner-chart-y, .miner-chart-x { fill: var(--text); font-size: 12px; opacity: 0.75; }
.miner-chart-y { text-anchor: end; }
.miner-chart-x { text-anchor: middle; }
.miner-share-bar { fill: var(--badge-accepted); opacity: 0.85; }
.miner-block-star { fill: #ffc400; stroke: rgba(0,0,0,0.35); stroke-width: 1px; font-size: 18px; text-anchor: middle; }
.miner-block-count { fill: var(--text); font-size: 11px; font-weight: 700; }
.miner-history-subtitle { margin: 20px 0 10px; font-size: 1.05em; }
@media (max-width: 600px) {
  .miner-lookup-controls { flex-direction: column; }
  .miner-lookup-controls input, .miner-lookup-controls button { width: 100%; min-width: 0; }
  .miner-history-summary { grid-template-columns: 1fr; }
}

.miner-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.miner-history-toolbar .miner-history-query {
  margin-bottom: 0;
  min-width: 0;
  flex: 1 1 auto;
}
.miner-history-collapse {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.miner-history-collapse:hover {
  background: var(--btn-bg-hover);
}
@media (max-width: 600px) {
  .miner-history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .miner-history-collapse {
    width: 100%;
  }
}
