/*
 * Rekreační hokej: the look on top of Bootstrap 5.3 (public/vendor/bootstrap, no build step).
 * Brand colours are set here as Bootstrap variables, the rest are small components of the app.
 */

:root {
    --app-navy: #0f2d4d;
    --app-navy-2: #17436f;
    --app-ice: #eef4fa;
    --app-ice-2: #dfeaf5;
    --app-border: #dbe3ec;
    --app-shadow: 0 1px 2px rgba(15, 45, 77, .06), 0 2px 10px rgba(15, 45, 77, .05);

    --bs-primary: #1867c0;
    --bs-primary-rgb: 24, 103, 192;
    --bs-primary-text-emphasis: #0e3e73;
    --bs-primary-bg-subtle: #dce9f8;
    --bs-primary-border-subtle: #a9c8ec;
    --bs-link-color: #1867c0;
    --bs-link-color-rgb: 24, 103, 192;
    --bs-link-hover-color: #11508f;
    --bs-link-hover-color-rgb: 17, 80, 143;
    --bs-body-color: #1d2a38;
    --bs-border-color: var(--app-border);
    --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* the page is tinted, the cards, inputs and menus stay white (they use --bs-body-bg) */
body {
    background-color: #f4f7fb;
}

/* ---- Bootstrap components in the brand colour ---- */

.btn-primary {
    --bs-btn-bg: #1867c0;
    --bs-btn-border-color: #1867c0;
    --bs-btn-hover-bg: #13579f;
    --bs-btn-hover-border-color: #13579f;
    --bs-btn-active-bg: #104a88;
    --bs-btn-active-border-color: #104a88;
    --bs-btn-disabled-bg: #1867c0;
    --bs-btn-disabled-border-color: #1867c0;
    --bs-btn-focus-shadow-rgb: 24, 103, 192;
}

.btn-outline-primary {
    --bs-btn-color: #1867c0;
    --bs-btn-border-color: #1867c0;
    --bs-btn-hover-bg: #1867c0;
    --bs-btn-hover-border-color: #1867c0;
    --bs-btn-active-bg: #1867c0;
    --bs-btn-active-border-color: #1867c0;
    --bs-btn-focus-shadow-rgb: 24, 103, 192;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #8db5e3;
    box-shadow: 0 0 0 .25rem rgba(24, 103, 192, .2);
}

.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
    background-color: #1867c0;
    border-color: #1867c0;
}

.pagination {
    --bs-pagination-active-bg: #1867c0;
    --bs-pagination-active-border-color: #1867c0;
    --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(24, 103, 192, .2);
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: #1867c0;
}

.card {
    --bs-card-border-color: var(--app-border);
    --bs-card-cap-bg: #fff;
    box-shadow: var(--app-shadow);
}

.card-header {
    font-weight: 600;
}

/* ---- page frame ---- */

.app-navbar {
    background: linear-gradient(100deg, var(--app-navy) 0%, var(--app-navy-2) 100%);
    box-shadow: 0 2px 12px rgba(15, 45, 77, .25);
}

/* a test copy (ENVIRONMENT other than PROD): a red banner with "DEV" written all over it at 45 degrees */
.app-navbar-dev {
    background-color: #a3122a;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%23fff' fill-opacity='.18' font-family='Arial,sans-serif' font-size='13' font-weight='700' text-anchor='middle' dominant-baseline='middle'%3E%3Ctext transform='translate(32 32) rotate(-45)'%3EDEV%3C/text%3E%3Ctext transform='translate(0 0) rotate(-45)'%3EDEV%3C/text%3E%3Ctext transform='translate(64 0) rotate(-45)'%3EDEV%3C/text%3E%3Ctext transform='translate(0 64) rotate(-45)'%3EDEV%3C/text%3E%3Ctext transform='translate(64 64) rotate(-45)'%3EDEV%3C/text%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(100deg, #8e0f24 0%, #c0182f 100%);
    box-shadow: 0 2px 12px rgba(142, 15, 36, .35);
}

/* the inactive menu links are too faint on red */
.app-navbar-dev {
    --bs-navbar-color: rgba(255, 255, 255, .85);
}

.app-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.app-navbar .navbar-brand img {
    width: 36px;
    height: 36px;
}

.app-navbar .nav-link {
    border-radius: .5rem;
    padding-inline: .65rem !important;
    white-space: nowrap;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus-visible {
    background-color: rgba(255, 255, 255, .08);
}

.app-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, .16);
}

.app-navbar .navbar-collapse {
    gap: .5rem;
}

@media (max-width: 1199.98px) {
    .app-navbar .navbar-collapse {
        padding-block: .5rem;
    }
}

/* a wide frame: the lists have many columns */
.app-container {
    max-width: 1720px;
    padding-inline: 1rem;
}

@media (min-width: 992px) {
    .app-container {
        padding-inline: 1.75rem;
    }
}

/* the menu icons only where the items fit */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .app-navbar .navbar-nav:first-child > .nav-item > .nav-link > .bi {
        display: none;
    }
}

/* the logout is a POST form, rendered like the other menu links */
.menu-form {
    margin: 0;
}

.app-user {
    max-width: 18rem;
}

.app-user .dropdown-header {
    white-space: normal;
}

.app-main {
    padding-block: 1.5rem 3rem;
}

.app-footer {
    border-top: 1px solid var(--app-border);
    background: #fff;
    color: var(--bs-secondary-color);
    font-size: .85rem;
    padding-block: 1rem;
}

/* the activity of the page (league, season...) above its title */
.app-context {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .75rem;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: .875rem;
    font-weight: 600;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.page-header .page-heading {
    flex: 1 1 14rem;
    min-width: 0;
}

.page-header .page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--app-navy);
}

.page-header .page-subtitle {
    margin: .15rem 0 0;
    color: var(--bs-secondary-color);
}

.page-header .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-left: auto;
}

.section-title {
    margin: 1.75rem 0 .75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--app-navy);
}

/* ---- buttons and icons ---- */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 1.85rem;
    height: 1.85rem;
}

.btn-back {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--app-border);
    --bs-btn-hover-bg: var(--app-ice);
    --bs-btn-hover-border-color: var(--app-border);
    color: var(--app-navy);
}

.row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .2rem;
}

.row-actions .btn-icon {
    --bs-btn-color: var(--bs-secondary-color);
    --bs-btn-hover-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary-bg-subtle);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
}

.row-actions .btn-icon.text-danger:hover {
    background-color: var(--bs-danger-bg-subtle);
}

.inline-form {
    display: inline;
    margin: 0;
}

.yes-no {
    font-size: 1.05rem;
}

/* ---- tables ---- */

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(15, 45, 77, .045);
    --bs-table-hover-bg: rgba(24, 103, 192, .06);
    margin-bottom: 0;
}

.table > thead th,
.table > thead td {
    background: var(--app-ice);
    color: #4a5b6e;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom-color: var(--app-ice-2);
}

.table > :not(caption) > * > * {
    padding: .5rem .65rem;
}

.table-sm > :not(caption) > * > * {
    padding: .35rem .5rem;
}

.card > .table-responsive > .table,
.card > .table {
    margin-bottom: 0;
}

.card > .table-responsive:last-child > .table > tbody > tr:last-child > *,
.card > .table:last-child > tbody > tr:last-child > * {
    border-bottom: 0;
}

/* the data lists: one line per record, a wide list scrolls sideways */
.table-list {
    font-size: .925rem;
}

.table-list > tbody > tr > td {
    white-space: nowrap;
}

/* the last column of a list (settings, delete) stays at the right edge while a wide list scrolls */
.table-list .col-end {
    position: sticky;
    right: 0;
    z-index: 1;
    --bs-table-bg: #fff;
}

/* every second row of a list is shaded, not counting the rows hidden by the attendance filter (match sheet)
   and the group and header rows of the sign-up list (seznam); the printed sheet has its cell borders instead */
body:not(.print) .table-list > tbody > tr:nth-child(even of :not([hidden], .seznam-skupina, .seznam-zahlavi)) > * {
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

/* match sheet: the guests below the players */
.table-list > tbody > tr.guest-row {
    --bs-table-bg: #eef7f1;
    --bs-table-color: #3c5a48;
}

.table-list > thead .col-end {
    background: var(--app-ice);
}

.sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.sort-link:hover {
    color: var(--bs-primary);
}

.sort-link .bi {
    font-size: .7rem;
}

/* the toolbar above a list: pager, search, the add button */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--app-border);
}

.list-toolbar:last-child {
    border-bottom: 0;
}

.pager-input {
    width: 3.5rem;
    text-align: center;
}

/* definition tables (record detail, key-value) */
.table-fields > tbody > tr > th {
    width: 1%;
    min-width: 10rem;
    white-space: nowrap;
    color: #4a5b6e;
    font-weight: 600;
    background: var(--app-ice);
}

@media (max-width: 575.98px) {
    .table-fields > tbody > tr > th {
        white-space: normal;
        min-width: 7rem;
    }
}

/* ---- forms ---- */

.ewRequired {
    color: var(--bs-danger);
    font-weight: 700;
}

.form-panel {
    max-width: 52rem;
}

.form-narrow {
    max-width: 10rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

/* the yes / no / unknown radios of a tristate field */
.tristate .btn {
    min-width: 2.75rem;
}

.auth-card {
    max-width: 28rem;
    margin: 1rem auto;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: 1.5rem;
}

/* ---- legacy classes set by the list fields (App\Crud\Resources\Hry) ---- */

.hrylist_rocnik,
.hrylist_potvrzeno,
.hrylist_skore {
    text-align: center;
}

.hrylist_skore {
    font-size: 1.05rem;
    font-weight: 700;
}

.hrylist_bold {
    font-weight: 600;
    white-space: nowrap;
}

/* ---- match sheet ---- */

.attendance-filter .btn {
    border-radius: 999px;
}

.team-card .team-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--app-navy);
}

.team-card .team-score {
    min-width: 3rem;
    padding: .15rem .6rem;
    border-radius: .5rem;
    background: var(--app-navy);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.counts {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.counts li {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    padding: .2rem .6rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    font-size: .8rem;
}

.counts li strong {
    font-size: .9rem;
    color: var(--app-navy);
}

.num {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rank {
    font-weight: 700;
    color: var(--app-navy);
}

/* playoff series: per round the teams and their score in each game */
.playoff-round + .playoff-round {
    border-top: 1px solid var(--app-border);
}

.playoff-score {
    display: inline-block;
    min-width: 3.25rem;
    padding: .1rem .4rem;
    border-radius: .375rem;
    background: var(--app-ice);
    text-align: center;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

/* the e-mail editor: the players of a group */
.email-group + .email-group {
    border-top: 1px solid var(--app-border);
}

.email-group summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 0;
    cursor: pointer;
    list-style: none;
}

.email-group summary::-webkit-details-marker {
    display: none;
}

.email-group summary::after {
    content: "\F282"; /* bi-chevron-down */
    margin-left: auto;
    font-family: bootstrap-icons;
    color: var(--bs-secondary-color);
    transition: transform .15s;
}

.email-group[open] summary::after {
    transform: rotate(180deg);
}

.email-hraci {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    padding: 0 0 .75rem 1.75rem;
}

.email-hraci label {
    white-space: nowrap;
}

/* collapsible panels (search, invitations) */
details.panel > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    list-style: none;
}

details.panel > summary::-webkit-details-marker {
    display: none;
}

details.panel > summary::after {
    content: "\F282";
    margin-left: auto;
    font-family: bootstrap-icons;
    font-weight: normal;
    color: var(--bs-secondary-color);
    transition: transform .15s;
}

details.panel[open] > summary::after {
    transform: rotate(180deg);
}

details.panel:not([open]) > summary {
    border-bottom: 0;
}

/* ---- the public pages: the list of sign-ups (also in an iframe of the invitations) and the rules ---- */

.public-page {
    padding: 1rem;
}

.seznam-zahlavi > th {
    background: var(--app-ice);
    color: #4a5b6e;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.seznam-skupina > td {
    background: var(--app-navy) !important;
    color: #fff !important;
    font-weight: 600;
}

.prose h2 {
    margin-top: 1.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--app-navy);
}

.prose h2:first-child {
    margin-top: 0;
}

/* ---- print (zapis/tisk) ---- */

body.print {
    background: #fff;
    font-size: 11pt;
}

body.print .card {
    box-shadow: none;
}

body.print .table > thead th,
body.print .table > thead td {
    background: #eee;
    color: #000;
}

body.print .table td,
body.print .table th {
    border: 1px solid #999;
}

@media print {
    .app-navbar,
    .app-footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .card {
        box-shadow: none !important;
        break-inside: avoid;
    }
}

