/*Overide bootstrap modals*/
.modal-dialog  {
    z-index: 1100;
}

.nav-mobile-div {
    margin-bottom: 0;
}


.main-navbar {
    z-index: 1050;
}

/* BS5's navbar-dark only recolours the active link's text; restore the darker
   active background the BS3 navbar-inverse gave it. */
.main-navbar .nav-link.active {
    background-color: #080808;
}

.module-navbar.fixed-top  {
    top: 50px;
}

.module-navbar {
    background-color: #f8f8f8;
    border-bottom: 1px solid #e7e7e7;
}
.module-navbar > .container {
    justify-content: flex-start;
}
.module-navbar .nav-link {
    color: #777;
}
.module-navbar .nav-link:hover,
.module-navbar .nav-link:focus {
    color: #333;
}
.module-navbar .nav-link.active {
    color: #555;
    background-color: #e7e7e7;
}

/* 60px reserves one row of module navbar (50px) plus a 10px gap, on top of the
   body's 50px padding for the main navbar. When the module navbar wraps to a
   second row it gets taller than that, and the page content — including the
   tab row — slides underneath it. --sticky-header-top is the measured bottom of
   the fixed navbar stack, so subtracting the body padding and adding the gap
   tracks the real height; the max() keeps the old value on pages that have no
   module navbar at all. */
.main-body {
    margin-top: max(60px, calc(var(--sticky-header-top, 100px) - 40px));
}

.dropdown-menu {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
}

/* django-countries renders the flag as position:absolute over the select's
   top-right corner. BS3 grid columns were position:relative, so the flag
   anchored to the column; BS5 columns are static, so the flag escaped to the
   modal body and jumped to the top. Restore relative positioning on the column
   holding the flag so it lands on the select's corner exactly as before. */
[class*="col-"]:has(> .mb-3 > .country-select-flag) {
    position: relative;
}

/* Sticky table headers: the header row stays visible while the page scrolls.
   .table-responsive establishes a horizontal-scroll container whose overflow
   would otherwise break position:sticky, so relax it. The pin offset
   (--sticky-header-top) is measured from the fixed navbar stack in layout JS
   and falls back to the common main+module navbar height. */
.table-responsive {
    overflow: visible;
}
/* Exclude DataTables: it sets position:relative on sortable headers (for the
   sort arrows), which cancels position:sticky but keeps `top`, so the header
   would be pushed 100px down into the body. DataTables manages its own header. */
.table:not(.dataTable) > thead th {
    position: sticky;
    top: var(--sticky-header-top, 100px);
    z-index: 2;
    /* Light grey (not white) matches the BS3 header and blends into cards/wells;
       an opaque colour is still required so rows don't show through while the
       header is pinned during scroll. */
    background-color: #f5f5f5;
}
/* Exclude modals: sticky pins against the nearest scrollport, which inside a
   modal is the modal itself or an inner fixed-height well — not the page — so
   the navbar-measured offset shoves the header ~100px down over the data rows
   (hiding the first row entirely and leaving a blank strip in the header's
   slot). No fixed navbar overlays a modal, so pinning buys nothing there. */
.modal .table > thead th {
    position: static;
}

@media (max-width: 991px) {
    /*xs and sm*/

    .breadcrumb {
        font-size: 12px;
        padding: 5px 10px;
        margin-bottom: 15px;
        list-style: none;
        background-color: #f5f5f5;
        border-radius: 4px;
    }
    .collapsing {
        overflow: hidden!important;
    }

    /*Area selecteror and mobile nav scroll*/
    .area-selector-mobile:hover, .area-selector-mobile:focus {
        background-color: #444444;
    }

    .layout-top-item {
        background-color: transparent;
        border-color: transparent;
        color: #777777;
    }

    .layout-top-item > a {
        background-color: transparent;
        border-color: transparent;
        color: #777777;
        text-decoration: none;
    }

    .layout-top-item.btn-info {
        color: #ffffff;
    }

    .layout-top-item.active, .layout-top-item:active, .show>.dropdown-toggle.layout-top-item,
    .layout-top-item.active:focus, .layout-top-item:active:focus, .show>.dropdown-toggle.layout-top-item:focus,
    .layout-top-item.active:hover, .layout-top-item:active:hover, .show>.dropdown-toggle.layout-top-item:hover {
        background-color: transparent;
        border-color: transparent;
    }

    .nav-mobile-div {
        position: relative;
        overflow-y: hidden;
        overflow-x: auto;
        padding: 0;
        scroll-behavior: smooth;
    }

    .nav-mobile-div-white {
        background-color: #ffffff;
    }
    .nav-mobile-opacity {
        position: fixed;
        right: 0px;
        opacity: 0.7;
        background-color: #f8f8f8;
        z-index: 101;
        width: 25px;
        height: 40px;
    }
    .nav-mobile-div-white .nav-mobile-opacity {
        background-color: #ffffff;
    }
    .nav-mobile-ul {
        margin: 0;
        box-sizing: content-box;
        width: auto;
    }
    .nav-mobile-ul > li{
        float:left;
    }

    ul.nav-mobile-ul.nav-tabs{
        padding-left: 10px;
    }
    ul.nav-mobile-ul.nav-pills{
        padding-left: 10px;
    }

    .main-body {
        /* 40px module navbar + 10px gap here; see the comment on .main-body. */
        margin-top: max(50px, calc(var(--sticky-header-top, 90px) - 40px));
    }
    .module-navbar {
        min-height: 40px;
    }
}

@media (max-width:767.98px) {

    .modal-dialog {
        margin-right:15px;
        margin-left:5px;
    }
}
.area-selector-desktop {
    display: flex;
    align-items: center;
}
@media (min-width: 992px) {
    .area-selector-desktop {
        margin-left: 5px;
    }
}
@media (min-width: 1200px) {
    .area-selector-desktop {
        margin-left: 8px;
    }
}
/* Set when the club, section and team names nearly fill the banner row (see
   AREA_SELECTOR_ROW_COMFORTABLE_LENGTH in lib/helpers/area_selector_helper.py).
   .btn-sm and .btn-xs are both 12px, so there is no smaller tier to reuse: drop the
   selector text a size and tighten its padding, or the row wraps onto a second line
   and covers the module menu below it. */
.area-selector-tight .btn {
    --bs-btn-font-size: 11px;
    --bs-btn-padding-x: 6px;
}

body {padding-top: 50px; color: #555;}
body .table {margin-bottom: 5px;}
body .pagination {margin-top:0;}
body .big-icon {font-size:102px; float:left; line-height: 102px;}
body .pointer {cursor: pointer;}
.txt-btn {padding: 6px 12px 6px 12px;}
.table tbody tr td { mso-number-format:\@; }
.table tbody tr td.button_cell {background-color: #fff; border-color: #fff;}
.table tbody tr:hover td.button_cell {background-color: #fff; border-color: #fff;}

/* Loader — dual counter-rotating ring. The #loader / .loader.htmx-request hooks are
   unchanged, so $("#loader").show()/.hide() and htmx keep working as before. */
.loader {position: fixed;top: 40%; left: 50%;transform: translate(-50%, -50%);margin-left:0;display: none;z-index:999999;}
.loader.htmx-request {display: block;}

.mc-dualring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: var(--mc-primary, #2B6A98);
    border-right-color: var(--mc-primary, #2B6A98);
    animation: mc-dualring-spin 1s linear infinite;
    position: relative;
    box-sizing: border-box;
}
.mc-dualring::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    box-sizing: border-box;
    border: 5px solid transparent;
    border-bottom-color: rgba(43, 106, 152, 0.45);
    border-left-color: rgba(43, 106, 152, 0.45);
    animation: mc-dualring-spin 0.7s linear infinite reverse;
}
.mc-dualring--sm {width: 50px;height: 50px;border-width: 3px;}
.mc-dualring--sm::after {inset: 6px;border-width: 3px;}
@keyframes mc-dualring-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .mc-dualring, .mc-dualring::after {animation: none;}
}

.list-group-item.selected {color: #31708f;background-color: #d9edf7;border-color: #bce8f1;}
.list-group-item {cursor: pointer;}

select[multiple]  {
    min-height: 200px;
}
/* The bootstrap-multiselect widget keeps the real <select> clipped to 1px and
   shows its own button instead; the min-height above would otherwise re-expand
   that hidden select and inflate the surrounding layout (e.g. the invoice
   extended-search wells). */
.multiselect-native-select select[multiple] {
    min-height: 0;
}

.act_badge {background-color: #f2dede; position: absolute; right: 5px; top:2px;}

.icon-inactive {color: #aaaaaa;}

.alert-white {color: #999999; border-color: #dddddd; background-color: #ffffff;}
.alert-darkgrey {color: #777777; border-color: #cccccc; background-color: #CDCDCD;}
.alert-grey {color: #777777; border-color: #cccccc; background-color: #eeeeee;}
.alert-danger-warning-white{border-color: #dddddd; background: linear-gradient(90deg, #ffffff 33%, #fcf8e3 33%, #fcf8e3 67%, #f2dede 67%);}
.alert-danger-white{border-color: #dddddd; background: linear-gradient(90deg, #ffffff 50%, #ffffff 51%, #f2dede 51%);}
.alert-warning-white{border-color: #dddddd; background: linear-gradient(90deg, #ffffff 50%, #ffffff 51%, #fcf8e3 51%);}
.alert-info-danger {border-color: #dddddd; background: linear-gradient(90deg, #d9edf7 50%, #d9edf7 51%, #f2dede 51%);}
.alert-lightgrey-grey {border-color: #dddddd; background: linear-gradient(90deg, #EDEDED 50%, #EDEDED 51%, #CDCDCD 51%);}
.alert-all-active {border-color: #dddddd; background: linear-gradient(90deg,  #ffffff 33%, #f2dede 33%, #f2dede 66%,  #dff0d8 66%,  #dff0d8 100%);}
.alert-all {border-color: #dddddd; background: linear-gradient(90deg,  #ffffff 20%, #f2dede 20%, #f2dede 40%,  #dff0d8 40%,  #dff0d8 60%, #EDEDED 60%, #EDEDED 80%, #CDCDCD 80%, #CDCDCD 100%);}

.alert-small {padding: 2px; font-size: 0.8em; margin-bottom: 0;}
.alert-active {border-width: medium; font-weight: bold; border-color: #aaaaaa;}
.alert-small.alert-active{padding:1px;}
.nav-pills .nav-link {padding-top:5px; padding-bottom:5px;}
.pagination>li:first-child>a {}
.pagination>li:last-child>a {}
.well {box-shadow: none;}
.form-control { box-shadow: none;}

table.table-slim {
    font-size: 12px;
}
table tfoot {font-weight: bold;}
.negative {color: #d51111;}
.positive {color: #3c763d;}

.note-toolbar.btn-toolbar {margin-left:0px;}
.note-editor {background-color: #fff;}
.well.thick {
    border: 2px solid;
}
.well.white {
    background-color: #ffffff;
}
.well.lightgreen {
    background-color: #dff0d8;
}

.orange, .orange>td {
    background-color: #F5DEB3;
}
.grey, .grey>td {
    background-color: #CDCDCD;
}
.lightgrey, .lightgrey>td {
    background-color: #EDEDED;
}
.borderless.table {
    border: none;
}
.borderless td, .borderless th {
    border: none;
}
.btn-yellow {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

i.warning {
    color: #F5DEB3;
}

.btn-xlg {
    padding: 18px 28px;
    font-size: 22px;
}

.mb-3 {
    margin-bottom: 10px;
}

.select-column-div ul li.dropdown-item {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: 400;
    line-height: 1.42857143;
    color: #333;
    white-space: nowrap;
}

.select-column-div ul li.dropdown-item input[type=checkbox] {
    margin-top: 2px;
}

.select-column-div ul.dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
}

.select-column-div ul.dropdown-menu li.dropdown-item.sticky-btn {
    position: sticky;
    top: 0;
    z-index: 10; /* Ensure it stays on top of other elements while scrolling */
    background-color: white; /* Match the background to avoid overlap issues */
    border-bottom: 1px solid #dddddd; /* Optional: Add separator for better visual distinction */
}

.select-column-div ul li.dropdown-item.active {
    color: #fff;
    text-decoration: none;
    background-color: #337ab7;
    outline: 0;
}

.team-autocomplete .selected-teams .label {
    font-size: 16px;
    margin-top: 5px;
    margin-right: 10px;
    line-height: 18px;
    float: left;
    padding: 0.3em 0.6em;
    cursor: pointer;
}
.form-text {
    font-size: 11px;
}
