﻿.alarm-history-widget {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    color: white;
    box-sizing: border-box;
}

.alarm-history-name {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.alarm-history-table-wrapper {
    flex: 1;
    overflow-y: auto;
}

.alarm-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(8px, 2vh, 20px);
}

.alarm-history-table thead {
    background: #000;
}

.alarm-history-table th,
.alarm-history-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.4rem;
    text-align: left;
    font-weight: 300;
}

.alarm-history-table th {
    color: #00E5E2;
}

.alarm-history-table tr.priority-service {
    box-shadow: inset 0.4rem 0 0 #7F8C8D;
}

.alarm-history-table tr.priority-information {
    box-shadow: inset 0.4rem 0 0 #3498DB;
}

.alarm-history-table tr.priority-warning {
    box-shadow: inset 0.4rem 0 0 #F1C40F;
}

.alarm-history-table tr.priority-emergency {
    box-shadow: inset 0.4rem 0 0 #E67E22;
}

.alarm-history-table tr.priority-critical {
    box-shadow: inset 0.4rem 0 0 #C0392B;
}





/* === MEDIA === */

/* Mobile  */

@media (max-width: 699px) {
    .alarm-history-table {
        border: 0;
        width: 100%;
        border-collapse: collapse;
    }

    .alarm-history-table thead {
         display: none;
    }

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

    .alarm-history-table tbody tr {
         border: 1px solid rgba(255,255,255,0.2);
         border-radius: 0.5rem;
         margin-bottom: 0.5rem;
         padding: 0.5rem;
         background: rgba(0,0,0,0.35);
         overflow: hidden;
    }

    .alarm-history-table td {
         border: none;
         padding: 0.5rem;
         display: flex;
         flex-direction: column;
         align-items: start;
         gap: 0.5rem;
         word-break: break-word;
         font-size: 0.95rem;
    }

    .alarm-history-table td::before {
         content: attr(data-label);
         color: #00E5E2;
    }

    .alarm-history-name {
        font-size: 0.95rem;
    }

    .alarm-history-table {
        font-size: 0.85rem;
    }
}

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

@media (min-width: 700px) and (max-width: 880px) {
    .alarm-history-table {
        border: 0;
        width: 100%;
        border-collapse: collapse;
    }

    .alarm-history-table thead {
        display: none;
    }

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

    .alarm-history-table tbody tr {
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        background: rgba(0,0,0,0.35);
        overflow: hidden;
    }

    .alarm-history-table td {
        border: none;
        padding: 0.5rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 2rem;
        word-break: break-word;
    }

    .alarm-history-table td::before {
        width: 10%;
        content: attr(data-label);
        color: #00E5E2;
    }

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

     .alarm-history-table td .btn {
         margin: 0;
     }
}

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

@media (min-width: 881px) and (max-width: 1150px) {
    .alarm-history-name {
        font-size: 0.95rem;
    }

    .alarm-history-table {
        font-size: 0.85rem;
    }
}

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

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

    .alarm-history-name {
        font-size: 0.95rem;
    }

    .alarm-history-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) {

    .alarm-history-name {
        font-size: 2rem;
    }
}