/* DPO Waitlist — plain styling */

:root {
  --accent: #ED1F89;
  --cyan:   #0EA6BB;
  --ink:    #1A1A1A;
  --muted:  #6B6B6B;
  --rule:   #E5E5E5;
  --error:  #C0273A;
  --success: #2F8542;
}

.page-main      { --accent: #ED1F89; }
.page-classics  { --accent: #0EA6BB; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

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

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }

h1, h2, h3 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

/* Layout shell */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.marquee {
  display: block;
  margin: 0 0 1.5rem;
}
.marquee__link { display: block; }
.marquee__img {
  display: block;
  width: 100%;
  height: auto;
}
.lang-switcher {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.lang-switcher__link {
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.7;
}
.lang-switcher__link:hover { opacity: 1; }

.layout__main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Hero — just a heading + lede block, no decorations */
.hero { margin: 0 0 1.5rem; }
.hero__title { font-size: 2rem; margin: 0 0 0.5rem; }
.hero__lede  { color: var(--muted); margin: 0 0 1rem; max-width: 60ch; }

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

/* Card — plain white panel with a thin border */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 1.25rem;
  margin: 0 0 1.5rem;
}

.card__title { font-size: 1.15rem; margin: 0 0 1rem; }

/* Link from a tournament page to its public participant list. Follows the
   page accent (Main pink / Classics teal). */
.participants-link { margin: 0 0 1.5rem; }
.participants-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.participants-link a:hover { text-decoration: underline; }

/* Form — native input styling, just spacing + labels */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.25rem; }

.form-row label {
  font-size: 0.9rem;
  font-weight: 500;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input:not([type]) {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid #B0B0B0;
  border-radius: 3px;
  width: 100%;
}

.form-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form-row label:has(input[type="checkbox"]) {
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Button — plain solid */
.btn {
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
}
.btn:hover { filter: brightness(0.92); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--ghost {
  background: #fff;
  color: var(--ink);
  border-color: #B0B0B0;
}
.btn--ghost:hover { background: #f5f5f5; }

/* Alerts */
.alert {
  padding: 0.65rem 0.9rem;
  margin: 0 0 1rem;
  border-left: 3px solid var(--accent);
  background: #f7f7f7;
  font-size: 0.95rem;
}
.alert-danger { border-left-color: var(--error); color: var(--error); }
.alert-info { border-left-color: var(--accent); }
.alert-success { border-left-color: var(--success); color: var(--success); }

/* Queue list */
.queue { list-style: none; padding: 0; margin: 0; }
.queue-empty { color: var(--muted); font-style: italic; margin: 0; }

/* Public participant lists (per-block / classics) */
.block-section { margin: 0 0 2rem; }
.block-section__title {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
}
.participant-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.participant-list__item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid var(--rule);
}
.participant-list__name {
  font-weight: 500;
}
/* Pending block-switch request — same warning colour as the admin badge. */
.participant-list__switch {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  background: var(--warning, #b25b00);
  color: #fff;
  border-radius: 3px;
  white-space: nowrap;
}
.participant-list__ifpa {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.participant-list__ifpa:hover {
  color: var(--accent);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.queue-item:last-child { border-bottom: 0; }

.queue-item .position {
  min-width: 2.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.queue-item .name { font-weight: 500; }
.queue-item .leader { flex: 1; }

.badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  white-space: nowrap;
}

/* Admin */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
}
.admin-header h1 { font-size: 1.5rem; margin: 0; }

/* Admin shell: persistent left sidebar + content column */
.admin-shell {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.admin-shell__content {
  flex: 1;
  min-width: 0;
}

.admin-nav {
  flex: 0 0 12rem;
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 0.9rem;
}
.admin-nav__brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  font-size: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.admin-nav__group { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav__heading {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.admin-nav__heading.is-active { color: var(--accent); }
.admin-nav__list {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.admin-nav__list a {
  text-decoration: none;
  color: var(--muted);
  display: block;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
.admin-nav__list a:hover { color: var(--ink); background: #f5f5f5; }
.admin-nav__list a.is-active {
  color: var(--accent);
  font-weight: 600;
  background: #fdeef6;
}
.admin-nav__signout {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: var(--muted);
}
.admin-nav__signout:hover { color: var(--ink); }

/* Stack the sidebar above content on narrow viewports */
@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-nav {
    position: static;
    flex-basis: auto;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
  }
  .admin-nav__brand { border-bottom: none; padding-bottom: 0; }
  .admin-nav__signout { margin-top: 0; padding-top: 0; border-top: none; margin-left: auto; }
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}
.admin-actions .inline-form { display: inline; }

.admin-entries {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-entries th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  background: #f7f7f7;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}
.admin-entries td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.admin-entries tr.state-pendingverification td { color: var(--muted); }
.admin-entries tr.state-cancelled td { color: var(--muted); text-decoration: line-through; }
.admin-entries tr.state-expired td { color: var(--muted); }
.admin-entries tr.state-claimed td { color: var(--success); }

/* Players (step 2) */
.admin-header__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.admin-block h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
}
.admin-requests {
  margin-bottom: 2rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.75rem 1rem 1rem;
  background: #fbfaff;
}
.admin-requests h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }

.admin-entries tr.row-has-request td {
  background: #fff7e6;
}

.badge--request {
  background: var(--warning, #b25b00);
}

/* A source-mismatch change-log entry needs admin attention: the DB kept its
   value and the source system has to be reconciled. Match the warning
   convention used for pending block requests. */
.change-history__action--mismatch {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  background: var(--warning, #b25b00);
  color: #fff;
  border-radius: 3px;
  white-space: nowrap;
}
.badge--classics {
  background: #5b6770;
}

.btn--small {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
}
.select-inline {
  padding: 0.15rem 0.3rem;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

.form-fieldset {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.form-fieldset legend { font-weight: 600; padding: 0 0.4rem; }

/* Admin pages use the full window width (dense tables), not the 720px public column. */
.layout__main--wide { max-width: none; }

.admin-entries--wide { table-layout: auto; }

/* Waitlist queue header + Waiting/all filter toggle */
.queue-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.queue-header h2 { margin: 0; }
.queue-filter { display: flex; gap: 0.35rem; }

/* Admin queue manipulation (reorder / reactivate / state / note) */
.nowrap { white-space: nowrap; }

.btn--danger {
  color: var(--error);
  border-color: var(--error);
}
.btn--danger:hover { background: #fdf0f0; }

.admin-entries__actions .inline-form { display: inline-block; margin: 0 0.15rem 0.15rem 0; }

.admin-entries__note { min-width: 12rem; }
.note-form { display: flex; flex-direction: row; align-items: center; gap: 0.25rem; }
.note-form textarea {
  font: inherit;
  font-size: 0.8rem;
  flex: 1;
  min-width: 0;
  height: 1.9rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  resize: vertical;
  line-height: 1.3;
}
.note-form .btn { flex: none; align-self: stretch; }

.reactivate-label { font-size: 0.8rem; color: var(--muted); }
.reactivate-pos {
  width: 3.5rem;
  padding: 0.15rem 0.3rem;
  font-size: 0.8rem;
  margin: 0 0.35rem 0 0.15rem;
}

/* Sortable column headers */
.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.sort-link:hover { text-decoration: underline; }
.sort-link--active { color: var(--accent); }

/* Tournament chooser cards on the players landing */
.tournament-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.tournament-card {
  flex: 1 1 240px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tournament-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.tournament-card h2 { margin: 0 0 0.25rem; }
.tournament-card__count { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.25rem; }

/* Validation (Blazor EditForm) */
.invalid { border-color: var(--error) !important; }
.validation-message { color: var(--error); font-size: 0.875rem; }
.text-danger { color: var(--error); }

/* Blazor error boundary */
.blazor-error-boundary {
  background: var(--error);
  color: white;
  padding: 1rem 1.25rem;
}
.blazor-error-boundary::after { content: "An error has occurred." }

/* Toast notifications — float over the page, independent of scroll position */
.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  color: var(--ink);
  border-left: 4px solid var(--muted);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
  animation: toast-in 0.18s ease-out;
}
.toast--info    { border-left-color: var(--cyan); }
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--error); }
.toast__message { flex: 1; }
.toast__close {
  flex: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.toast__close:hover { color: var(--ink); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

