/* myITM — Iron Team Mechelen brand on top of vanilla Bootstrap 5. */

:root {
    --itm-teal: #18becf;
    --itm-blue: #3f6fb5;
    --itm-purple: #7b3fa0;
    --itm-magenta: #c0368f;
    --itm-red: #e62e47;
    --itm-accent: #138496;       /* club accent (teal from the logo) — used for member/club indicators */
    --itm-gradient: linear-gradient(90deg, var(--itm-teal), var(--itm-blue), var(--itm-purple), var(--itm-magenta), var(--itm-red));
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Header (Bootstrap "headers" example): a dark brand + icon-nav row over a light search/account
   row, topped by the brand-gradient accent. */
.app-header {
    margin-bottom: 1.5rem;
}
.app-header-accent {
    height: 3px;
    background: var(--itm-gradient);
}
/* Icon-above-label nav: centred items, muted by default, white + teal underline on the active page. */
.app-nav .nav-link {
    border-radius: 0;
    border-bottom: 2px solid transparent;
    padding: .3rem .55rem;
    line-height: 1.15;
    transition: color .12s ease, border-color .12s ease;
}
.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
    color: #fff;
}
.app-nav .nav-link.active {
    border-bottom-color: var(--itm-teal);
}

/* The "myITM" wordmark sits in a light chip so the gradient reads cleanly on the dark bar. */
.brand-chip {
    padding: .3rem .7rem;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: .6rem;
    background: rgba(255, 255, 255, .24);
    line-height: 1;
    transition: border-color .12s ease, background-color .12s ease;
}
.brand-chip:hover {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .32);
}

/* "beta" status tag next to the wordmark — a small teal-tinted pill that stays on-brand. */
.beta-tag {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    line-height: 1;
    padding: .2rem .42rem;
    border-radius: 1rem;
    color: var(--itm-teal);
    background: rgba(24, 190, 207, .15);
    border: 1px solid rgba(24, 190, 207, .55);
    white-space: nowrap;
}

/* Subtle race-series mark shown in front of the location (e.g. the Ironman M-dot). */
.brand-mark {
    margin-right: .3rem;
}
.mdot-img {
    width: 1em;
    height: 1em;
    vertical-align: -.15em;
    object-fit: contain;
}

/* "Ironman" achievement badge on a profile (full-distance Ironman finisher). */
.brand-ironman-badge {
    background-color: #fff;
    color: #c8102e;
    border-color: rgba(200, 16, 46, .4) !important;
}

/* Breadcrumbs (Bootstrap "breadcrumbs" example): a chevron divider + a leading home icon. */
.breadcrumb {
    --bs-breadcrumb-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%23adb5bd'/%3E%3C/svg%3E");
}
.breadcrumb-item .bi {
    vertical-align: -2px;
}

/* Club accent badge/pill (used for member + club indicators instead of warning-orange).
   Slightly darker than the link accent so white text clears WCAG AA contrast. */
.text-bg-itm {
    background-color: #0f6f7e !important;
    color: #fff !important;
}

/* Quarter-triathlon distance badge — brand purple with white text. Stock .text-bg-info is a bright
   cyan that forces low-contrast black text; purple keeps all four distances distinct and doesn't
   clash with the teal club (.text-bg-itm) badge that sits on the same cards. */
.text-bg-quarter {
    background-color: var(--itm-purple) !important;
    color: #fff !important;
}

/* Cards that are links lift subtly on hover (home, awards, records). */
a .card,
.card.shadow-sm {
    transition: transform .15s ease, box-shadow .15s ease;
}
a:hover .card {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12) !important;
}

/* Result-table link affordances: the position opens that race's analysis (drill-in chevron),
   the name opens the athlete profile (underlines on hover). Keeps both targets, clearly distinct. */
.to-result {
    white-space: nowrap;
}
.to-result::after {
    content: "›";
    margin-left: .2rem;
    color: var(--itm-accent);
    font-weight: 700;
    opacity: .5;
}
tr:hover .to-result::after {
    opacity: 1;
}
.to-athlete {
    text-decoration: none;
}
.to-athlete:hover {
    text-decoration: underline;
}

/* Category-podium labels tinted gold / silver / bronze (next to the medal emoji). */
.badge.medal-1 { background-color: #f4c33b; color: #3a2d00; border: 0; }
.badge.medal-2 { background-color: #c7ced6; color: #2b3036; border: 0; }
.badge.medal-3 { background-color: #d4904f; color: #38200a; border: 0; }

/* Brand wordmark with the club's gradient. */
.brand-itm {
    background: var(--itm-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* De Clubteller hero card: centered total with three evenly-divided discipline columns. */
.clubteller-bar {
    width: 96px;
    height: 4px;
    border-radius: 2px;
    background: var(--itm-gradient);
}
.clubteller-seg {
    padding: .25rem .5rem;
}
.clubteller-seg + .clubteller-seg {
    border-left: 1px solid rgba(255, 255, 255, .15);
}

/* Highlight club members in result tables. */
tr.is-member {
    background-color: rgba(19, 132, 150, 0.08);
}

tr.is-member td:first-child {
    box-shadow: inset 3px 0 0 var(--itm-accent);
}

/* Chart containers. */
.chart-box {
    width: 100%;
    height: 560px;
}

.chart-box-sm {
    width: 100%;
    height: 360px;
}

/* Monospace, right-aligned race times. */
.time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Sticky header: the column titles ride the page scroll on long result tables. */
table.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f1f3f5;
}

/* Keep the athlete-name column visible while scrolling a wide table sideways. */
table.table-sticky th.col-name,
table.table-sticky td.col-name {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #fff;
}

table.table-sticky thead th.col-name {
    z-index: 4;
}

table.table-sticky tr.is-member td.col-name {
    /* solid tint so the sticky column doesn't show rows bleeding underneath */
    background-color: #e3f1f3;
}

/* Competition links inside fun facts: kept uniformly muted (never the loud default link colour, and
   not the bold value colour either) so they recede — just clickable, with an underline on hover. */
.fact-link {
    color: var(--bs-secondary-color, #6c757d);
    text-decoration: none;
}

.fact-link:hover,
.fact-link:focus {
    color: var(--bs-secondary-color, #6c757d);
    text-decoration: underline;
}

/* ---- In-app feedback widget (feedback.js) ---- */
/* White text sits on #0f6f7e (the AA-safe club teal, same as .text-bg-itm) — the lighter
   --itm-accent #138496 fails WCAG AA for text. The brighter accent is fine for the graphic
   highlight outline (a 3:1 surface), so the overlay keeps it. */
.feedback-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1035;
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #0f6f7e;
    color: #fff;
    box-shadow: 0 .35rem .9rem rgba(0, 0, 0, .28);
    cursor: pointer;
    transition: background-color .12s ease, transform .12s ease;
}
.feedback-fab:hover { background: #0a4f5a; transform: translateY(-2px); }
.feedback-fab:focus-visible { outline: 3px solid rgba(19, 132, 150, .5); outline-offset: 2px; }

.feedback-panel {
    position: fixed;
    right: 1rem;
    bottom: 4.75rem;
    z-index: 1045;
    width: min(22rem, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: .6rem;
    display: none;
}
.feedback-panel.is-open { display: block; }
.feedback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .8rem;
    background: #0f6f7e;
    color: #fff;
    border-radius: .6rem .6rem 0 0;
}
.feedback-body { padding: .8rem; }
.feedback-submit { background: #0f6f7e; color: #fff; }
.feedback-submit:hover, .feedback-submit:focus { background: #0a4f5a; color: #fff; }
.feedback-submit:disabled { opacity: .65; }
.feedback-target-chip {
    display: inline-block;
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    padding: .1rem .45rem;
    border-radius: 1rem;
    background: rgba(15, 111, 126, .12);
    color: #0f6f7e;
    border: 1px solid rgba(15, 111, 126, .4);
}

.feedback-overlay {
    position: fixed;
    z-index: 1040;
    pointer-events: none;
    display: none;
    background: rgba(19, 132, 150, .18);
    border: 2px solid var(--itm-accent);
    border-radius: 3px;
}
.feedback-hint {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1046;
    display: none;
    padding: .5rem 1rem;
    text-align: center;
    font-size: .9rem;
    background: #0f6f7e;
    color: #fff;
    box-shadow: 0 .15rem .5rem rgba(0, 0, 0, .2);
}
body.feedback-picking,
body.feedback-picking * { cursor: crosshair !important; }
