html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

body.baseball {
    background-color: #ffffff;
    color: #333;
}

body.football {
    background-color: #ffffff;
    color: #222;
}

body.hockey {
    background-color: #ffffff;
    color: #111;
}

body.default {
    background-color: #ffffff;
    color: #000;
}

body.baseball .navbar {
    background-color: #6c757d;
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.constitution-card {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 1rem;
    background-color: #f9f9f9;
}

.card-header {
    background: none;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: left;
    width: 100%;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5rem;
}

.card-body {
    padding-left: 1rem;
}

.fab-container .btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    border: 1px solid rgba(0,0,0,0.1);
}

.fab-container .btn {
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.list-group-item a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.organization-view .trophy-summary img {
    height: 20px;
    width: 20px;
}

.organization-view .trophy-summary .badge {
    font-size: 0.65rem;
    padding: 0.1em 0.3em;
}

.coming-soon-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s infinite;
}

.watch-icon {
    cursor: pointer;
    font-weight: bold;
    font-style: normal;
    display: inline-block;
}

.watch-icon.add {
    color: #080 !important; /* green */
}

.watch-icon.remove {
    color: #d00 !important; /* red */
}

/* Prevent Bootstrap or theme from overriding with link styles */
.watch-icon.add:visited,
.watch-icon.add:active,
.watch-icon.add:hover,
.watch-icon.add:focus {
    color: #080 !important;
}

.watch-icon.remove:visited,
.watch-icon.remove:active,
.watch-icon.remove:hover,
.watch-icon.remove:focus {
    color: #d00 !important;
}


@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

html {
    scroll-padding-top: calc(var(--nav-height) + var(--league-expanded-height));
}

/* Hide number input spinners globally */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Standardized delete button for admin grids */
.btn-del-row {
    color: #dc3545;
    background: none;
    border: none;
    padding: .1rem .3rem;
    font-size: .9rem;
    cursor: pointer;
}
.btn-del-row:hover {
    color: #a11;
}

/* ──────────────────────────────────────────────────────────────────────────
   Mobile safety net (Scope 1)
   Any wide <table> inside main content horizontally scrolls on small screens
   rather than overflowing the viewport. Also relaxes container padding and
   bumps tap-target sizing for touch. Hand-tuned responsive layouts per page
   should still be added (Scope 2+) but this is the floor — nothing renders
   off-screen.
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    main.container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Wrap any raw table in a scroll container. `.table-responsive-auto`
       can be added to a parent to opt out (e.g. small summary tables that
       already fit). Targets tables that are NOT already inside a
       `.table-responsive` wrapper, so hand-tuned pages aren't double-wrapped. */
    main.container table.table:not(.table-responsive table):not(.no-mobile-scroll) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Report-partial and player-search tables use bespoke classes instead of
       `.table`, so the rule above misses them. They set width:100% +
       white-space:nowrap with no scroll wrapper — give them the same
       horizontal-scroll treatment on phones. */
    main.container .tx-tbl,
    main.container .dh-tbl,
    main.container .cuts-tbl,
    main.container .lrpt-tbl,
    main.container .rsz-tbl,
    main.container .pros-tbl,
    main.container .wc-tbl,
    main.container .wcbt-tbl,
    main.container .results-table,
    main.container .prospect-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Touch target floor — Apple HIG / WCAG 2.5.5 is 44×44px. Applies only
       to action buttons inside tables (Edit/Delete/Propose style icons)
       which are otherwise cramped on mobile. */
    main.container table.table .btn-sm,
    main.container table.table .btn-del-row {
        min-height: 32px;
        min-width: 32px;
    }

    /* Tabs wrap instead of overflowing on phones. Pill tabs at the top of
       Team and League pages otherwise push off-screen. */
    .nav-tabs {
        flex-wrap: wrap;
    }
    .nav-tabs .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* Helpers for per-column hide at small breakpoints — used by Scope 2+ hand
   tuning but defined here so any view can opt in.
     .col-hide-sm  : hide at <576px (xs)
     .col-hide-md  : hide at <768px (sm and below) */
@media (max-width: 575.98px) { .col-hide-sm { display: none !important; } }
@media (max-width: 767.98px) { .col-hide-md { display: none !important; } }

/* ──────────────────────────────────────────────────────────────────────────
   Scope 2 — hand-tuned responsive rules for high-traffic pages
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* ── Rosters (Team tabs) — pin player name column ─────────────────────
       All _TeamRoster*.cshtml partials wrap the table in .compact-table and
       put the player name in the first column. Pinning it keeps the name
       visible while the user horizontally scrolls through 25+ stat columns. */
    .compact-table table thead th:first-child,
    .compact-table table tbody td:first-child,
    .compact-table table tfoot td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
    }
    .compact-table table thead th:first-child { background: #f8f9fa; }
    .compact-table table.table-striped > tbody > tr:nth-of-type(odd)  > td:first-child { background: #f2f2f2; }
    .compact-table table.table-striped > tbody > tr:nth-of-type(even) > td:first-child { background: #fff; }
    .compact-table table > tbody > tr.table-secondary > td:first-child { background: #d3d4d5; }
    .compact-table table > tbody > tr.text-muted > td:first-child { background: #fff; }
    .compact-table table td:first-child,
    .compact-table table th:first-child {
        box-shadow: 2px 0 3px -1px rgba(0, 0, 0, 0.15);
    }

    /* ── League Stats tables — pin Player column (col 2; col 1 is rank #) ── */
    .stats-table thead th:nth-child(2),
    .stats-table tbody td:nth-child(2) {
        position: sticky;
        left: 2.25rem; /* leaves the # column visible to its left */
        z-index: 2;
        box-shadow: 2px 0 3px -1px rgba(0, 0, 0, 0.15);
    }
    .stats-table thead th:first-child,
    .stats-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        min-width: 2.25rem;
    }
    .stats-table thead.table-dark th:first-child,
    .stats-table thead.table-dark th:nth-child(2) { background: #212529; }
    .stats-table tbody tr:nth-of-type(odd)  > td:first-child,
    .stats-table tbody tr:nth-of-type(odd)  > td:nth-child(2) { background: #f2f2f2; }
    .stats-table tbody tr:nth-of-type(even) > td:first-child,
    .stats-table tbody tr:nth-of-type(even) > td:nth-child(2) { background: #fff; }

    /* ── Draft report tables — column headers non-wrapping, bigger watch
       checkbox tap target. First column is variable (watch checkbox,
       draft button, or name depending on permissions) so we don't pin it. */
    .report-table thead th { white-space: nowrap; }
    .report-table td input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    .report-table td .btn-sm {
        padding: 0.35rem 0.55rem;
    }
}