/* =========================================================
   MARANELLO OWNER PORTAL
   RESPONSIVE DESKTOP + MOBILE LAYOUT
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #0d0d0d;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    width: 100%;
    background: #101010;
    border-bottom: 1px solid #292929;
}

.header-inner {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;

    height: clamp(54px, 7vh, 64px);

    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: clamp(185px, 19vw, 225px);
    max-width: 40vw;
    height: auto;
    display: block;
}

.portal-title {
    border-left: 1px solid #444;
    padding-left: 16px;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-title strong {
    font-size: 15px;
    font-weight: 700;
}

.portal-title span {
    color: #aaa;
    font-size: 10px;
}


/* =========================================================
   MAIN DASHBOARD
========================================================= */

.dashboard {
    width: min(960px, calc(100% - 32px));

    margin:
        clamp(8px, 1.4vh, 12px)
        auto
        16px;
}


/* =========================================================
   CAMERA CARD
========================================================= */

.camera-card {
    background: #181818;
    border: 1px solid #343434;
    border-radius: 9px;
    overflow: hidden;
}

.camera-header {
    min-height: clamp(34px, 4.5vh, 40px);

    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.camera-title {
    font-size: 16px;
    font-weight: 700;
}

.camera-status {
    font-size: 11px;
    color: #74df88;
}


/* =========================================================
   CAMERA IMAGE
========================================================= */

.camera-image-wrap {
    width: 100%;
    background: #000;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}


/*
Desktop / laptop:
Use the available browser height so the bottom
cards stay visible without making the image tiny.
*/

.camera-image {
    width: 100%;
    height: auto;

    max-height: clamp(
        340px,
        calc(100dvh - 315px),
        540px
    );

    object-fit: contain;

    display: block;

    background: #000;
}


/* =========================================================
   CAMERA FOOTER
========================================================= */

.camera-footer {
    min-height: clamp(38px, 5vh, 44px);

    padding: 6px 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
}

.updated {
    color: #bbb;
    font-size: 11px;
}

.live-button {
    border: none;
    border-radius: 6px;

    background: #ffffff;
    color: #111;

    font-size: 12px;
    font-weight: 700;

    padding: 8px 16px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.live-button:hover {
    background: #e7e7e7;
    transform: translateY(-1px);
}


/* =========================================================
   SUMMARY GRID
========================================================= */

.summary-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;

    margin-top:
        clamp(8px, 1.5vh, 12px);

    align-items: stretch;
}

.summary-card {
    height: clamp(104px, 13vh, 120px);
    min-height: 104px;

    background: #181818;
    border: 1px solid #343434;
    border-radius: 9px;

    padding:
        clamp(10px, 1.5vh, 13px)
        14px;

    overflow: hidden;
}

.summary-label {
    color: #999;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1px;
    text-transform: uppercase;

    margin-bottom:
        clamp(5px, 0.8vh, 8px);
}

.summary-value {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.summary-note {
    color: #aaa;

    font-size: 11px;
    line-height: 1.35;

    margin-top: 6px;
}


/* =========================================================
   PROJECT PROGRESS
========================================================= */

.progress-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 12px;
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: #bbb;
}

.progress-bar {
    height: 8px;

    background: #333;

    border-radius: 10px;

    margin-top:
        clamp(10px, 1.5vh, 14px);

    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;

    background: #b00014;

    border-radius: inherit;

    transition: width 0.5s ease;
}


/* =========================================================
   WEATHER - CURRENT
========================================================= */

.weather-card {
    position: relative;
}

.weather-view {
    width: 100%;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-icon {
    font-size: clamp(27px, 3vw, 31px);
    line-height: 1;
}

.weather-temp {
    font-size: clamp(20px, 2.4vw, 23px);
    font-weight: 700;
    line-height: 1;
}

.weather-condition {
    color: #bbb;

    font-size: 11px;

    margin-top: 4px;
}

.weather-details {
    color: #888;

    font-size: 10px;

    margin-top: 8px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   WEATHER - FORECAST
========================================================= */

.weather-forecast-view {
    display: none;

    width: 100%;

    overflow: hidden;
}

.forecast-grid {
    display: flex;

    width: max-content;

    gap: 0;

    transform: translateX(0);

    transition: transform 1s ease;
}

.forecast-day {
    width: 68px;
    flex: 0 0 68px;

    text-align: center;

    border-right: 1px solid #303030;

    padding: 0 5px;
}

.forecast-day:last-child {
    border-right: none;
}

.forecast-name {
    color: #aaa;

    font-size: 8px;
    font-weight: 700;

    text-transform: uppercase;

    margin-bottom: 3px;
}
.forecast-date {
    color: #777;
    font-size: 7px;
    margin-bottom: 2px;
}

.forecast-icon {
    font-size: 16px;
    line-height: 1.1;
}

.forecast-high {
    font-size: 10px;
    font-weight: 700;

    margin-top: 2px;
}

.forecast-low {
    color: #888;

    font-size: 8px;

    margin-top: 1px;
}

.forecast-rain {
    color: #8db8d8;

    font-size: 7px;

    margin-top: 2px;
}


/* =========================================================
   SHORT DESKTOP WINDOWS
========================================================= */

@media
    (min-width: 851px)
    and (max-height: 720px) {

    .header-inner {
        height: 50px;
    }

    .logo {
        width: 180px;
    }

    .dashboard {
        margin-top: 6px;
    }

    .camera-header {
        min-height: 32px;
    }

    .camera-footer {
        min-height: 36px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .camera-image {
        max-height:
            calc(100dvh - 275px);
    }

    .summary-card {
        height: 96px;
        min-height: 96px;

        padding: 9px 12px;
    }

    .summary-grid {
        margin-top: 8px;
        gap: 10px;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 850px) {

    .header-inner {
        width:
            min(
                760px,
                calc(100% - 28px)
            );

        height: 62px;
    }

    .dashboard {
        width:
            min(
                760px,
                calc(100% - 28px)
            );
    }

    /*
    Tablet should prioritize image readability
    rather than forcing everything into one viewport.
    */

    .camera-image {
        width: 100%;
        height: auto;

        max-height: none;

        object-fit: contain;
    }

    .summary-grid {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .summary-card {
        height: auto;
        min-height: 112px;
    }

    .logo {
        width: 205px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 550px) {

    .header-inner {
        width: calc(100% - 22px);
        height: 58px;

        gap: 10px;
    }

    .dashboard {
        width: calc(100% - 16px);

        margin-top: 8px;
        margin-bottom: 16px;
    }

    .logo {
        width: 145px;

        max-width: 45vw;
    }

    .portal-title {
        padding-left: 10px;
    }

    .portal-title strong {
        font-size: 13px;
    }

    .portal-title span {
        font-size: 8px;
    }


    /* CAMERA */

    .camera-header {
        min-height: 38px;

        padding: 0 11px;
    }

    .camera-title {
        font-size: 14px;
    }

    .camera-status {
        font-size: 10px;
    }

    .camera-image {
        width: 100%;
        height: auto;

        max-height: none;

        object-fit: contain;
    }

    .camera-footer {
        min-height: 42px;

        padding: 6px 10px;

        gap: 8px;
    }

    .updated {
        font-size: 9px;
    }

    .live-button {
        padding: 8px 12px;

        font-size: 11px;

        white-space: nowrap;
    }


    /* SUMMARY */

    .summary-grid {
        grid-template-columns: 1fr;

        gap: 9px;

        margin-top: 9px;
    }

    .summary-card {
        height: auto;
        min-height: 108px;

        padding: 12px;
    }

    .summary-value {
        font-size: 16px;
    }


    /* WEATHER */

    .weather-icon {
        font-size: 29px;
    }

    .weather-temp {
        font-size: 22px;
    }

    .weather-details {
        font-size: 9px;
    }

    .forecast-day {
        width: 66px;
        flex-basis: 66px;
    }

}