/* styles.css */

:root {
  color-scheme: light;
  --bg: #0b1220;
  --panel: #111a2e;
  --text: #e6edf6;
  --muted: #9fb0c6;
  --border: #26314f;
  --accent: #6aa8ff;
  --danger: #ff6a6a;
  --ok: #39d98a;
  --warn: #ffd36a;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 26, 46, 0.65);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 650;
}

main {
  padding: 18px 20px 28px;
  max-width: 1100px;
  margin: 0 auto;
}

a {
  color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: 360px 1fr;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input,
textarea,
select {
  background: #0b1324;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

textarea {
  min-height: 90px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

button {
  background: #162646;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: #1f4ea5;
  border-color: #2f65cc;
}

button.danger {
  background: rgba(255, 106, 106, 0.15);
  border-color: rgba(255, 106, 106, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  padding: 9px 10px;
  border-radius: 10px;
  background: #0b1324;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tab.active {
  color: var(--text);
  border-color: #35528a;
  background: rgba(106, 168, 255, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.pill.ok {
  color: var(--ok);
  border-color: rgba(57, 217, 138, 0.4);
}

.pill.warn {
  color: var(--warn);
  border-color: rgba(255, 211, 106, 0.45);
}

.pill.bad {
  color: var(--danger);
  border-color: rgba(255, 106, 106, 0.45);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.status strong {
  color: var(--text);
}

.two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 980px) {
  .two {
    grid-template-columns: 1fr 1fr;
  }
}

footer {
  text-align: center;
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  margin-top: 20px;
}

footer p {
  margin: 0;
}

footer #apiVersion,
footer #webVersion {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* Status row with last refresh */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.last-refresh {
  font-size: 11px;
  opacity: 0.8;
}

#lastRefresh {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* Action buttons inline */
.actions-cell {
  white-space: nowrap;
}

.actions-cell button {
  padding: 6px 10px;
  font-size: 12px;
}

.actions-cell button + button {
  margin-left: 4px;
}

/* Refresh icon button */
.refresh-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.refresh-icon-btn:hover {
  background: rgba(106, 168, 255, 0.15);
}

.refresh-icon {
  transition: transform 0.3s ease;
}

.refresh-icon-btn.spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.auto-refresh-info {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.7;
}
