/* 
    © 2024 Harald Baudiß. Alle Rechte vorbehalten.
    Dieses Stylesheet ist urheberrechtlich geschützt. 
    Jegliche Vervielfältigung oder Weiterverbreitung ist verboten.
*/
* {
    margin: 0;
    padding: 0
}

:root {
    --bg-color-light: #f4f4f4;
    --text-color-light: #000;
    --table-header-light: #2E4057;
    --table-row-light: #f2f2f2;
    --table-row-alt-light: #fff;
    --bg-color-dark: #373737;
    --text-color-dark: #fff;
    --table-header-dark: #ff4000;
    --table-row-dark: #333;
    --table-row-alt-dark: #474747;
    --n-box-dark: #ff4000;
    --n-box-border-dark: #e2d7d7;
    --n-box-light: #28405f;
    --n-box-border-light: #747474;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color-light);
    color: var(--text-color-light);
    padding: 20px;
    transition: background-color .3s ease, color .3s ease;
}

.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 120px;
    height: auto;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
}

.dark-mode {
    background-color: var(--bg-color-dark);
    color: var(--text-color-dark);
}

h1,
h2,
p {
    text-align: center;
    margin: 10px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
}

.dark-mode table {
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}

th,
td {
    padding: 10px;
    border-right: none;
    text-align: center;
    font-size: 16px;
    transition: background-color .3s ease, color .3s ease;
}

th {
    background-color: var(--table-header-light);
    color: #fff;
}

.no-wrap {
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.no-wrap .pos {
    font-weight: bold;
}

.no-wrap .in-class {
    font-size: 0.9em;
}

tr:nth-child(even) {
    background-color: var(--table-row-light);
}

tr:nth-child(odd) {
    background-color: var(--table-row-alt-light);
}

.dark-mode th {
    background-color: var(--table-header-dark);
}

.dark-mode tr:nth-child(even) {
    background-color: var(--table-row-dark);
}

.dark-mode tr:nth-child(odd) {
    background-color: var(--table-row-alt-dark);
}

.theme-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #2E4057;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
}

.dark-mode .theme-toggle-btn {
    background-color: #ff4000;
}

.current-time {
    position: absolute;
    top: 70px;
    right: 20px;
    font-size: 14px;
    color: #333;
}

.dark-mode .current-time {
    color: #fff;
}

img {
    width: 20px;
    height: 20px;
}

td img {
    vertical-align: middle;
}

.dual-data div {
    margin: 2px 0;
}

.dual-data div:nth-child(2) {
    font-size: smaller;
    color: gray;
}

.dual-data-times {
    font-size: 16px;
    color: var(--text-color-light);
}

.dark-mode .dual-data-times {
    color: var(--text-color-dark);
}

.full-row-progress-bar-container {
    width: 100%;
    background-color: rgba(221, 221, 221, 0.28);
    height: 3px;
    position: relative;
}

.progress-point {
    position: absolute;
    top: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: red;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
    transition: left 0.5s ease-in-out;
}

.full-row-progress-bar {
    height: 100%;
    background-color: green;
    width: 0%;
    border-radius: 3px;
    transition: width 1s linear;
}

.full-row-progress-bar.red {
    background-color: red;
}

.full-row-progress-bar.orange {
    background-color: orange;
}

.full-row-progress-bar.green {
    background-color: green;
}

.markeru {
    width: 6px;
    height: 6px;
    background-color: none;
    position: absolute;
    z-index: 1;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.marker-start {
    left: 0;
}

.marker-end {
    right: 0;
}

#live-timing-table tr:nth-child(4n-3),
#live-timing-table tr:nth-child(4n-2) {
    background-color: var(--table-row-alt-light);
}

#live-timing-table tr:nth-child(4n-1),
#live-timing-table tr:nth-child(4n) {
    background-color: var(--table-row-light);
}

.dark-mode #live-timing-table tr:nth-child(4n-3),
.dark-mode #live-timing-table tr:nth-child(4n-2) {
    background-color: var(--table-row-alt-dark);
}

.dark-mode #live-timing-table tr:nth-child(4n-1),
.dark-mode #live-timing-table tr:nth-child(4n) {
    background-color: var(--table-row-dark);
}

.n-box {
    display: inline-block;
    padding: 3px;
    background-color: var(--n-box-light);
    border-radius: 8px;
    border: 1px solid var(--n-box-border-light);
    font-weight: bold;
    text-align: center;
    min-width: 45px;
    color: white;
}

.dark-mode .n-box {
    background-color: var(--n-box-dark);
    border: 1px solid var(--n-box-border-dark);
}

.race-info {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
}

#run-name {
    font-size: 24px;
    font-weight: bold;
}

#race-time {
    font-size: 24px;
    font-weight: bold;
}

#flag-image {
    width: auto;
    height: 30px;
    margin-right: 0px;
    margin-left: 10px;
}

.icon {
    width: auto;
    height: 30px;
    margin: 0 10px;
}

#lapstogo {
    display: none;
}

.lapstogo {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
    text-align: center;
}

body.dark-mode #stopwatch-icon {
    content: url('images/icons/stopwatch_white.png');
}

body:not(.dark-mode) #stopwatch-icon {
    content: url('images/icons/stopwatch_black.png');
}

#live-timing-container th:first-child {
    border-top-left-radius: 4px;
}

#live-timing-container th:last-child {
    border-top-right-radius: 4px;
}

@media (max-width: 760px) {

    th,
    td {
        padding: 8px;
        font-size: 12px;
    }

    h1,
    h2,
    p {
        font-size: 16px;
    }

    .logo {
        position: static;
        display: block;
        margin: 0 auto 20px;
        width: 80px;
    }

    .current-time {
        top: 20px;
        left: 15px;
        right: auto;
        font-size: 12px;
        z-index: 1000;
        background-color: #fff;
        padding: 5px 10px;
        border-radius: 5px;
    }

    .dark-mode .current-time {
        background-color: #555;
    }

    img {
        width: 10px;
        height: 10px;
    }

    .dual-data-times {
        font-size: 12px;
    }

    .n-box {
        padding: 3px 0px;
        font-size: 0.9em;
        min-width: 30px;
        border-radius: 5px;
    }

    .progress-point {
        width: 7px;
        height: 7px;
        top: -2px;
    }

    #run-name {
        font-size: 16px;
    }

    #race-time {
        font-size: 16px;
    }

    #flag-image {
        width: auto;
        height: 18px;
    }

    .icon {
        width: auto;
        height: 18px;
    }

    .lapstogo {
        font-size: 1rem;
        font-weight: bold;
        display: block;
        text-align: center;
    }
}

@media (max-width: 400px) {

    th,
    td {
        font-size: 10px;
    }
}