/* ==========================================================
   GLEISPLAN GRID
   Version 1.1 Arbeitsstand
   - 5 Tage sichtbar
   - intern 3 Slots je Tag = 15 Spalten
   - Mehrtage-Karten und nebeneinander stehende Tageskarten
========================================================== */

#grid-vehicle-container {
    width: 100%;
}


/* ==========================================================
   Kopfzeile
========================================================== */

.grid-header-row {
    display: grid;
    grid-template-columns: 70px repeat(5, minmax(0, 1fr));
    width: 100%;
}

.grid-corner,
.grid-day-head {
    background: #b71c1c;
    color: white;

    border: 1px solid #d0d0d0;

    padding: 7px 6px;

    font-size: 20px;
    font-weight: bold;

    text-align: center;
}

.grid-corner {
    background: #f5f5f5;
    color: #000000;
}


/* ==========================================================
   Gleiszeilen
========================================================== */

.gleis-grid-row {
    display: grid;
    grid-template-columns: 70px 1fr;

    width: 100%;
    min-height: 42px;
}

.gleis-label {
    display: flex;
    align-items: center;
    justify-content: center;

    background: #f5f5f5;
    color: #000000;

    border: 1px solid #d0d0d0;

    font-size: 22px;
    font-weight: bold;
}


/* ==========================================================
   Tagesbereich einer Gleiszeile
========================================================== */

.gleis-track {
    display: grid;

    /* 5 Tage x 3 Plätze = 15 interne Spalten */
    grid-template-columns: repeat(30, minmax(0, 1fr));
    grid-auto-rows: 40px;

    gap: 3px;
    padding: 3px;

    border: 1px solid #d0d0d0;

    position: relative;
    overflow: hidden;

    background:
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent calc(20% - 1px),
            #d0d0d0 calc(20% - 1px),
            #d0d0d0 20%
        );
}


/* ==========================================================
   Fahrzeugkarten im neuen Grid
========================================================== */

.vehicle-card-grid {
    width: 100%;
    height: 100%;

    background: #f5f5f5;

    border: 2px solid #c62828;
    border-radius: 8px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);

    padding: 3px 5px;
    box-sizing: border-box;

    font-family: inherit;
    color: inherit;

    text-align: center;

    cursor: pointer;

    position: relative;
    z-index: 5;

    overflow: hidden;
}

.vehicle-card-grid:hover {
    background: #eeeeee;
    transform: translateY(-1px);
}

.vehicle-card-grid:active {
    transform: translateY(0);
}

.vehicle-card-grid-title {
    font-size: 21px;
    font-weight: bold;
    line-height: 1.05;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-card-grid-range {
    font-size: 8px;
    font-weight: bold;
    line-height: 1;

    color: #b71c1c;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-card-grid-work {
    margin-top: 1px;

    font-size: 11.5px;
    font-weight: normal;
    line-height: 1.05;

    max-height: 18px;
    overflow: hidden;
}


/* ==========================================================
   Viele Spuren kompakter halten
========================================================== */

.gleis-track[data-lanes="4"],
.gleis-track[data-lanes="5"] {
    grid-auto-rows: 36px;
}

.gleis-track[data-lanes="6"],
.gleis-track[data-lanes="7"],
.gleis-track[data-lanes="8"] {
    grid-auto-rows: 32px;
}

.gleis-track[data-lanes="4"] .vehicle-card-grid,
.gleis-track[data-lanes="5"] .vehicle-card-grid,
.gleis-track[data-lanes="6"] .vehicle-card-grid,
.gleis-track[data-lanes="7"] .vehicle-card-grid,
.gleis-track[data-lanes="8"] .vehicle-card-grid {
    padding: 1px 4px;
}

.gleis-track[data-lanes="4"] .vehicle-card-grid-title,
.gleis-track[data-lanes="5"] .vehicle-card-grid-title,
.gleis-track[data-lanes="6"] .vehicle-card-grid-title,
.gleis-track[data-lanes="7"] .vehicle-card-grid-title,
.gleis-track[data-lanes="8"] .vehicle-card-grid-title {
    font-size: 12px;
}

.gleis-track[data-lanes="4"] .vehicle-card-grid-work,
.gleis-track[data-lanes="5"] .vehicle-card-grid-work,
.gleis-track[data-lanes="6"] .vehicle-card-grid-work,
.gleis-track[data-lanes="7"] .vehicle-card-grid-work,
.gleis-track[data-lanes="8"] .vehicle-card-grid-work {
    font-size: 7.5px;
}


/* ==========================================================
   Platz sparen auf großen Bildschirmen
========================================================== */

@media (min-width: 1200px) {

    .grid-corner,
    .grid-day-head {
        padding: 6px;
        font-size: 19px;
    }

    .gleis-label {
        font-size: 22px;
    }

}

/* ==========================================================
   Grid Feinschliff - Arbeitsstand
========================================================== */

.vehicle-card-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 36px;

    padding: 3px 6px;

    text-align: center;
}

.vehicle-card-grid-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.05;
}

.vehicle-card-grid-work {
    font-size: 8.5px;
    line-height: 1.05;
    max-height: 20px;
}

.vehicle-card-grid-range {
    font-size: 8px;
    line-height: 1;
    margin-top: 1px;
    margin-bottom: 1px;
}

/* Gleisnummern links */
.gleis-label {
    font-size: 23px;
}

/* Tagesüberschriften */
.grid-day-head,
.grid-corner {
    font-size: 20px;
    padding: 6px;
}

/* Etwas ruhigere Zeilen */
.gleis-grid-row {
    min-height: 44px;
}

.gleis-track {
    gap: 3px;
    padding: 3px;
}

/* ==========================================================
   Grid-Kacheln größer für TV-Ansicht
========================================================== */

.gleis-grid-row {
    min-height: 58px;
}

.vehicle-card-grid {
    min-height: 40px;
    padding: 4px 8px;
}

.vehicle-card-grid-title {
    font-size: 15px;
    line-height: 1.1;
}

.vehicle-card-grid-work {
    font-size: 9px;
    line-height: 1.1;
    max-height: 26px;
}

.vehicle-card-grid-range {
    font-size: 8.5px;
}