/* Copyright (C) 2020 Christoph Theis */

div#report table.report tr[data-toggle=collapse] {
    cursor: pointer;
}

table.report {
    empty-cells: show;
}

table.report thead tr {
    border: none;
}

table.report thead th {
    white-space: nowrap;
    cursor: pointer;
    border-bottom-width: 0px;
}

/* the sort order triangles */
table.report thead th.sort.up span:after {
    content: "";
    height: 0;
    width: 0;
    border: 6px solid transparent;
    border-bottom-color: #000;    
    position: relative;
    left: 10px;
    top: -10px;
}

table.report thead th.sort.down span:after {
    content: "";
    height: 0;
    width: 0;
    border: 6px solid transparent;
    border-top-color: #000;    
    position: relative;
    left: 10px;
    top: 10px;
}

/* We need the external ID only for filtering, but we don't show it */
table.report .extid {
    display: none;
}

/* Filtered rows */
div#report table.report tbody tr.filtered {
    display: none;
}

/* Table layout */
div#report table.report td {
    vertical-align: middle;
}

div#report table.report td.plnr {
    width: 5%;
    text-align: right;
    padding-right: 5px;
}

div#report table.report td.name {
    width: 26%
}

div#report table.report td.sex {
    width: 2%;
}


div#report table.report td.assoc {
    width: 13%;
}

div#report table.report td.team {
}

div#report table.report td.event {
    width: 10%;
    vertical-align: middle;
}

div#report table.report.teams td.name {
    width: 52%;
}

/* Put association in parantheses */
div#report table.report td.team span.assoc:before {
    content: "\a0 ("; /* &nbsp;( */
}

div#report table.report td.team span.assoc:after {
    content: ")";
}

/* Filter association in report (th, td, span)) ... */
div#report table.report.teams .assoc {
    display: none;
}

/* ... but not in detailed matches */
div#report table.report.teams table.matches span.assoc {
    display: table-cell;
}

div#report table.report.teams td.team {
    width: 12%;
}


/* List of Matches */
div#report table.matches {
    margin: 0;
    width: 100%;
    empty-cells: show;  
}

div#report table.matches td {
    padding: 5px;
}    

div#report table.matches tr[data-toggle=collapse] {
    cursor: pointer;
}

div#report table.matches tr.individual td {
    font-size: 80%;
}

div#report table.matches th {
    background: lightgray;
    padding-left: 5px;
    padding-right: 5px;
}

div#report table.matches th span {
    /* Required so we can set the width of the header parts */
    display: inline-block;    
}

div#report table.matches th span.headerline {
    display: inline;
}

div#report table.matches th span.headerline span {
    vertical-align: middle;
}

div#report table.matches th .event {
    width: 10%;
}

div#report table.matches th .group {
    width: 30%;
}

div#report table.matches th .round {
    width: 20%;
}

div#report table.matches th .date {
    width: 20%;
}

div#report table.matches th .time {
    width: 10%;
}

div#report table.matches th .mttable {
    width: 10%;
    text-align: right;
    margin-bottom: 0px;
}

/* Smartphone Portrait: display header in 2 rows */
@media screen and (max-width: 767.98px) {
    div#report table.matches th .headerline {
        display: block;
    }
    
    div#report table.matches th .event {
        width: 20%;
        text-align: left; 
    }

    div#report table.matches th .group {
        width: 50%;
        text-align: center;
    }

    div#report table.matches th .round {
        width: 30%;
        text-align: right;
    }

    div#report table.matches th .date {
        width: 40%;
        text-align: left;
    }

    div#report table.matches th .time {
        width: 30%;
        text-align: center;
    }
    
    div#report table.matches th .mttable {
        width: 30%;
        text-align: right;
    }
}

div#report table.matches tbody.filtered {
    display: none;
}

div#report table.matches td div.left {
    padding-bottom: 5px;
}

div#report table.matches td div.right {
    padding-top: 5px;
}


/* Matches table: The cell with the name */
div#report table.matches td.name {
    width: 50%;
}

div#report table.matches td.name span {
    display: table-cell;
}

div#report table.matches td.name span.flag img {
    border: 1px black solid;
    height: 1em;
}

div#report table.matches td.name span.flag img[src=""] {
    display: none;
}

div#report table.matches td.name span.plnr {
    text-align: right;
    padding-right: 5px;
    width: 3em;
}

div#report table.matches td.name span.assoc:before {
    content: "\a0 ("; /* &nbsp;( */
}

div#report table.matches td.name span.assoc:after {
    content: ")";
}

/* Matches table: The cell with the name of the first player */
div#report table.matches td.name div.left {
    border-right-width: 0px;
}

/* Matches table: The cell with the name of the second player */
div#report table.matches td.name div.right {
    border-left-width: 0px;
}    

/* Matches table: Winner bolder */
div#report table.matches td.name div.winner {
    font-weight: bold;
}

/* Matches table: The cell with the result of that match */
div#report table.matches td.result {
    text-align: center;
    vertical-align: middle;    
    font-weight: 900;
    font-size: 110%;
    width: 6%;
}   

/* Matches table: The cells with the result of the individual games */
div#report table.matches td.game {
    text-align: center;
    vertical-align: middle;    
    width: 6%;
}

/* Matches table: Winner bolder */
div#report table.matches td.game div.winner {
    font-weight: bold;
}

div#report table.matches td.game[colspan="2"] {
    width: 12%;
}

div#report table.matches td.game[colspan="3"] {
    width: 18%;
}

div#report table.matches td.game[colspan="4"] {
    width: 24%;
}

div#report table.matches td.game[colspan="5"] {
    width: 30%;
}

div#report table.matches td.game[colspan="6"] {
    width: 36%;
}

div#report table.matches td.game[colspan="7"] {
    width: 42%;
}

/* Smapp devices: toggle between names and games */
@media screen and (max-width: 767.98px) {
    div#report table.matches tr td.game {
        display: none;
    }
    
    div#report table.matches tr td.name {
        display: table-cell;
    }
    
    div#report table.matches tr.alternate td.game {
        display: table-cell;
    }
    
    div#report table.matches tr.alternate td.name {
        display: none;
    }
}

/* Printing: page-breaks */
@media print {
    div#report table.report tr.report {
        page-break-after: avoid;
    }
    
    div#report table.report table.matches tbody {
        page-break-inside: avoid;
    }
}

