/* Colours used across the site: Alliance blue & gold */
:root {
  --bg: #0b1426;           /* deep navy */
  --panel: #13213d;        /* royal blue */
  --panel-2: #1a2c50;      /* lighter blue for inputs and rows */
  --border: #24406e;
  --text: #eef2f8;
  --muted: #9fb0cc;
  --accent: #e3b448;       /* Alliance gold */
  --danger: #e05a52;
  --discord: #5865f2;
}

/* A soft blue glow at the top of the page */
body {
  background-image: radial-gradient(ellipse at top, rgba(36, 64, 110, 0.55), transparent 60%);
  background-attachment: fixed;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0 0 12px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 2px solid var(--accent);
}
.brand { display: flex; align-items: center; }
.brand img { height: 40px; width: auto; display: block; }
.brand:hover { text-decoration: none; }
.login-logo { width: 260px; max-width: 100%; height: auto; margin: 4px auto 16px; display: block; }
#nav { display: flex; gap: 16px; flex: 1; }
#nav a { color: var(--text); }
#user-box { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; }

/* Page layout */
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}
.card.center { max-width: 460px; margin: 60px auto; text-align: center; }
.card.error { border-color: var(--danger); color: #f2b8b6; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error-text { color: #f2b8b6; }

details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 14px; }

/* Buttons */
.btn {
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { filter: brightness(1.1); }
.btn.small { padding: 4px 10px; font-size: 0.85rem; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: white; }
.btn.discord { background: var(--discord); color: white; padding: 12px 24px; font-size: 1rem; }
.link-btn { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font-size: 0.85rem; }

/* Forms */
input, select, textarea {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font: inherit;
  width: 100%;
}
input[type="checkbox"] { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; margin-bottom: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.form-actions { display: flex; gap: 10px; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.table tr.inactive td { opacity: 0.5; }

/* Character page */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.badge { background: var(--accent); color: #1a1a1a; border-radius: 4px; padding: 1px 8px; font-size: 0.75rem; font-weight: 700; vertical-align: middle; }
.muted-badge { background: var(--panel-2); color: var(--muted); }

/* Menu: highlight the page you're on */
#nav a.active { color: var(--accent); font-weight: 600; }

/* Raid teams */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.team-grid .card { margin-bottom: 0; }
.team-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.team-head h2 { margin: 0; }
.role-counts { margin: 4px 0 12px; }
.role-group { margin-bottom: 12px; }
.role-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.member-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.row-actions { display: flex; gap: 12px; }
.link-btn.neutral { color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.inline-form select { flex: 1; }

/* Recipes */
.recipe { padding: 14px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 0.9rem; }
.chip-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.chip-x:hover { color: var(--danger); }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.small-select { width: auto; font-size: 0.85rem; padding: 4px 8px; }

/* Loot */
.mt { margin-top: 14px; }
.table tr.editing td { background: var(--panel-2); }
.table td input, .table td select { min-width: 90px; }
#gargul-text { font-family: Consolas, monospace; font-size: 0.85rem; margin-bottom: 8px; }

/* BiS */
.table tr.got-it td { background: rgba(80, 160, 90, 0.12); }
.badge.alliance { background: #1f4fa3; color: white; }
.badge.horde { background: #8c1616; color: white; }
.compare-row { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.spec-class-name { font-weight: 700; margin-bottom: 4px; }
.spec-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 6px; border-radius: 4px; }
.spec-row.current { background: var(--panel-2); }

/* Notes */
.note { border-top: 1px solid var(--border); padding: 10px 0; }
.note-meta { display: flex; gap: 12px; align-items: baseline; font-size: 0.9rem; }
.note-body { white-space: pre-wrap; margin-top: 4px; }
