:root {
    --color-fs-world:       #1B78FF;
    --color-fs-world-light: #DDEEFF;

    --color-main-dark:   rgb(0, 69, 170);
    --color-gray:        #6b7280;
    --color-gray-dark:   #3d424e;
    --color-gray-mid:    #dae0e4;
    --color-gray-light:  #f1f5f9;
    /* --color-gray-light-2: #f6f8fa; */
    --color-gray-light-2: #f8f9fb;

    --color-class-cv:       #76B828;
    --color-class-cv-light: #EAF4D8;
    --color-class-ev:       #FFDD00;
    --color-class-dc:       #5EC4E1;

    --color-warning:         #FFC107;
    --color-warning-light:   #FFF3CD;
    --color-error:           #CC2222;
    --color-error-light:     #FDE8E8;
}

body {
    background-color: #ffffff;
    color: #1f2937;
    font-family: europa, sans-serif;
    line-height: 1.2;
    padding: 0;
    margin: 0;
}
h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

a {
    color: var(--color-fs-world);
    font-weight: bold;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.subth {
    display: block;
    font-weight: normal;
    font-size: 0.66em;
}

footer {
    color: var(--color-gray);
    font-size: 0.9rem;
    margin: 2rem 16px 0;
    text-align: right;
}

.header {
    background: #ffffff;
    border-bottom: 4px solid var(--color-fs-world);
    border-image: linear-gradient(to right, var(--color-main-dark) 0%, var(--color-fs-world) 100%) 1;
    color: var(--color-fs-world);
    /*display: flex;*/
    /*justify-content: space-between;*/
    height: 54px;
    left: 0;
    padding: 16px;
    position: fixed;
    top: 0;
    width: calc(100% - 32px);
    z-index: 1000;

    display: grid;
    gap: 4px 16px;
    grid-template-columns: 320px 1fr 80px;
    grid-template-rows: auto;
    grid-template-areas:
    "title filters logo"
    "nav filters logo";
}
.header nav {
    grid-area: nav;
}
.header h1 {
    margin: 0;
    grid-area: title;
}
.header .filter-container {
    display: flex;
    justify-content: end;
    gap: 16px;
    grid-area: filters;
}

.header > .logo {
    background-image: url(../img/FSWorld_Logo.svg);
    height: 54px;
    grid-area: logo;
    width: 80px;
}
.content {
    margin-top: 102px;
    padding: 0 16px;
    min-height: calc(100vh - 173px);
    overflow-x: auto;
    width: calc(100% - 32px);
}
nav > ul {
    display: flex;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}
nav > ul > li {
    display: inline-block;
}
nav > ul > li > a {
    color: var(--color-fs-world);
    text-decoration: none;
}
nav > ul > li > a:hover {
    text-decoration: underline;
}

/* input*/

select {
    background: none;
    border-color: var(--color-fs-world);
    border-radius: 12px;
    border-style: solid;
    border-width: 2px;
    padding: 6px 10px;
    outline: none;
}
input {
    background: none;
    border-color: var(--color-fs-world);
    border-style: solid;
    border-width: 2px;
    border-radius: 12px;
    padding: 6px 10px;
    outline: none;
}
input[type="submit"] {
    background: var(--color-fs-world);
    color: white;
}
input[type="submit"]:hover {
    background: var(--color-main-dark);
    color: white;
}

/* header filters */
.filters {
    display: flex;
    padding: 4px 0;
    gap: 0;
}

.filters label {
    text-transform: uppercase;
    font-size: 0.75rem;
    padding-left: 2px;
}
.filters select {
    border-radius: 0;
    border-width: 2px 1px;
}
.filters :first-child > select {
    border-left-width: 2px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.filters :last-child > select {
    border-right-width: 2px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.floating-hint {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 400px
}

.equation {
    font-size: 1rem;
    overflow-x: auto;
}

.large-equation {
    font-size: clamp(1.0rem, 2dvw, 1.5rem);
}

dl {
    padding: 0 14px;
}

.dl-symbol {
    display: flex;
    flex-direction: column;
    gap: 0.5em 0;
    padding: 0;
}
.dl-symbol dd {
    margin-left: 0;
    margin-bottom: 12px;
}

.dl-inline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 0;
  padding: 0 0;
  align-items: baseline;
}
.dl-inline dd {
  margin-left: 0;
}
.dl-inline dt {
    font-style: italic; 
}
.dl-inline dt::after {
  content: ':';
  margin-right: 0.5em;
}

.textbox {
    max-width: 1600px;
    margin: auto;
    position: relative;
}

.notify {
    padding: 10px;
    background-color: var(--color-fs-world-light); 
    border: 1px solid var(--color-fs-world); 
    margin-bottom: 10px;
    text-align: center;
}
.notify.hidden {
    display: none;
}
.notify.disclaimer {
    background-color: var(--color-warning-light); 
    border: 1px solid var(--color-warning); 
}
.notify.success {
    background-color: var(--color-class-cv-light); 
    border: 1px solid var(--color-class-cv); 
}
.notify.error {
    background-color: var(--color-error-light); 
    border: 1px solid var(--color-error); 
}

details {
    border: 2px solid var(--color-fs-world);
}
details > summary {
    font-size: 20px;
    font-weight: bold;
    padding: 16px;
    list-style: none;
}
details > summary::after {
    color: var(--color-fs-world);
    content: "\276F";
    height: 1.3em;
    float: right;
    text-align: center;
    transform: rotate(90deg);
    transition: all 0.35s;
    width: 1em;
}
details:open > summary::after {
    transform: rotate(270deg);
}
details > summary::marker {
    content: "";
}
details summary::-webkit-details-marker {
    display: none;
}
details > div > p {
    padding: 0 16px;
}
details dl {
    margin: 0 16px;
}

button.button {
    background-color: var(--color-fs-world);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    padding: 6px 8px;
}
button.button:hover {
    background-color: var(--color-main-dark);
}
button.button.gray {
    background-color: var(--color-gray);
}
button.button.gray:hover {
    background-color: var(--color-gray-dark);
}
button.button-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
}
button.button-icon > i {
    color: var(--color-fs-world);
}
button.button-icon:hover > i {
    color: var(--color-main-dark);
}
button.modal-close {
    right: 16px;
    top: 16px;
    font-size: 20px;
    position: absolute;
}

/* TABLES */
.table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
}
table {
    border-collapse: collapse;
    background: white;
}
table.full-width,
table.dataTable.full-width {
    width: 100%;
    max-width: 1600px;
    margin: auto;
}
table.center {
	margin: 0 auto;
}
th, td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}
table:not(tfoot) tbody > tr:last-child td {
    border-bottom: none;
}
th {
    text-align: left;
    background-color: var(--color-gray-light) !important;
}
table.alternate > tbody td {
    border-bottom: none;
}
table.alternate > tbody > tr:nth-child(even) {
    background-color: var(--color-gray-light-2) !important;
}

table.alternate thead th {
    background-color: var(--color-gray-light) !important;
}

table.alternate thead tr:last-child th {
    border-bottom: 1px solid var(--color-gray);
}
/* Alternate Tables do not have a border */
table.hoverline.alternate tbody > tr td {
  border-bottom: 1px solid transparent;
}
table.hoverline tbody > tr:hover td,
table.hoverline tbody > tr:active td {
    border-bottom: 1px solid black !important;
}

/** CELL ORIENTATION **/
table .left, table .l, table .-l, table .l-, table .-l-{
    text-align: left;
    width: 1px;
    white-space: nowrap;
}
table .-l,table .-r, table .-x{
    border-left: 2px solid var(--color-gray-light);
}

table .l-,table .r-, table .x-{
    border-right: 2px solid var(--color-gray-light);
}

table .-l-,table .-r-, table .-x-{
    border-left: 2px solid var(--color-gray-light);
    border-right: 2px solid var(--color-gray-light);
}

table .right, table .r, table .-r, table .r-, table .-r-{
    text-align: right;
    width: 1px;
    white-space: nowrap;
}
table .c{
    text-align: center;
    width: 1px;
    white-space: nowrap;
}

table .rf{
    text-align: right;
    white-space: nowrap;
}

dialog {
    border: none;
    box-shadow: 0 0 18px -5px rgba(0,0,0,.5);
    outline: none;
}

ol.breadcrumbs {
    display: flex;
    gap: 4px;
    list-style-type: none;
    margin: 0 0 24px 0;
    padding: 0;
}
ol.breadcrumbs li {
    color: black;
    display: inline-block;
    font-weight: bold;
}
ol.breadcrumbs li:has(a) {
    color: var(--color-fs-world);
}
ol.breadcrumbs li:not(:last-child)::after {
    color: var(--color-fs-world);
    content: "❯";
    font-weight: normal;
    margin-left: 4px;
}

.disable-cell {
    color: var(--color-gray);
    text-decoration: line-through;
}

.map {
    height: 500px;
    max-height: 30dvh;
    width: 100%;
}

.image-copyright {
    position: absolute;
    top: 5px;
    left: 5px;
    writing-mode: vertical-rl;
    font-size: 0.7em;
    color: white;
    text-shadow: 0 0 5px black;
    z-index: 9;
}

/* Table content styling */
td.result {
    min-width: 7.5ch;
}
.points:not(:empty)::after{ 
    content: '\202Fp';
    font-size: 0.75em;
}
.percent:not(:empty)::after{ 
    content: '%';
    font-size: 0.75em;
}
.rank:not(:empty)::after{
    content: '.';
}
.max-points {
    font-size: 0.75em;
}
.max-points:not(:empty)::before {
    content: ' / '
}

/** University Column **/
/* table#wrlTable td:nth-child(2), */
th.university,
td.university {
    padding-right: 0;
    min-width: 10.5em;
}
th.university.team-class-indicator,
td.university.team-class-indicator {
    min-width: 12.75em;
}

/* Flags and Labels */
span.flag {
    display: inline-block;
    width: 2.5cap;
    text-align: center;
    vertical-align: middle;
}
img.flag {
    max-height: 1.25cap;
    max-width: 2.5cap;
    border: 1px solid #cccccc;
}
.team-class {
    display: inline-block;
    font-size: 0.75em;          /* Slightly smaller font to make space for the box */
    padding: 0.15em 0.4em;      /* Padding around the Text */
    line-height: 1;             /* No additional padding */
    vertical-align: 0.075em;    /* Adjust the position offset due to the padding */
    width: 1.4em;               /* Same width for box for all classes */
    text-align: center;
}
.team-class.cv {
    background: var(--color-class-cv);
    color: white !important;
}
.team-class.ev {
    background: var(--color-class-ev);
    color: black !important;
}
.team-class.dc {
    background: var(--color-class-dc);
    color: black !important;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(0% - 4px);
    left: calc(50% + 8px);
    transform: translate(-100%, 100%);
    padding: 8px;
    background: #333;
    color: white;
    border-radius: 4px;
    white-space: pre;
    z-index: 9999;
    text-align: left;

    /* Initial: versteckt */
    visibility: hidden;
    transition-delay: 0.5s;
}
[data-tooltip].tooltip-right::after {
    transform: translate(0%, 100%);
}

[data-tooltip]:hover::after {
    visibility: visible;
    transition-delay: 0.5s;
}
[data-tooltip]:hover:active::after{
    visibility: visible;
    transition: none;
}
[data-tooltip].hover-only:active::after{
    visibility: hidden;
    transition: none;
}

@media only screen and (max-width: 1070px) {
    .content {
        margin-top: 102px;
    }
    .header {
        grid-template-columns: 220px 1fr 80px;
    }
    .header h1 {
        font-size: 24px;
    }
    .header .filter-container {
        justify-content: center;
    }
    .header .filters select {
        padding: 4px 2px !important;
    }
    .header .filters.search input {
        padding: 4px 2px !important;
        width: 130px;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .grid-2 > .item {
        max-width: calc(100vw - 32px);
        overflow-x: auto;
    }
    .floating-hint {
        position: initial;
        width: 100%;
    }
    .equation {
        font-size: clamp(0.75rem, 4dvw, 1rem);
        overflow-x: auto;
    }
    .largeEquation {
        font-size: clamp(1.0rem, 4dvw, 1.5rem)
    }
}
@media only screen and (max-width: 700px) {
    .content {
        margin-top: 66px;
        padding: 0 8px;
        width: calc(100% - 16px);
    }
    .header {
        padding: 8px;
        height: auto;
        width: calc(100% - 16px);

        grid-template-columns: 40px 0 1fr;
        grid-template-areas:
    "logo title nav"
    "filters filters filters";
    }
    .mobile-hide {
        display: none;
    }
    .header .logo{
        height: 27px;
        width: 40px;
    }
    .header nav {
        line-height: 26px;
    }
    .header nav > ul{
        float: right;
    }
    .mobile-header-spacer {
        height: 54px;
    }
    .content .table-wrapper{
        margin: 0 -8px;
    }
    table.table td, table.table th {
        font-size: 0.75rem;
        padding: 4px 5px;
    }
    .grid-1 {
        gap: 8px;
    }
    .grid-2 {
        gap: 0;
    }
    .grid-1 > .item ,
    .grid-2 > .item {
        max-width: calc(100vw - 16px);
        overflow-x: auto;
    }
    details {
        margin-bottom: 8px;
    }
    details > summary {
        padding: 8px;
    }
}
@media only screen and (max-width: 400px) {
    .header .filters.search input {
        width: 80px;
    }
    /** Rank **/
    table#wrlTable td:first-child, 
    table#wrlTable th:first-child {
        padding-left: 0;
    }
}