/* ===========================
   COLORI PRINCIPALI
=========================== */

:root{
    --orange:#F28C28;
    --dark-orange:#D96C06;
    --red:#C62828;
    --light-orange:#FFF3E0;
    --light-bg:#FFD8B3;
    --green:#43A047;
}

/* ===========================
   RESET
=========================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Poppins',sans-serif;
}

html,
body{
    width:100%;
    height:100%;
    overflow:hidden;
}

body{
    margin:0;
    width:100%;
    min-height:100vh;

    background:
        url("img/sfondo.png") center center / cover no-repeat,
        radial-gradient(circle at top left,
        #d8c8c3 0%,
        #c8b6b0 45%,
        #b79d95 100%);

    overflow:hidden;
}

/* Forma in basso */

body::before{
    content:"";
    position:fixed;
    left:-250px;
    bottom:-250px;
    width:650px;
    height:650px;
    background:var(--light-bg);
    border-radius:45% 55% 60% 40%;
    filter:blur(90px);
    z-index:-10;
}

/* Overlay */

body::after{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(70,40,40,0.25);
    pointer-events:none;
}

/* ===========================
   LAYOUT
=========================== */

.container{
    display:flex;
    width:100vw;
    height:100vh;
}

/* ===========================
   SIDEBAR
=========================== */

.sidebar{
    width:220px;
    background:#ffffff;
    display:flex;
    flex-direction:column;
    padding:20px;
    border-radius:0 30px 30px 0;
    box-shadow:0 15px 35px rgba(0,0,0,.08);
}

/* ===========================
   LOGO
=========================== */

.logo{
    width:170px;
    height:170px;
    margin:0 auto 30px;
    background:#fff;
    border-radius:30px;
    display:flex;
    justify-content:center;
    align-items:center;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.logo img{
    width:140px;
    height:140px;
    object-fit:contain;
}

/* ===========================
   MENU
=========================== */

.sidebar ul{
    list-style:none;
    flex:1;
    display:flex;
    flex-direction:column;
}

.sidebar li{
    display:flex;
    align-items:center;
    gap:15px;
    padding:16px 18px;
    margin-bottom:12px;
    cursor:pointer;
    border-radius:18px;
    transition:.25s;
    font-size:16px;
    color:#555;
}

.sidebar li i{
    width:22px;
    text-align:center;
    font-size:18px;
}

.sidebar li:hover{
    background:var(--light-orange);
    color:var(--orange);
}

.sidebar li.active{
    background:var(--light-orange);
    color:var(--orange);
    font-weight:600;
}

/* ===========================
   CONTENUTO
=========================== */

.content{
    flex:1;
    padding:22px 30px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
}

/* ===========================
   HEADER
=========================== */

header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

header h1{
    font-size:30px;
    font-weight:700;
}

header p{
    color:#888;
    font-size:14px;
    margin-top:4px;
}

.topInfo{
    display:flex;
    gap:15px;
}

.points{
    background:var(--orange);
    color:white;
    padding:12px 22px;
    border-radius:18px;
    box-shadow:0 8px 20px rgba(0,0,0,.08);
    font-size:14px;
}

.date{
    background:white;
    color:#444;
    padding:12px 22px;
    border-radius:18px;
    box-shadow:0 8px 20px rgba(0,0,0,.08);
    font-size:14px;
}

/* ===========================
   CARD SENSORI
=========================== */

.cards{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
    margin-bottom:20px;
}

.card{
    background:#ffffff;
    border-radius:25px;
    padding:22px;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
    transition:.3s;
    display:flex;
    flex-direction:column;
    justify-content:center;
    border-top:4px solid var(--orange);
}

.card:hover{
    transform:translateY(-5px);
}

.card i{
    font-size:38px;
    color:var(--orange);
    margin-bottom:12px;
}

.card h2{
    font-size:18px;
    margin-bottom:8px;
    color:#444;
}

.card span{
    font-size:28px;
    font-weight:700;
    margin-bottom:10px;
}

.good{
    color:var(--green);
    font-weight:600;
}

.medium{
    color:var(--orange);
    font-weight:600;
}

.bad{
    color:var(--red);
    font-weight:600;
}
/* ===========================
   GRAFICO
=========================== */

.graphBox{
    background:#fff;
    border-radius:25px;
    padding:15px;
    margin-bottom:20px;
    height:270px;
    box-shadow:0 8px 20px rgba(242,140,40,.25);
}

.graphBox canvas{
    width:100% !important;
    height:210px !important;
}

/* ===========================
   LEGENDA
=========================== */

.legend{
    margin-top:20px;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:15px;
}

.legend div{
    background:white;
    border-radius:18px;
    padding:16px;
    display:flex;
    align-items:center;
    gap:10px;
    box-shadow:0 8px 18px rgba(0,0,0,.08);
    font-size:14px;
}

.legend span{
    width:16px;
    height:16px;
    border-radius:50%;
}

.green span{
    background:var(--green);
}

.orange span{
    background:var(--orange);
}

.red span{
    background:var(--red);
}

/* ===========================
   ANIMAZIONI
=========================== */

.card,
.graphBox,
.legend div{
    animation:fade .5s ease;
}

@keyframes fade{
    from{
        opacity:0;
        transform:translateY(15px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* ===========================
   PAGINE
=========================== */

.page{
    display:none;
    width:100%;
    height:100%;
}

.activePage{
    display:block;
}

/* ===========================
   SENSORI
=========================== */

.sensorGrid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
    margin-top:20px;
}

.sensorCard{
    background:#fff;
    border-radius:22px;
    padding:22px;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
    transition:.3s;
    border-top:4px solid var(--orange);
}

.sensorCard:hover{
    transform:translateY(-5px);
}

.sensorCard h3{
    font-size:20px;
    margin-bottom:15px;
    color:#333;
}

.sensorCard p{
    color:#777;
    margin-bottom:10px;
    font-size:15px;
}

.sensorCard button{
    margin-top:15px;
    border:none;
    background:var(--orange);
    color:white;
    padding:12px 18px;
    border-radius:12px;
    cursor:pointer;
    transition:.3s;
}

.sensorCard button:hover{
    background:var(--red);
}

/* ===========================
   DATI IN TEMPO REALE
=========================== */

table{
    width:100%;
    border-collapse:collapse;
    background:white;
    border-radius:20px;
    overflow:hidden;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
    margin-top:20px;
}

thead{
    background:var(--orange);
    color:white;
}

th{
    padding:16px;
    font-size:15px;
}

td{
    padding:14px;
    text-align:center;
    border-bottom:1px solid #f0f0f0;
    font-size:14px;
}

tbody tr:hover{
    background:#fff3e0;
}

/* ===========================
   IMPOSTAZIONI
=========================== */

.settingsBox{
    background:white;
    padding:30px;
    width:500px;
    border-radius:25px;
    display:flex;
    flex-direction:column;
    gap:18px;
    margin-top:20px;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.settingsBox label{
    display:flex;
    flex-direction:column;
    gap:8px;
    font-weight:500;
}

.settingsBox input[type=number]{
    padding:12px;
    border-radius:10px;
    border:1px solid #ddd;
    outline:none;
}

.settingsBox input[type=checkbox]{
    margin-right:8px;
}

.settingsBox button{
    border:none;
    padding:14px;
    border-radius:12px;
    background:var(--orange);
    color:white;
    font-size:15px;
    cursor:pointer;
    transition:.3s;
}

.settingsBox button:hover{
    background:var(--red);
}

/* ===========================
   SCROLL
=========================== */

#sensori,
#realtime,
#settings{
    overflow-y:auto;
    padding-right:10px;
}

#sensori::-webkit-scrollbar,
#realtime::-webkit-scrollbar,
#settings::-webkit-scrollbar{
    width:6px;
}

#sensori::-webkit-scrollbar-thumb,
#realtime::-webkit-scrollbar-thumb,
#settings::-webkit-scrollbar-thumb{
    background:#d0d0d0;
    border-radius:10px;
}
/* ===========================
   LOGO LUMAIR
=========================== */

.lumair-logo{
    margin-top:auto;
    margin-bottom:20px;
    text-align:center;

    font-family:'Poppins',sans-serif;
    font-size:32px;
    font-weight:800;
    letter-spacing:6px;

    background:linear-gradient(
        90deg,
        #F28C28 0%,
        #ff7a1a 35%,
        #e95a1d 70%,
        #C62828 100%
    );

    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
    background-clip:text;

    text-shadow:
        0 0 15px rgba(242,140,40,0.35),
        0 0 25px rgba(198,40,40,0.25);
}

/* ===========================
   RESPONSIVE
=========================== */

@media(max-width:1200px){

    .sidebar{
        width:190px;
    }

    .cards{
        grid-template-columns:1fr;
    }

    .sensorGrid{
        grid-template-columns:1fr;
    }

    .legend{
        grid-template-columns:1fr;
    }

    .settingsBox{
        width:100%;
    }

    header{
        flex-direction:column;
        align-items:flex-start;
        gap:15px;
    }

    .topInfo{
        flex-direction:column;
    }
}

@media(max-width:900px){

    .container{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        height:auto;
        border-radius:0;
    }

    .content{
        overflow:auto;
    }
}
/* ===========================
   MOBILE
=========================== */

@media screen and (max-width: 768px){

    .container{
        flex-direction: column;
    }

    .sidebar{
        width:100%;
        height:auto !important;
        min-height:auto !important;
        padding:15px;
        border-radius:0;
    }

    .logo{
        width:90px;
        height:90px;
        margin:0 auto 15px;
    }

    .logo img{
        width:70px;
        height:70px;
    }

    .sidebar ul{
        display:flex;
        flex-direction:row;
        justify-content:space-around;
        align-items:center;
        flex-wrap:wrap;
    }

    .sidebar li{
        margin:0;
        padding:10px;
        font-size:13px;
        gap:5px;
    }

 .lumair-logo{
    display:block;
    width:100%;
    text-align:center;
    margin-top:15px;
    margin-bottom:10px;
    font-size:28px;
    font-weight:800;
    letter-spacing:6px;
}
.logo{
    margin:20px auto 10px auto;
}

    .content{
        width:100%;
        padding:15px;
        overflow-y:auto;
    }

    header{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .topInfo{
        width:100%;
        flex-direction:column;
    }

    .points,
    .date{
        width:100%;
        text-align:center;
    }

    .cards{
        grid-template-columns:1fr;
    }

    .legend{
        grid-template-columns:1fr;
    }

    .graphBox{
        height:300px;
    }

    table{
        display:block;
        overflow-x:auto;
        white-space:nowrap;
    }

    .settingsBox{
        width:100%;
    }
}
@media screen and (max-width:768px){

    .sidebar{
        display:flex;
        flex-direction:column;
    }

    .logo{
        order:1;
        margin:20px auto 10px auto !important;
    }

    .lumair-logo{
        order:2;
        display:block;
        width:100%;
        text-align:center;
        margin-bottom:20px;
        font-size:28px;
        font-weight:800;
        letter-spacing:6px;
    }

    .sidebar ul{
        order:3;
        width:100%;
        display:flex;
        flex-direction:row;
        justify-content:space-around;
        flex-wrap:wrap;
    }
}