/* Inspired by https://amientertainment.com/ — matches AMI tools; LibreSpeed meters */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --ami-cyan: #00c6ff;
  --ami-magenta: #ed1e79;
  --ami-yellow: #ffe430;
  --ami-dark: #1a1a2e;
  --ami-text: #333333;
  --ami-muted: #666666;
  --ami-border: #ebebeb;
  --ami-bg: #f7f8fa;
  --ami-card: #ffffff;
  --ami-radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Outfit', sans-serif;
  background: var(--ami-bg);
  color: var(--ami-text);
  line-height: 1.5;
}

.site-header {
  background: linear-gradient(135deg, var(--ami-dark) 0%, #16213e 100%);
  border-bottom: 3px solid var(--ami-cyan);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header img {
  height: 42px;
  width: auto;
}

.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.site-header .tagline {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
}

main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1rem 2rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--ami-card);
  border: 1px solid var(--ami-border);
  border-radius: var(--ami-radius);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-head h2 { margin-bottom: 0; }

.status,
.note,
.selected,
.ip-line {
  color: var(--ami-muted);
  font-size: 0.95rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--ami-border);
  background: #fff;
  color: var(--ami-text);
  border-radius: var(--ami-radius);
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--ami-cyan);
}

.btn-primary {
  background: var(--ami-magenta);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  min-width: 7.5rem;
}

.btn-primary:hover:not(:disabled) {
  background: #d4196d;
  border-color: transparent;
}

.btn-primary.running {
  background: #c62828;
}

.btn-primary.is-disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.server-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.server {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--ami-radius);
  border: 1px solid var(--ami-border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.server:hover { border-color: var(--ami-cyan); }
.server.is-selected {
  border-color: var(--ami-cyan);
  box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.18);
}
.server.is-down { opacity: 0.72; }

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--ami-yellow);
}
.dot.ok { background: #1db954; }
.dot.bad { background: var(--ami-magenta); }
.dot.checking {
  background: var(--ami-cyan);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.meta { min-width: 0; }
.name {
  font-weight: 600;
  margin: 0 0 0.15rem;
  color: var(--ami-text);
}
.sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ami-muted);
  word-break: break-all;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 198, 255, 0.12);
  color: #007aa3;
  white-space: nowrap;
}

.selected { margin: 0 0 1rem; }
.actions { margin-bottom: 1.25rem; }
.note { margin: 1.25rem 0 0; font-size: 0.9rem; }
.note a { color: #007aa3; }

code {
  font-size: 0.88em;
  background: rgba(26, 26, 46, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--ami-dark);
}

.test {
  text-align: center;
}

.test-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.test-area {
  width: 9.5rem;
  padding: 0.85rem 0.5rem;
  border: 1px solid var(--ami-border);
  border-radius: var(--ami-radius);
  background: #fafbfd;
}

.test-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ami-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meter-text {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0.35rem 0 0.1rem;
  color: var(--ami-dark);
  min-height: 1.2em;
}

.meter-text:empty::before {
  content: "—";
  color: #b0b8c4;
}

#dlText { color: #007aa3; }
#ulText { color: #0a7a3b; }
#pingText,
#jitText { color: var(--ami-magenta); }

.unit {
  font-size: 0.8rem;
  color: var(--ami-muted);
}

.ip-line {
  margin: 1rem 0 0;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--ami-muted);
  font-size: 0.8rem;
}

.site-footer a { color: #007aa3; }

@media (max-width: 560px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
