﻿.calibration-management {
/*    --calibration-management-available-height: calc(var(--app-height, 100dvh) - var(--footer-height, 0px) - var(--footer-gap, 0px));*/

    display: flex;
    flex-direction: column;
    color: white;
    padding: calc(var(--app-base-unit) * 0.5);
    gap: var(--app-base-unit);
/*    height: var(--calibration-management-available-height);*/
/*    max-height: var(--calibration-management-available-height);*/
    margin-top: 0.5rem;
    height: 93%;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
}

/* scrollable container similar to alarm management */

.calibration-table-wrapper {
    flex: 1;
    max-height: calc(100% - var(--app-base-unit));
    overflow-y: auto;
    margin: calc(var(--app-base-unit) * 0.5) 0;
    border-radius: 0.3rem;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.calibration-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--app-base-unit);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calibration-table th,
.calibration-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: calc(var(--app-base-unit) * 0.25) calc(var(--app-base-unit) * 0.5);
    text-align: left;
}

.calibration-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.8);
}

.calibration-table th {
    background: inherit;
    color: #00E5E2;
    font-weight: 300;
}

.calibration-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.calibration-table tr:hover {
    background: rgba(0, 229, 226, 0.1);
}

.unit-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unit-select .custom-unit-input {
    width: 6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem;
    border-radius: 0.3rem;
}

.calibration-management .btn {
    margin-top: calc(var(--app-base-unit) * 0.25);
}

.calibration-management td .btn {
    margin-right: 0.5rem;
}





/* === MEDIA === */

/* Mobile  */

@media (max-width: 699px) {
    .calibration-table {
        border: 0;
    }

    .calibration-table thead {
        display: none;
    }

    .calibration-table,
    .calibration-table tbody,
    .calibration-table tr {
        display: block;
        width: 100%;
    }

    .calibration-table tr {
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        background: rgba(0,0,0,0.4);
    }

    .calibration-table td {
        border: none;
        display: flex;
        align-items: start;
        gap: 0.5rem;
    }

    .calibration-table td::before {
        min-width: 10rem;
        content: attr(data-label);
        color: #00E5E2;
        white-space: nowrap;
    }

    .calibration-table td > * {
        min-width: 0;
        justify-self: end;
    }

    .calibration-table td {
        text-align: left;
    }

    .calibration-management td .btn {
        margin: 0;
    }

    .calibration-table td[data-label="Alarms"] .alarm-link-list {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .calibration-table td[data-label="Description"],
    .calibration-table td[data-label="Sensor"] {
         width: 100%;
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;
    }

    .calibration-table tr:nth-child(even) {
        background: rgba(0, 0, 0, 0.4);
    }
}

/* WVGA / WVGA-Narrow (720x480, 800x480) */

@media (min-width: 700px) and (max-width: 880px) {

    .calibration-table {
        border: 0;
    }

    .calibration-table thead {
        display: none;
    }

    .calibration-table,
    .calibration-table tbody,
    .calibration-table tr {
        display: block;
        width: 100%;
    }

    .calibration-table tr {
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 1rem;
        background: rgba(0,0,0,0.4);
    }

    .calibration-table td {
        border: none;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .calibration-table td::before {
        content: attr(data-label);
        min-width: 12rem;
        color: #00E5E2;
        white-space: nowrap;
    }

    .calibration-table td > * {
        min-width: 0;
        justify-self: end;
    }

    .calibration-table td {
        text-align: left; 
    }
            
    .calibration-management td .btn {
        margin: 0; 
    }

    .calibration-table td[data-label="Alarms"] .alarm-link-list {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .calibration-table td[data-label="Description"],
    .calibration-table td[data-label="Sensor"] {
        align-items: start;
    }

    .calibration-table td[data-label="Description"] > *,
    .calibration-table td[data-label="Sensor"] > * {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .calibration-table tr:nth-child(even) {
        background: rgba(0, 0, 0, 0.4);
    }
}

/* WSVGA / XGA (1024x600, 1024x768) */

@media (min-width: 881px) and (max-width: 1150px) {
    .calibration-table {
        font-size: 0.85rem;
    }
}

/* WXGA / HD720 / SXGA (1280x720/800/1024) */

@media (min-width: 1151px) and (max-width: 1600px) {

    .calibration-table {
        font-size: 0.85rem;
    }
}

/* HD / WUXGA (1920x1080, 1920x1200) */

@media (min-width: 1601px) and (max-width: 2879px) {
    /* standard styles */
}

/* 4K (3840x2160) */

@media (min-width: 2880px) {

    .calibration-table th, .calibration-table td {
        font-size: 2.5rem;
    }
}