/* ===================================== */
/*   ESTILOS GERAIS - DESKTOP            */
/* ===================================== */

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* TITLES - DESKTOP */
h1 {
    background: #004aad;
    color: white;
    padding: 40px;
    margin: 0 0 40px 0;
    font-size: 55px;        /* DESKTOP SIZE */
}

h2 {
    margin-top: 60px;
    color: #333;
    font-size: 35px;        /* DESKTOP SIZE */
}

h3 {
    background: #004aad;
    color: white;
    padding: 40px;
    margin: 0 0 40px 0;
    font-size: 20px;
}

/* ===================================== */
/*   ÚLTIMAS MEDIÇÕES - DESKTOP           */
/* ===================================== */

.ultimas-medicoes {
    margin-bottom: 40px;
}

.medidas-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.caixa-medida {
    padding: 20px;
    border-radius: 10px;
    width: 180px;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    font-size: 18px;
    text-align: center;
}

.caixa-medida.temp    { background: #e6a971; }
.caixa-medida.umid    { background: #72b5e6; }
.caixa-medida.amonia  { background: #b39ac3; }
.caixa-medida.co2     { background: #6bb5a3; }
.caixa-medida.luz     { background: #d6d1b5; }

.titulo {
    display: block;
    font-size: 16px;
}

.valor {
    display: block;
    font-size: 28px;
    margin-top: 5px;
}

/* ===================================== */
/*   GRÁFICOS - DESKTOP                  */
/* ===================================== */

canvas {
    background: white;
    padding: 10px;
    margin: 0;
    width: 100% !important;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

.grid-graficos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    width: 70%;
    margin: auto;
    grid-auto-rows: 300px;
}

.grid-graficos > div {
    display: flex;
    align-items: flex-start;
    justify-content: stretch;
}

.grid-graficos canvas {
    height: 120% !important;
}

.graficos-24h {
    margin-bottom: 150px;
}

.graficos-ciclo {
    margin-bottom: 200px;
}

/* ===================================== */
/*   TABLETS (900px)                     */
/* ===================================== */

@media (max-width: 900px) {

    .grid-graficos {
        grid-template-columns: 1fr;
        grid-auto-rows: unset;
    }

    .grid-graficos canvas {
        height: 330px !important;
    }
}

/* ===================================== */
/*   MOBILE (600px) - OVERRIDES          */
/* ===================================== */

@media (max-width: 600px) {

    /* TITLES – MOBILE */
    h1 {
        font-size: 32px !important;     /* MOBILE SIZE */
        padding: 20px !important;
        line-height: 36px !important;
        text-align: center !important;
    }

    h2 {
        font-size: 24px !important;     /* MOBILE SIZE */
        margin-top: 30px !important;
        text-align: center !important;
    }

    /* CENTER EVERYTHING */
    body, section, .medidas-container {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* CARDS – MOBILE */
    .medidas-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        width: 92% !important;
        margin-top: 10px !important;
    }

    .caixa-medida {
        width: 100% !important;
        padding: 12px !important;
        border-radius: 10px !important;
        font-size: 16px !important;
    }

    .titulo {
        font-size: 14px !important;
    }

    .valor {
        font-size: 22px !important;
        margin-top: 4px !important;
    }

    /* LUZ CARD ALONE IN THE CENTER */
    .caixa-medida.luz {
        grid-column: 1 / span 2 !important;
        width: 80% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* GRÁFICOS – MOBILE */
    .grid-graficos {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 20px !important;
        margin-top: 15px !important;
    }

    .grid-graficos canvas {
        height: 260px !important;
        width: 95% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* MOBILE SPACING */
    section {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .ultimas-medicoes {
        margin-bottom: 20px !important;
    }
}
