/* pzMadServer Web Panel — minimal styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #0f3460;
  --accent: #e94560;
  --text: #eaeaea;
  --text-muted: #888;
  --ok: #4caf50;
  --warn: #ff9800;
  --danger: #f44336;
  --radius: 8px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* === Auth pages === */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  margin: 2rem;
}
.auth-card h1 { font-size: 1.5rem; color: var(--accent); margin-bottom: 0.25rem; }
.auth-card h2 { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }

form { display: flex; flex-direction: column; gap: 0.75rem; }
label { font-size: 0.85rem; color: var(--text-muted); }
input[type=text], input[type=password] {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  width: 100%;
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary, button[type=submit] { background: var(--accent); color: #fff; width: 100%; padding: 0.7rem; }
.btn-success { background: var(--ok); color: #fff; }
.btn-warning { background: var(--warn); color: #000; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--text-muted); color: var(--text); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.85rem; }

/* === Alerts === */
.alert {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert.hidden { display: none; }
.alert-error { background: rgba(244,67,54,0.15); border: 1px solid var(--danger); color: var(--danger); }
.alert-ok    { background: rgba(76,175,80,0.15); border: 1px solid var(--ok); color: var(--ok); }

/* === Nav === */
.navbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
}
.nav-brand { font-weight: 700; font-size: 1.1rem; color: var(--accent); flex: 1; }
.nav-user  { color: var(--text-muted); font-size: 0.9rem; }

/* === Layout === */
.container { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.1rem; margin-bottom: 1rem; }

/* === Status badge === */
.status-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--surface2);
  margin-bottom: 1rem;
}
.status-running  { background: rgba(76,175,80,0.2); color: var(--ok); }
.status-exited,
.status-stopped  { background: rgba(244,67,54,0.2); color: var(--danger); }
.status-unknown  { background: rgba(136,136,136,0.2); color: var(--text-muted); }

/* === Actions === */
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

code { background: var(--surface2); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }

/* === Nav links === */
.nav-links { display: flex; gap: 0.25rem; flex: 1; margin-left: 1.5rem; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--surface2); color: var(--text); font-weight: 600; }

/* === Status row === */
.status-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* === Uptime === */
.uptime-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 1000;
  transition: opacity 0.3s;
}
.toast.hidden { display: none; }
.toast-ok    { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info  { background: var(--surface2); color: var(--text); }

/* === Confirm dialog === */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
}
.confirm-overlay.hidden { display: none; }
.confirm-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 360px;
  width: 90%;
}
.confirm-box p { margin-bottom: 1.5rem; line-height: 1.6; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* === Milestones === */
.milestones { display: flex; flex-direction: column; gap: 0.5rem; }
.milestone-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.milestone-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.milestone-name { flex: 1; color: var(--text); }
.milestone-time { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

/* === Players page === */
.player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface2);
}
.player-row:last-child { border-bottom: none; }
.player-name { flex: 1; font-size: 0.95rem; }
.player-actions { display: flex; gap: 0.4rem; }
.players-empty { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }

/* === Connection info === */
.conn-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.conn-row  { display: flex; align-items: center; gap: 0.75rem; }
.conn-label { width: 80px; font-size: 0.85rem; color: var(--text-muted); flex-shrink: 0; }
.conn-value { font-family: 'Cascadia Code', 'Fira Mono', monospace; font-size: 0.95rem; flex: 1; }
.conn-copy  { padding: 0.2rem 0.5rem; font-size: 0.8rem; }

/* === Logs page === */
.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.logs-selectors { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.logs-actions { display: flex; align-items: center; gap: 0.75rem; }
.log-select {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}
.autoscroll-label { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.log-card { padding: 0; overflow: hidden; }
.log-output {
  background: #0d0d1a;
  color: #c8c8d4;
  font-family: 'Cascadia Code', 'Fira Mono', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 1rem;
  height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}
.log-output .log-error     { color: #f44336; }
.log-output .log-warn      { color: #ff9800; }
.log-output .log-milestone { color: #4caf50; font-weight: 600; }
.log-output .log-info      { color: #90caf9; }
