/* ============================================================
   COLOR PALETTE & BOOTSTRAP OVERRIDES
   ============================================================ */
:root {
    --sf-navy:        #1a2744;
    --sf-navy-light:  #243560;
    --sf-gold:        #f59e0b;
    --sf-gold-light:  #fef3c7;
    --sf-surface:     #f0f4f8;

    /* Override Bootstrap primary */
    --bs-primary:         #1a2744;
    --bs-primary-rgb:     26, 39, 68;
    --bs-link-color:           #1a2744;
    --bs-link-color-rgb:       26, 39, 68;
    --bs-link-hover-color:     #243560;
    --bs-link-hover-color-rgb: 36, 53, 96;

}

body {
    background-color: var(--sf-surface);
    font-family: 'Inter', system-ui, sans-serif;
}

/* Bootstrap hardcodes --bs-dropdown-link-active-bg on .dropdown-menu, not :root */
.dropdown-menu {
    --bs-dropdown-link-active-bg:    var(--sf-navy);
    --bs-dropdown-link-active-color: #fff;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-sf {
    background-color: var(--sf-navy);
}
.navbar-sf .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.03em;
}
.navbar-sf .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}
.navbar-sf .nav-link:hover,
.navbar-sf .nav-link:focus,
.navbar-sf .nav-link.show {
    color: #fff !important;
}
/* ── Megamenu: no trailing border on the last sport column ── */
.navbar-sf .dropdown-menu .col:last-child {
    border-right: 0 !important;
}
/* ── Mobile nav: flatten dropend submenus into inline accordion ── */
@media (max-width: 991.98px) {
    /* Keep dropend toggle colour consistent when submenu is open on mobile */
    .navbar-sf .dropdown-item.dropdown-toggle:focus,
    .navbar-sf .dropdown-item.dropdown-toggle[aria-expanded="true"] {
        color: rgba(255, 255, 255, 0.85);
        background-color: transparent;
    }

    /* Submenu items sit inline below their parent toggle */
    .navbar-nav .dropend > .dropdown-menu {
        position: static;
        float: none;
        border: none;
        box-shadow: none;
        background-color: transparent;
        padding: 0;
        margin: 0;
        /* Hidden by default; toggled via JS */
        display: none;
    }

    /* Reveal submenu when the .show class is added by Bootstrap */
    .navbar-nav .dropend > .dropdown-menu.show {
        display: block;
    }

    /* Indent submenu items so they look nested */
    .navbar-nav .dropend > .dropdown-menu .dropdown-item {
        padding-left: 2rem;
        color: rgba(255, 255, 255, 0.75);
        background-color: transparent;
    }
    .navbar-nav .dropend > .dropdown-menu .dropdown-item:hover,
    .navbar-nav .dropend > .dropdown-menu .dropdown-item.active {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.1);
    }

    /* The caret on dropend toggles points down on mobile */
    .navbar-nav .dropend > .dropdown-toggle::after {
        content: "";
        display: inline-block;
        width: 0;
        height: 0;
        border-top: .3em solid;
        border-right: .3em solid transparent;
        border-left: .3em solid transparent;
        vertical-align: .15em;
        margin-left: .25em;
        border-bottom: 0;
    }

    /* The parent dropdown-menu (Fantasy Leagues / Admin) also sits inline */
    .navbar-nav .dropdown > .dropdown-menu {
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .navbar-nav .dropdown > .dropdown-menu > li > .dropdown-item {
        color: rgba(255, 255, 255, 0.85);
    }
    .navbar-nav .dropdown > .dropdown-menu > li > .dropdown-item:hover {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.1);
    }
    .navbar-nav .dropdown > .dropdown-menu .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.15);
    }
}
@media (min-width: 992px) {
    .navbar-sf .navbar-nav {
        align-items: center;
    }
}
.navbar-game-label-wrap {
    align-self: stretch;
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 0.75rem;
}
.navbar-game-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    white-space: nowrap;
}
.navbar-game-end {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    align-self: stretch;
    margin-left: 0.25rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.card-header {
    background-color: var(--sf-navy);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.card-header a {
    color: #fff;
}
.card-header i {
    color: var(--sf-gold);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
    border-left: 4px solid var(--sf-gold);
    padding-left: 0.75rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    color: var(--sf-navy);
}

/* ============================================================
   RANK BADGES
   ============================================================ */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}
.rank-1 { background: var(--sf-gold); color: var(--sf-navy); }
.rank-2 { background: #c0c0c0; color: #333; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: #e5e7eb; color: #555; }

/* ============================================================
   TABLES
   ============================================================ */
.table a {
    text-decoration: none;
}
.table a:hover {
    text-decoration: underline;
}
.table > tbody > tr > td {
    padding: 0px;
    border-top: 0px;
}
.table-responsive-stack th {
    display: none;
}
.table-responsive-stack td {
    display: block;
    padding: .25rem .5rem;
}
.table-responsive-stack td:first-child {
    padding-top: .5em;
}
.table-responsive-stack td:last-child {
    padding-bottom: .5em;
}
.table-responsive-stack td[data-th]:before {
    content: attr(data-th) ": ";
    font-weight: bold;
    display: inline;
}
.table-responsive-stack th, .table-responsive-stack td, .table-responsive-stack td.stat-value {
    text-align: left;
}

@media (min-width: 576px) {
    .table > tbody > tr > td {
        padding: 8px;
        border-top: 1px solid #ddd;
        line-height: 1.42857143;
        vertical-align: middle;
    }
    /* Align table cell text with card-header/card-footer text (which uses 1rem horizontal padding) */
    .card .table > tbody > tr > td,
    .card .table > thead > tr > th {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .table-responsive-stack td[data-th]:before {
        display: none;
    }
    .table-responsive-stack th, .table-responsive-stack td {
        display: table-cell;
        padding: 8px;
    }
    .table-responsive-stack td.stat-value {
        text-align: right;
    }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    --bs-pagination-active-bg:            var(--sf-navy);
    --bs-pagination-active-border-color:  var(--sf-navy);
    --bs-pagination-active-color:         #fff;
    --bs-pagination-color:                var(--sf-navy);
    --bs-pagination-hover-color:          var(--sf-navy-light);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    --bs-btn-bg: var(--sf-navy);
    --bs-btn-border-color: var(--sf-navy);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--sf-navy-light);
    --bs-btn-hover-border-color: var(--sf-navy-light);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--sf-navy-light);
    --bs-btn-active-border-color: var(--sf-navy-light);
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--sf-navy);
    --bs-btn-disabled-border-color: var(--sf-navy);
}

/* ============================================================
   PAID STATUS BADGE
   ============================================================ */
.paid-status-badge-link {
    cursor: pointer;
    text-decoration: none;
}
.paid-status-badge-link:hover .badge {
    text-decoration: underline;
    opacity: 0.85;
}

/* ============================================================
   FORMS
   ============================================================ */
option:disabled {
    color: lightgrey;
}

.form-group {
    margin-bottom: 0.5rem;
}

/* ============================================================
   LIVE STATS — my_picks highlight
   ============================================================ */
tr.my_picks {
    background-color: var(--sf-gold-light) !important;
}

/* ============================================================
   USER AVATAR
   ============================================================ */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    user-select: none;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sf-navy);
    margin-bottom: 0.4rem;
}

.empty-state-text {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
    max-width: 28rem;
}

.user-avatar-sm {
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.avatar-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.avatar-swatch:hover {
    transform: scale(1.15);
}
.avatar-swatch.selected {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #6b7280;
}

/* ============================================================
   SUDO (ADMIN VIEW-AS-USER) BANNER
   ============================================================ */
.sudo-banner {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #cc0000;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 0.03em;
    border-bottom: 3px solid #900;
}

.sudo-banner .sudo-banner-exit {
    background: #fff;
    color: #cc0000;
    border: none;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    letter-spacing: 0;
}

.collapse-chevron {
    transition: transform 0.2s ease;
}
[aria-expanded="false"] .collapse-chevron {
    transform: rotate(-180deg);
}
