﻿html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
    background-color: dimgray;
    font-family: Bahnschrift;
    font-size: clamp(12px,0.75vw,20px);
}



.dashboard {
    height: 100vh;
    width: 100vw;
    display: grid;
    grid-template-columns: minmax(220px,18vw) minmax(170px,13vw) minmax(180px,18vw) 1fr;
    gap: 8px;
    padding: 8px;
    box-sizing: border-box;
}


.plot {
    text-align: center;
    flex: 1;
    min-height: 0;
}

.header-card {
    background: white;
    border-radius: 7px;
    padding: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,.7);
    min-height: 0;
    overflow: hidden;
    background-color: #262626;
    color: lightgray;
    position: relative;
    z-index: 1;
    font-size:22px;
}

.panel-card,
.allsky-card {
    background: white;
    border-radius: 7px;
    padding: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,.7);
    min-height: 0;
    overflow: hidden;
    background-color: #262626;
    color: lightgray;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center;
}

    .panel-card:hover,
    .allsky-card:hover,
    .camera-card:hover {
        transform: scale(1.001);
        z-index: 9999;
        box-shadow: 0 12px 24px rgba(0,0,0,.9);
    }

    .panel-card.popup,
    .allsky-card.popup,
    .camera-card.popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(1);
        width: min(90vw, 900px);
        width: 70%;
        height: 70%;
        overflow: auto;
        z-index: 99999;
        box-shadow: 0 20px 60px rgba(0,0,0,.9);
        padding: 30px;
    }

        .panel-card.popup > *,
        .allsky-card.popup > *,
        .camera-card.popup > * {
            flex: 1 1 auto;
            min-height: 0;
        }

        .panel-card.popup img,
        .panel-card.popup .plot,
        .panel-card.popup iframe,
        .panel-card.popup canvas {
            height: 100%;
        }

.popup .plot-title {
    font-size: clamp(14px,0.75vw, 24px);
}

.popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99998;
}

/* =====================
   HEADRER
===================== */

.dashboard-header {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #121212;
    font-size: 30px;
    font-size: clamp(16px, 1.6vw, 26px);
}


/* =====================
   LEFT
===================== */



.column-left {
    /*    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;*/
    display: grid;
    gap: 8px;
    min-height: 0;
}

.status-card {
    font-size: clamp(0.5rem, 1.9vmin, 1.3rem);
}

.status-widget {
    font-size: inherit;
    line-height: 1.15;
}

.status-label,
.status-value,
.roof-state {
    font-size: 1em;
}

.status-widget svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

.status-widget > div {
    margin-bottom: .2em;
}

.roof-state {
    color: goldenrod;
    font-weight: bold;
}

#windPlot {
    flex: 1;
    min-height: 0;
    width: 100%
}


/* =====================
   PLOTS
===================== */


.column-middle {
    display: grid;
    grid-template-rows: repeat(4,1fr);
    gap: 8px;
    min-height: 0;
}


.plot-title {
    flex: 0 0 auto;
    font-size: clamp(.55rem, .65vw, .75rem);
    text-align: center;
    font-weight: 600;
    padding-bottom: .25rem;
}



/* =====================
 CAMERA
===================== */


.camera-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}


.camera-card {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,.35);
}

    .camera-card img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.camera-label {
    position: absolute;
    top: 6px;
    left: 8px;
    background: rgba(0,0,0,.5);
    color: white;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: .7rem;
}

/* =====================
 SKY
===================== */


.sky-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.allsky-card {
    flex: 1;
}


#allSkyImg {
    width: 100%;
    height: 100%;
}


    #allSkyImg img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

#windy {
    flex: 0 0 clamp(220px, 35vh, 360px);
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
}



/* =====================
 LAPTOPS
 ===================== */

@media(max-width:1400px) {


    .dashboard {
        grid-template-columns: 220px 150px 200px 1fr;
    }



    .camera-card {
        min-height: 0;
    }



    #windy {
        flex-basis: 220px;
    }
}

@media (max-height: 850px) {
    .panel-card {
        padding-top: 0;
    }

    .plot-title {
        position: absolute;
        top: 6px;
        left: 0;
        right: 0;
        z-index: 10;
        color: white;
        padding: 2px 6px;
        pointer-events: none;
    }

    .plot {
        height: 100%;
    }
}


/* =====================
 PHONE
 ===================== */


@media(max-width:992px) {

    html,
    body {
        height: auto;
        overflow: auto;
    }


    .dashboard {
        height: auto;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .dashboard {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "left"
            "middle"
            "camera"
            "sky"
    }

    .dashboard-header {
        grid-area: header
    }

    .column-left {
        grid-area: left;
    }

    .column-middle {
        grid-area: middle;
    }

    .camera-column {
        grid-area: camera;
    }

    .sky-column {
        grid-area: sky;
    }

    .column-left,
    .column-middle,
    .camera-column,
    .sky-column {
        width: 100%;
        height: auto;
    }

    /*    #windy {
        width: 100%;
        height: 350px;
        min-height: 350px;
    }*/
}

