:root {
  --nav-color: #045247;
  --bg-color: #eef2f7;
  --card-bg-color: #ffffff;
  --font-color: #333333;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-connected: #00000039;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--nav-color);
  color: white;
  padding: 20px 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

h1 {
  margin: 0;
  font-size: 1.5em;
}

.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.9em;
  font-weight: 500;
  color: white;
}

#status-text {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  background-color: var(--bg-connected);
  transition: background-color 0.3s ease;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.connected {
  background-color: var(--success-color);
  box-shadow: 0 0 8px var(--success-color);
}

.status-dot.disconnected {
  background-color: #6b7280;
  animation: none;
}

.status-dot.error {
  background-color: var(--error-color);
  box-shadow: 0 0 8px var(--error-color);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

main {
  padding: 30px 20px;
  margin: 0 auto;

  max-width: 1200px;
  width: 100%;
  flex-grow: 1;
}

.metrics-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.metric-card {
  background-color: var(--card-bg-color);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  flex: 0 0 auto;
  width: 100%;
  min-width: unset;
  margin-bottom: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.metric-title {
  font-weight: 600;
  color: #0c9785;
  font-size: 1.1em;
  display: block;
  border-bottom: 2px solid #eef2f7;
  padding-bottom: 8px;
  margin-bottom: 5px;
}

.current-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #4a5568;
  margin: 10px 0;
  transition: color 0.3s ease;
}

.chart-container {
  position: relative;
  height: 150px;
  width: 100%;
  margin-top: 10px;
}

.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
  border-top: 2px solid var(--bg-color);
  padding-top: 15px;
}

.io-box {
  text-align: center;
}

.io-title {
  font-size: 0.9em;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
  display: block;
}

.io-value {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--font-color);
}

footer {
  background-color: var(--nav-color);
  color: white;
  padding: 40px 20px 10px 20px;
  margin-top: 0;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  gap: 100px;
  text-align: center;
}

.footer-section {
  flex: 1;
  min-width: unset;
  margin-bottom: 20px;
}

.footer-section h3 {
  margin-bottom: 15px;
  font-size: 1.2em;
  font-weight: 700;
  border-bottom: none;
  padding-bottom: 0;
  text-align: center;
}

.footer-section.about p {
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 10px;
  text-align: justify;
}

.developer-list {
  list-style: none;
  padding: 0 10%;
  margin: 0;
  text-align: left;
}

.developer-list li {
  padding: 5px 0;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.developer-list a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.developer-list a:hover {
  color: var(--success-color);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px 0;
  margin-top: 25px;
  text-align: center;
  font-size: 0.85em;
  opacity: 0.8;
  max-width: 1200px;
  margin: 25px auto 0 auto;
}

.footer-bottom p {
  margin: 0;
}

@media (min-width: 700px) {
  h1 {
    font-size: 2em;
  }

  .metrics-container {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
  }

  .metric-card {
    flex-basis: calc(50% - 10px);
    width: auto;
    min-width: 280px;
    padding: 30px;
    margin-bottom: 20px;
  }

  .metrics-container .metric-card:nth-child(3) {
    max-width: calc(50% - 10px);
    width: 100%;
  }

  .metric-title {
    font-size: 1.3em;
  }

  .current-value {
    font-size: 2.5em;
  }

  .chart-container {
    height: 180px;
  }

  .io-value {
    font-size: 1.25em;
  }
  .io-title {
    font-size: 1em;
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-section {
    margin-bottom: 0;
  }

  .footer-section h3 {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
    text-align: left;
  }

  .developer-list {
    padding: 0;
  }

  .developer-list li {
    justify-content: flex-start;
  }
}

@media (min-width: 1024px) {
  .metrics-container {
    justify-content: space-between;
  }

  .metric-card {
    flex: 1 1 300px;
    min-width: 280px;
    margin-bottom: 0;
  }

  .metrics-container .metric-card:nth-child(3) {
    max-width: none;
    width: auto;
  }

  .chart-container {
    height: 200px;
  }
}
