/*
*   Base
*/
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;700&display=swap');

:root {
    --darkblue: #1b213b;
    --blue-accent: #262d47;
    --gray: #7991a8;
    --lightgray: #e2e7eb;
}

* {
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

html, body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    background-color: var(--darkblue);
    max-width: 100%;
    ;
}

body {
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

/*
*   Layout
*/

header {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--gray);
    margin-bottom: 20px;
    padding: 0;
    color: white;
}

header>a, header .controls {
    margin: 10px 30px;
}

header .controls {
    margin-left: auto
}

.round-header {
    background-color: var(--lightgray);
    color: black;
    padding: 10px 30px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.round-header div div {
    width: 100%;
    display: flex;
}

.round-header div span {
    margin-right: 5rem;
}

.round-header .align-right {
    display: flex;
    flex-direction: column;
}

@media screen and (max-width:900px) {

    .round-header {
        overflow-x: scroll;
    }

}

.body-trend>.content,
.body-avlasning>.content {
    display: flex;
    flex-direction: column;
    width: max-content;
    max-width: 100%;
    ;
}


footer {
    background-color: var(--lightgray);
    margin-top: auto;
    padding: 20px;
}

/* Navigation */

.body-home_pagination .content, .body-home .content{
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 10;
}

.home-nav {
    margin: 20px;
    display: flex;
    flex-direction: column;
    width: max-content;
}

.home-nav>div a {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 15px;
    background-color: var(--gray);
    border: 1px solid var(--darkblue)
}

.home-nav>div a * {
    margin: 0 15px;
}

.home-nav~.pagination {
    display: flex;
    margin: auto 20px 20px 20px;

}

.home-nav~.pagination a{
    
    padding: 10px 15px;
    background-color: var(--gray);
    border: 1px solid var(--darkblue)
}


/* Display*/

.round {
    background-color: var(--lightgray);
    width: max-content;
    margin: 20px 40px;
    padding: 20px;
    border-radius: 3px;
}

.round table {

    border-collapse: collapse;
}

.round table td, .round table th {
    padding: 10px 7px
}

.round table tbody tr {
    border: 1px solid var(--darkblue);
    border-width: 1px 0 1px 0;
}


.body-round .content {
    display: flex;
    max-width: 100%;
}

.body-round .content .chart,
.body-round .content .round {
    margin: 20px 10px;
    width: 100%;
}

.body-round .content .round table {
    width: 100%;
}

.body-round .content .chart {
    margin: 20px 20px;
    background-color: var(--lightgray);
    padding: 10px;
    border-radius: 3px;
    height: max-content;
}

@media screen and (max-width:800px) {
    .body-round .content {
        flex-wrap: wrap;
    }

    .body-round .content .round {
        overflow-x: scroll;
    }
}

/* race */

.avlasning, .trend {
    width: max-content;
    display: flex;
    flex-wrap: wrap;
    margin: 15px 40px;
    background-color: var(--lightgray);
    border-radius: 3px;
    overflow: hidden;
}

.avlasning .content, .trend .content {
    display: flex;
    width: 100%;

}

.body-trend .avlasning,
.body-avlasning .avlasning {
    width: unset;
}

.trend {
    margin: 20px 40px;
    width: unset;
}

.avlasning header,
.avlasning header a,
.trend header {
    width: 100%;
    display: flex;
    border-radius: 3px 3px 0 0;
}

.avlasning header,
.trend header {
    margin: 0;
    color: black;
}

.avlasning header h3,
.avlasning header span,
.trend header h3 {
    margin: 0 20px 0 0;
}

.trend header h3 {
    margin: 10px 30px;
}


.avlasning aside, .trend aside {
    padding: 4px 8px;
    margin: 5px 20px 5px 0;
}

.avlasning section, .trend .table-wrapper {
    flex-grow: 1;
}

.avlasning table,
.trend table {
    margin: auto 0;
    height: 100%;
    min-width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    table-layout: fixed;
    border-radius: 0 0 3px 0;
    overflow: hidden;
}


.avlasning table tr:first-of-type td,
.avlasning table tr:first-of-type th,
.trend table tr:first-of-type td,
.trend table tr:first-of-type th {
    border-top: none;
}

.avlasning table tr:last-of-type td,
.avlasning table tr:last-of-type th,
.trend table tr:last-of-type th,
.trend table tr:last-of-type td {
    border-bottom: none;
}

.avlasning table tr td:last-of-type,
.trend table tr td:last-of-type,
.trend table tr th:last-of-type {
    border-right: none;
}

table tbody th {
    text-align: left;
}

table td {
    text-align: center;
    position: relative;
}

table td[winner] {
    font-weight: bold;
}

table td.cancelled {
    text-decoration: line-through;
}

table th, table td {
    border: 1px solid var(--darkblue);
    padding: 5px 2px;
}

table th {
    padding: 5px 6px;
}

.trend aside {
    margin-bottom: 0;
    padding: 0 10px;
    display: flex;
    align-items: flex-end;
}

.trend table {
    table-layout: fixed;
}

.trend aside table td,
.trend aside table th {
    border-color: transparent;
}

.avlasning td{
    padding: 0;
}

.avlasning td div{
    cursor: pointer;
    padding: 5px 2px;
}
.avlasning td.active div{
    box-shadow: 1px 1px 4px 0px var(--darkblue);
}


@media screen and (max-width:1000px) {
    .avlasning header, .trend header {
        clear: both;
    }

    .avlasning, .trend {
        flex-wrap: wrap;
        margin: 10px 13px
    }

    .avlasning section, .trend .table-wrapper {
        overflow-x: scroll;
        flex-shrink: 100;
    }

}

aside.file-gen {
    position: fixed;
    right: 0;
    top: 20%;
    display: flex;
    flex-direction: column;
    background-color: var(--blue-accent);
    padding: 20px;
}

aside.file-gen input {
    display: none;
}

aside.file-gen.open input {
    display: block;

}