/*
    Document   : common_npccls.css
    Description: Responsive NPCC Load Management Summary Dashboard
*/

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'AttariFontz';
    src: url('../files/36907_Swiss721LightBT.ttf');
    font-weight: normal;
    font-style: normal;
}

html {
    height: 100%;
}

body {
    height: 100%;
    overflow: hidden;
    font-family: 'AttariFontz', 'Segoe UI', Arial, sans-serif;
    background: #111;
    color: #fff;
    margin: 0;
}

/* ── Main Container - fills entire viewport ── */
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* ── Title Bar ── */
.title-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #cccccc;
    border-bottom: 1px solid #333;
    height: 5.5vh;
    min-height: 30px;
    flex-shrink: 0;
}

.title-bar h1 {
    font-family: 'Times New Roman', Times, serif;
    font-size: 5.5vh;
    font-weight: normal;
    letter-spacing: 4px;
    color: #000;
}

.logout-link {
    position: absolute;
    left: 0.5vw;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.npcc-logo {
    height: 4.5vh;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.title-clock {
    position: absolute;
    right: 1vw;
    display: flex;
    align-items: center;
    gap: 9px;
    background: #c0c0c0;
    padding: 0.3vh 0.5vw;
    border-radius: 3px;
}

.title-clock .clock-digit {
    font-family: 'AttariFontz', 'Segoe UI', Arial, sans-serif;
    font-size: 2.5vh;
    font-weight: bold;
    color: #111;
    letter-spacing: 1px;
}

.title-clock .clock-separator {
    font-family: 'AttariFontz', 'Segoe UI', Arial, sans-serif;
    font-size: 2.5vh;
    font-weight: bold;
    color: #111;
    animation: blink 1s ease infinite;
}

@keyframes blink {
    0%   { opacity: 1.0; text-shadow: 0 0 10px rgba(0,198,255,0.3); }
    50%  { opacity: 0; text-shadow: none; }
    100% { opacity: 1.0; text-shadow: 0 0 10px rgba(0,198,255,0.3); }
}

/* ── Table Wrapper - takes all remaining space ── */
.data-table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ── Frozen DISCO name column — stays visible during horizontal scroll ── */
.data-table thead th.col-name,
.data-table tbody td.cell-name,
.data-table tfoot td.cell-name {
    position: sticky;
    left: 0;
    z-index: 2;
}
.data-table thead th.col-name {
    z-index: 3;
    background: #1e1e1e;
}

/* ── Data Table - fills wrapper completely ── */
.data-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Column widths */
.data-table .col-logo { width: 4%; }
.data-table .col-name { width: 16%; }
.data-table .col-data { width: 20%; }

/* ── Column Headers ── */
.data-table thead th {
    background: #1e1e1e;
    color: #f0f0f0;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.8vh;
    font-weight: normal;
    letter-spacing: 2px;
    padding: 0;
    text-align: right;
    padding-right: 1.9vw;
    border-bottom: 1px solid #333;
    border-left: 1px solid #333;
    height: 3vh;
}

.data-table thead th.col-logo,
.data-table thead th.col-name {
    text-align: left;
    border-left: none;
}

/* ── Data Rows - fixed height distribution ── */
.data-table tbody tr {
    border-bottom: 1px solid #2a2a2a;
    height: 6.2vh;
}

.data-table tbody td {
    padding: 0;
    vertical-align: middle;
    font-family: 'AttariFontz', 'Segoe UI', Arial, sans-serif;
    font-size: 5.7vh;
    letter-spacing: 5px;
    white-space: nowrap;
    background: #111;
    overflow: hidden;
}

.data-table tbody td.cell-logo {
    text-align: center;
    padding: 0 0.2vw;
    background: #151515;
}

.data-table tbody td.cell-logo img {
    height: 4.5vh;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.data-table tbody td.cell-name {
    font-family: 'Times New Roman', Times, serif;
    font-size: 5vh;
    font-weight: normal;
    letter-spacing: 3px;
    color: #d0d0d0;
    text-align: left;
    padding-left: 0.5vw;
    background: #151515;
}

.data-table tbody td.cell-value {
    text-align: right;
    padding-right: 1.5vw;
    color: #fff;
    overflow: hidden;
    border-left: 1px solid #333;
}

/* Un-Scheduled OFF column is always red */
.data-table tbody td.cell-unsch,
.data-table tfoot td.cell-unsch {
    color: #ff0000;
}

/* ── Total Row ── */
.data-table tfoot tr {
    border-top: 2px solid #444;
    height: 6.2vh;
}

.data-table tfoot td {
    padding: 0;
    vertical-align: middle;
    font-family: 'AttariFontz', 'Segoe UI', Arial, sans-serif;
    font-size: 5.5vh;
    font-weight: normal;
    letter-spacing: 5px;
    white-space: nowrap;
    background: #111;
}

.data-table tfoot td.cell-logo {
    background: #151515;
}

.data-table tfoot td.cell-name {
    font-family: 'Times New Roman', Times, serif;
    font-size: 5.5vh;
    font-weight: normal;
    letter-spacing: 5px;
    color: #d0d0d0;
    text-align: right;
    padding-right: 1vw;
    background: #151515;
}

.data-table tfoot td.cell-value {
    text-align: right;
    padding-right: 1.5vw;
    color: #fff;
    border-left: 1px solid #333;
}

/* ── Mobile — horizontal scroll with frozen DISCO column ── */
@media (max-width: 600px) {
    body { overflow: hidden; }
    .dashboard-wrapper { height: 100vh; }
    .title-bar h1 {
        font-size: 14px;
        letter-spacing: 1px;
    }
    .title-clock .clock-digit,
    .title-clock .clock-separator {
        font-size: 11px;
    }
    .data-table .col-logo { display: none; }
    .data-table tbody td.cell-logo,
    .data-table tfoot td.cell-logo { display: none; }
    .data-table thead th.col-logo { display: none; }

    .data-table {
        table-layout: auto;
        width: max-content;
        min-width: 100%;
    }
    .data-table .col-name { width: auto; }
    .data-table .col-data { width: auto; }

    .data-table thead th {
        font-size: 11px;
        padding: 0 14px;
        letter-spacing: 1px;
    }
    .data-table tbody td {
        font-size: 22px;
        letter-spacing: 1px;
        padding: 0 14px;
    }
    .data-table tbody td.cell-name {
        font-size: 16px;
        padding: 0 12px;
        min-width: 120px;
    }
    .data-table tfoot td {
        font-size: 22px;
        padding: 0 14px;
    }
    .data-table tfoot td.cell-name {
        font-size: 16px;
        padding: 0 12px;
        min-width: 120px;
    }
}

/* ── Tablet ── */
@media (min-width: 601px) and (max-width: 1024px) {
    .title-bar h1 {
        font-size: 2.5vh;
        letter-spacing: 2px;
    }
    .data-table tbody td {
        font-size: 3.5vh;
        letter-spacing: 2px;
    }
    .data-table tfoot td {
        font-size: 3.5vh;
    }
}
