body {
    font-family: sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f9f9f9;
}

/* Flags. */
.header-container > div.flags {
    flex: 0.75;
    display: flex;
    gap: 10px;
    text-align: left;
}

/* Image with flag. */
.header-container > div.flags > a > img {
    width: 40px;
}

.header-container > div.flags > a {
    filter: grayscale(70%);
}

/* Image with flag. */
.header-container > div.flags > a.active {
    filter: grayscale(0%);
}

.header-container > div.flags > a:hover {
    filter: grayscale(0%);
}

.header-container > div.logo {
    text-align: center;
}

.header-container > div.logo > img {
    width: 150px;
}

.header-container > h1 {
    flex: 1;
    color: #1a1a1a;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.hmi-box {
    background-color: #ffffff;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    text-decoration: none;
    color: #333333;
    height: 300px;
    overflow: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gas-usage-limit-warning {
    border: 1px solid #d1d1d1 !important;
    background: repeating-linear-gradient(
        45deg,
        #ffd5d5,           /* color of stripe 1 */
        #ffd5d5 20px,      /* width of stripe 1 */
        #ffffff 20px,      /* color of stripe 2 */
        #ffffff 40px       /* width of pattern (stripe 1 + stripe 2) */
    );
}

.hmi-box:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.station-name {
    height: 65px;
    overflow: hidden;
    font-weight: bold;
    color: #00468b;
}

.hmi-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    color: #ffffff;
    font-weight: bold;
}

.unit {
    margin-top: 5px;
    padding: 5px;
    border-radius: 5px;
    color: #ffffff;
}

div.runtime {
    margin-top: 5px;
    font-variant: small-caps;
}

.state1 {
    background-color: #28a745;
}

.state2 {
    background-color: #ffe699;
}

.state3 {
    background-color: #f4b084;
}

.state4 {
    background-color: #dc3545;
    animation: pulsate 1.5s infinite;
}

@keyframes pulsate {
    0% {
        box-shadow: 0 0 5px #dc3545, 0 0 10px #dc3545, 0 0 20px #dc3545;
    }
    50% {
        box-shadow: 0 0 10px #ff6666, 0 0 20px #ff6666, 0 0 30px #ff6666;
    }
    100% {
        box-shadow: 0 0 5px #dc3545, 0 0 10px #dc3545, 0 0 20px #dc3545;
    }
}

.state5 {
    background-color: #bfbfbf;
}

/* Compressors without know state. */
.state-100 {
    border: 1px solid #000;
    color: #000;
}

/* States which were not properly translated. */
.state-2147483648 {
    background-color: #6f6f6f;
}

.compressors-by-state {
    display: grid;
    /* Last column is for close button. */
    grid-template-columns: repeat(4, 1fr) auto;
    grid-template-rows: auto;
    gap: 20px;
    padding: 20px;
    text-shadow: #fff 0 1px 8px;
}

.overlay .compressors-by-state {
    height: 98vh;
    grid-template-rows: auto 1fr 3fr 10px;
}

.compressors-by-state .header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #000;
    font-size: 110%;
    font-weight: bold;
    text-align: center;
    height: 40px;
    border-radius: 8px;
    box-shadow: rgba(50, 50, 93, 0.25) 0 13px 27px -5px, rgba(0, 0, 0, 0.3) 0 8px 16px -8px;
}

.compressors-by-state div.running {
    background-color: #28a745;
}

.compressors-by-state div.standby {
    background-color: #ffe699;
}

.compressors-by-state div.error {
    background-color: #dc3545;
}

.compressors-by-state div.offline {
    background-color: #bfbfbf;
}

.compressors-by-state a.close-button {
    text-decoration: none;
}

.compressors-by-state div.column {
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px;

    /*  Ensures that row has 400px and cells are scrollable.
        Note that row in grid has 400px height.
    */
    height: 100%;
    overflow-y: auto;
}

.compressors-by-state div.column div {
    border-radius: 8px;
    padding: 10px;
}

.no-animation {
    animation: none !important;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: rgba(220, 220, 220, 0.85);
    backdrop-filter: blur(4px)
}

div.overlay div.compressors-by-state leaflet-component {
    grid-column: 1 / span 5;
}
