/* app.css — Archery GB Rankings viewer — AGB brand colours */

/* ── Page switching ─────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Loading overlay ────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-overlay.hidden { display: none; }

/* ── Division chips row ─────────────────────────────────── */
.division-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 8px;
  background: #f4f5f8;
}

ion-chip {
  --background: #e8eaf0;
  --color: var(--agb-navy);
  font-weight: 500;
}

ion-chip[color="primary"] {
  --background: var(--agb-navy);
  --color: #ffffff;
}

/* ── Header / toolbar ───────────────────────────────────── */
ion-toolbar {
  --background: var(--agb-navy);
  --color: #ffffff;
}

ion-menu ion-toolbar {
  --background: var(--agb-navy);
}

/* ── Side menu ──────────────────────────────────────────── */
ion-menu ion-content {
  --background: #0f1e3d;
}

ion-menu ion-item {
  --background: transparent;
  --color: var(--agb-navy);
  --border-color: rgba(255,255,255,0.1);
  --min-height: 40px;
  font-size: 0.9rem;
}

ion-menu ion-item:hover {
  --background: rgba(255,255,255,0.08);
}

ion-menu ion-icon {
  color: var(--agb-red);
}

ion-menu ion-badge {
  --background: var(--agb-red);
}

.menu-section-header {
  --background: transparent;
  --color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 16px;
}

.menu-divider {
  --background: rgba(255,255,255,0.1);
  --padding-start: 0;
  min-height: 1px;
  margin: 4px 16px;
}

.link-icon {
  color: rgba(255,255,255,0.3) !important;
  font-size: 0.8rem;
}

/* ── Update notice lozenge ──────────────────────────────── */
.menu-footer {
  --background: #0f1e3d;
  padding: 12px 16px 20px;
}

.update-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--agb-navy);
  font-size: 0.75rem;
  line-height: 1.3;
}

.update-notice ion-icon {
  color: rgba(255,255,255,0.4) !important;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Rankings table ─────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  padding: 0 0 80px;
}

table#rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table#rankings-table thead th {
  background: var(--agb-navy);
  color: #ffffff;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 3px solid var(--agb-red);
}

table#rankings-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid #e8eaf0;
  transition: background 0.15s;
}

table#rankings-table tbody tr:hover {
  background: #eef0f6;
}

/* Highlight top 3 rows */
table#rankings-table tbody tr:nth-child(1) .rank-num { color: #c9a227; }
table#rankings-table tbody tr:nth-child(2) .rank-num { color: #808080; }
table#rankings-table tbody tr:nth-child(3) .rank-num { color: #a0522d; }

table#rankings-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

/* Column widths */
.col-rank  { width: 60px; white-space: nowrap; }
.col-name  { min-width: 140px; }
.col-pts   { width: 90px; text-align: right; font-weight: 700; color: var(--agb-navy); }
.col-ev    { width: 72px; text-align: right; color: #666; }

/* Hide event columns on mobile, show on larger screens */
.desktop-only { display: none; }

@media (min-width: 768px) {
  .desktop-only { display: table-cell; }
}

/* Rank column */
.rank-num  { font-weight: 700; font-size: inherit; margin-right: 4px; color: var(--agb-navy); }
.rank-up   { color: #2a9d2a; font-size: 0.7rem; }
.rank-down { color: var(--agb-red); font-size: 0.7rem; }

/* Athlete name + thumb */
.athlete-name { font-weight: 500; color: var(--agb-navy); }

.athlete-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
  border: 2px solid #e0e3ec;
}

/* Modal photo */
.modal-photo-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 16px 8px;
}

.modal-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--agb-navy);
  box-shadow: 0 4px 16px rgba(26,46,90,0.2);
}

/* Empty / error states */
.empty-msg {
  text-align: center;
  padding: 32px;
  color: #888;
}
.error-msg { color: var(--agb-red); }

/* No-points dash */
.no-pts { color: #ccc; }

/* ── Athlete modal ──────────────────────────────────────── */
ion-modal ion-toolbar {
  --background: var(--agb-navy);
  --color: #ffffff;
}

ion-badge[color="primary"] {
  --background: var(--agb-navy);
}
#landing-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ion-background-color, #fff);
  transition: opacity 0.4s ease;
}

#landing-page.hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-inner {
  text-align: center;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.landing-logo {
  width: 120px;
  margin-bottom: 0.5rem;
}