@page {
    size: auto;
    margin: 5mm;
}

body {
    font-family: Arial, sans-serif;
    padding: 20px;
    margin: 0;
}

/* background image */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../media/fl.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
}

/* header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.header img {
    height: 80px;
}

.header-center {
    text-align: center;
    flex-grow: 1;
}

.header-center h1 {
    margin: 0;
    font-size: 24px;
}

.header-center h2 {
    margin: 4px 0 0;
    font-size: 18px;
    color: #444;
}

/* ========= from inline <style> ========= */

/* flag sits at left edge, name after it */
.flag-icon {
    width: 16px;
    height: 12px;
    margin-right: 4px;
    margin-left: 0;
    vertical-align: baseline;
}

/* crew cell */
.crew {
    text-align: left;
    width: 150px;
    max-width: 150px;
    white-space: normal;
    word-wrap: break-word;
    vertical-align: top;
}

.crew .driver,
.crew .codriver {
    display: block;
    font-size: 10px;
}

/* car column layout: logo above, model below */
.car-cell {
    text-align: center;
}

.car-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* car logo style */
.car-logo {
    width: 30px;
    height: auto;
    margin-bottom: 4px;
    vertical-align: middle;
    margin-right: 4px;
}

/* car model text */
.car-model {
    font-size: 10px;
    line-height: 1.4;
    display: block;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 50px;
    text-align: center;
}

/* simple style for result set title */
.result-title {
    text-align: center;
    font-weight: bold;
    margin: 10px 0 5px 0;
}

.result-set-wrapper {
    margin-bottom: 20px;
}

/* override container so result sets are one under the other */
.container {
    display: flex;
    flex-direction: column; /* κάθε result set κάτω από το άλλο */
    align-items: center;
}

/* row with LEFT + RIGHT tables, side by side, no gap */
.result-set-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 40px;
}

/* remove any table margin so they touch */
.result-set-row table {
    margin: 0;
}

/* Penalties column: times orange */
.right-penalty {
    color: orange;
    font-weight: bold;
	font-size:11px;
}

/* rank improvement indicator under rank number */
.rank-improve {
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.rank-improve.up {
    color: green;
}

.rank-improve.down {
    color: red;
}

.rank-improve.neutral {
    color: black;
}

/* ========= υπόλοιπο υπάρχον CSS ========= */

table {
    border-collapse: collapse;
    width: auto;
}

/* vertical separator only for very first table, keep as ήταν */
.container table:first-child {
    border-right: 2px solid #444;
}

/* zebra rows */
.container table tr:nth-child(odd) {
    background-color: #FFFFFF;
}

.container table tr:nth-child(even) {
    background-color: #e0e0e0;
}

th, td {
    border: none !important;
    padding: 2px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
}

th {
    background-color: #f0f0f0;
    font-size: 11px;
    height: 2em;
}

td {
    height: 3em;
}

.superheader {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    background: #ddd;
}

.rank,
.no {
    font-size: 13px;
    font-weight: bold;
}

.rankC {
    font-size: 10px;
    font-weight: bold;
}

.start {
    font-size: 13px;
}

.timeraw {
    font-size: 16px;
    font-weight: bold;
}

.flying {
    font-size: 16px;
    font-weight: bold;
}

.crew .car {
    font-size: 8px;
    color: gray;
    display: block;
}

tr {
    height: 30px;
}

.ko {
    font-size: 8px;
    height: auto;
    padding: 4px 2px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

/* Optional: style each line separately */
.ko .sc {
    font-weight: bold;
}

.ko .hcat {
    color: gray;
}

td.ko {
    height: 100%;
}

.left-time {
    font-weight: bold;
    font-size: 10px;
    display: block;
}

.left-speed {
    font-size: 9px;
    color: gray;
    display: block;
}

.right-time {
    font-weight: bold;
    font-size: 8px;
    display: block;
}

.right-total {
    font-weight: bold;
    font-size: 10px;
    display: block;
    margin-right: 10px;
}

.right-diff1,
.right-diffprev {
    font-size: 9px;
    color: gray;
    display: block;
}

.blink {
    animation: blink-animation 1s steps(2, start) infinite;
    background-color: yellow;
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

.back-button {
    position: fixed;
    top: 120px;
    left: 20px;
    background: #39ff14;
    color: #000;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 18px;
    box-shadow: 0 0 10px #39ff14;
    transition: background 0.3s ease;
    z-index: 19999;
}

.back-button:hover {
    background: #5cff2d;
}

.logout-button {
    position: fixed;
    top: 220px;
    left: 20px;
    background: #39ff14;
    color: #000;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 18px;
    box-shadow: 0 0 10px #39ff14;
    transition: background 0.3s ease;
    z-index: 999;
}

.logout-button:hover {
    background: #5cff2d;
}

@media print {
    body::before {
        display: none !important;
    }
    .back-button {
        display: none !important;
    }

    .crew .driver {
        font-size: 9px;
    }
    .crew .codriver {
        font-size: 8px;
    }

    td {
        height: 4em;
    }
}
