/* ============================================================
   Athletics Results Plugin — results.css  v2.0.0
   Matches the OAA PDF layout exactly:
   - Nav buttons row at top (scroll to section)
   - Search bar below nav
   - All categories visible, stacked
   - Dark header per category + red-dash event sub-headers
   ============================================================ */

/* ── Reset inside plugin ── */
.ar-wrap *,
.ar-wrap *::before,
.ar-wrap *::after {
    box-sizing: border-box;
}

.ar-wrap {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #1a2c3e;
    max-width: 1280px;
    margin: 0 auto 48px;
}

/* ── Meet banner ─────────────────────────────────────────── */
.ar-meet-banner {
    background: #0f2942;
    border-radius: 10px 10px 0 0;
    padding: 20px 24px 18px;
}

.ar-meet-title {
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.ar-meet-sub {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* ── Sticky bar: nav + search ────────────────────────────── */
.ar-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* ── Nav buttons row ─────────────────────────────────────── */
.ar-nav-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.ar-nav-row::-webkit-scrollbar { display: none; }

.ar-nav-btn {
    display: inline-block;
    padding: 13px 18px 11px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1;
}

.ar-nav-btn:hover {
    color: #0f2942;
    background: #f8fafc;
    text-decoration: none;
}

.ar-nav-active {
    color: #0f2942 !important;
    border-bottom-color: #d97706 !important;
    background: #ffffff !important;
}

/* ── Search row ──────────────────────────────────────────── */
.ar-search-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.ar-search-inner {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 500px;
}

.ar-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #94a3b8;
    pointer-events: none;
    flex-shrink: 0;
}

.ar-search-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 8px 34px 8px 33px;
    font-size: 0.8rem;
    font-family: inherit;
    color: #1a2c3e;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.4;
}
.ar-search-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}
.ar-search-input::placeholder { color: #94a3b8; }

.ar-search-clear {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 3px 5px;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.ar-search-clear:hover { color: #374151; }

.ar-count {
    font-size: 0.74rem;
    font-weight: 600;
    color: #d97706;
    white-space: nowrap;
    display: none;
}

/* ── Sections container ──────────────────────────────────── */
.ar-sections {
    border: 1px solid #e2e8f0;
    border-top: none;
}

/* ── Each category section ───────────────────────────────── */
.ar-section {
    scroll-margin-top: 90px; /* accounts for sticky bar height */
}

.ar-section + .ar-section {
    border-top: 3px solid #0f2942;
}

/* ── Category header — dark navy like PDF ────────────────── */
.ar-cat-header {
    background: #1a2c3e;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ar-cat-header-left {}

.ar-cat-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.ar-cat-meta {
    color: rgba(255,255,255,0.5);
    font-size: 0.73rem;
    margin-top: 3px;
}

.ar-export-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.22);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
.ar-export-btn:hover { background: rgba(255,255,255,0.2); }

/* ── Event block ─────────────────────────────────────────── */
.ar-event-block {
    background: #ffffff;
    padding: 20px 22px 22px;
}

.ar-event-block + .ar-event-block {
    border-top: 1px solid #f1f5f9;
}

/* ── Event sub-header — red dash + bold uppercase ────────── */
.ar-event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}

.ar-red-dash {
    width: 20px;
    height: 3px;
    background: #dc2626;
    border-radius: 2px;
    flex-shrink: 0;
}

.ar-event-name {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #1a2c3e;
}

/* ── Table scroll wrapper ────────────────────────────────── */
.ar-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
}

/* ── Results table ───────────────────────────────────────── */
.ar-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    font-size: 0.8rem;
}

/* Header row */
.ar-table thead tr { background: #1a2c3e; }

.ar-table thead th {
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.07);
}
.ar-table thead th:last-child { border-right: none; }

/* Body rows */
.ar-table tbody tr {
    border-bottom: 1px solid #edf2f7;
    transition: background 0.1s;
}
.ar-table tbody tr:last-child  { border-bottom: none; }
.ar-table tbody tr:nth-child(even) { background: #f8fafc; }
.ar-table tbody tr:hover           { background: #fff8f0 !important; }

.ar-table tbody td {
    padding: 9px 14px;
    vertical-align: middle;
    color: #374151;
    line-height: 1.35;
}

/* Place cell — centred */
.ar-td-place { text-align: center; white-space: nowrap; }

/* ── Place badges — gold / silver / bronze / plain ────────── */
.ar-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 5px;
    font-size: 0.69rem;
    font-weight: 700;
    min-width: 38px;
    text-align: center;
    line-height: 1.3;
}
.ar-b1 { background: #f59e0b; color: #ffffff; }   /* gold   */
.ar-b2 { background: #94a3b8; color: #ffffff; }   /* silver */
.ar-b3 { background: #d97706; color: #ffffff; }   /* bronze */
.ar-b4 { background: #f1f5f9; color: #64748b; font-weight: 500; } /* 4th+ */

/* ── Column-specific styles ──────────────────────────────── */
.ar-bib  { font-size: 0.7rem;  color: #94a3b8; font-family: 'Courier New', monospace; }
.ar-name { font-weight: 600;   color: #111827; }
.ar-dob  { color: #6b7280;     white-space: nowrap; }
.ar-rep  { color: #2563eb;     font-size: 0.79rem; }
.ar-perf { font-weight: 700;   color: #0f2942; font-family: 'Courier New', monospace;
           white-space: nowrap; text-align: right !important; }
.ar-cert { text-align: center !important; }

/* ── Certificate badges ──────────────────────────────────── */
.ar-cert-yes {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 0.69rem;
    font-weight: 700;
}
.ar-cert-no {
    color: #9ca3af;
    font-size: 0.69rem;
    font-weight: 500;
}

/* ── Error ───────────────────────────────────────────────── */
.ar-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 14px 18px;
    color: #991b1b;
    font-size: 0.85rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .ar-nav-btn        { padding: 11px 11px 9px; font-size: 0.6rem; }
    .ar-meet-title     { font-size: 1.1rem; }
    .ar-meet-banner    { padding: 16px 16px 14px; }
    .ar-cat-header     { padding: 12px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .ar-event-block    { padding: 14px 14px 16px; }
    .ar-search-row     { padding: 8px 14px; }
    .ar-nav-row        { padding: 0 14px; }
}
