/* ======================================================
   VARIABLES
====================================================== */
:root {
    --primary: #3f51b5;
    --danger: #d42020;
    --warning: #eecc62;
    --light: #fff;
    --border: #e5e5e5;
    --text: #333;
}

/* ======================================================
   TABLE
====================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--light);
    border-radius: 6px;
}

@media (min-width: 768px) {
    table {
        max-width: 900px;
        margin: 0 auto 40px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    }
}

th, td {
    padding: 8px 6px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    th, td {
        padding: 12px 16px;
        font-size: 14px;
    }
}

th {
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
}

/* ======================================================
   TOP BAR
====================================================== */
.top-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .top-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 20px;
    }

    .top-bar > :first-child { flex: 0 0 400px; }
    .top-bar > :last-child { flex: 1 0 800px; }
}



/* ======================================================
   INDICATEURS
====================================================== */
.rond {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 18%;
    border: 1px solid #000;
    font-weight: bold;
    font-size: 12px;
}

@media (min-width: 768px) {
    .rond {
        width: 60px;
        height: 60px;
        font-size: 14px;
    }
}

/* états */
.tadoON, .vaillantON { color: #fff; }
.tadoOFF, .vaillantOFF { background: #fff; color: #000; }

.tadoON { background: #e4b91f; }
.vaillantON { background: var(--danger); }

/* ======================================================
   CHAUFFAGE
====================================================== */
.chauff_base {
    padding: 2px 4px;
    border-radius: 4px;
}

.chauff_off {
    background: #fff;
    border: 1px solid #ccc;
}

.chauff_on,
.chauff_onfirst {
    background: var(--danger);
}

.chauff_tran_on,
.chauff_tran_onfirst {
    background: var(--warning);
}

.chauff_tran_off {
    background: var(--danger);
}

/* animations desktop only */
@media (min-width: 768px) {
    .chauff_offfirst {
        background: linear-gradient(270deg, rgba(0,0,0,0.02), rgba(114,114,114,0.33), rgba(0,0,0,0.02));
        animation: moveGradient 2s alternate infinite;
    }

    .chauff_tran_onfirst {
        background: linear-gradient(270deg, var(--warning), #756227, var(--warning));
        animation: moveGradient 2s alternate infinite;
    }

    .chauff_tran_offfirst,
    .chauff_onfirst {
        background: linear-gradient(270deg, var(--danger), #fc8501, var(--danger));
        animation: moveGradient 2s alternate infinite;
    }
}

@keyframes moveGradient {
    from { background-position: 0% 0%; }
    to   { background-position: 100% 0%; }
}

/* ======================================================
   GRAPH
====================================================== */
.graph_container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.graph_diff_time {
    border-radius: 4px;
    transform-origin: left;
    transition: transform 0.4s ease;
}

/* tailles */
.graph_diff_time.hour   { height: 8px; }
.graph_diff_time.minute { height: 5px; }
.graph_diff_time.second { height: 2px; }

@media (min-width: 768px) {
    .graph_diff_time.hour   { height: 10px; }
    .graph_diff_time.minute { height: 6px; }
    .graph_diff_time.second { height: 3px; }
}

/* total */
@media (min-width: 768px) {
    #graph_total {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        display: none;
    }


}
#graph_total {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: auto;
    flex-direction: column
    /*padding: 10px 50px;*/
}



/*#graph_total > * { flex: 0 0 40%; }*/

#graph_total .titre {
    margin: 10px 0 5px;
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
}

#graph_total .valeur {
    margin: 10px 0 5px;
    font-size: 16px;
    color: var(--text);
}

#graph_total .valeur span {
    display: inline-block;
    padding: 2px 4px;
}

#graph_total .valeur span:last-child {
    border: 1px solid #aaa;
    border-radius: 5px;
    min-width: 200px;
    background: #fff;
}

/* ======================================================
   NAVIGATION
====================================================== */
.navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
@media (max-width: 767px) {
    .navigation {
        flex-direction: column-reverse;
        /*/flex-wrap: wrap;*/
        gap: 20px;
        /*align-items: flex-end;*/
        /*align-items: stretch;*/
        /*margin: 5px 0px 5px 0px;*/
    }
}

.navigation h2 {
    font-size: xx-large;
}

.nav-days {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 5px 2px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.nav-days a,
.nav-days .disabled {
    /*padding: 8px;
    border-radius: 6px;*/
    font-size: 20px;
}

.nav-days a {
    color: #4a90e2;
    text-decoration: none;
}

.nav-days a:active {
/*transform: scale(0.98);*/
    font-size: 20px;
}


.flecheDroite {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-left: 20px solid #4a90e2;
    border-bottom: 10px solid transparent; /* Couleur et hauteur */
    margin-right: 10px;
}
.disabeld {
    border-left: 20px solid #c0bfbc;!important;
}
.flecheGaucge {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-right: 20px solid #4a90e2;
    border-bottom: 10px solid transparent; /* Couleur et hauteur */
    margin-left: 10px;
}


/* ======================================================
   TABLE REPORT
====================================================== */
.table-report {
    display: flex;
    justify-content: space-around;
}

.table-report > * {
    flex: 0 0 40%;
}

table.table-report {
    width: 100%;
    margin-bottom: 40px;
    font-family: Arial, sans-serif;
}

table.table-report th {
    background: #82a1c6;
}

table.table-report th,
table.table-report td {
    border: 1px solid #ddd;
    padding: 8px;
}

table.table-report tr:nth-child(even) {
    background: #fafafa;
}

/* ======================================================
   BARRES
====================================================== */
.bar-container {
    display: flex;
    width: 100%;
    height: 18px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.bar-on { height: 100%; }

.bar-tado {
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    margin-right: 2px;
}

.bar-vaillant {
    background: linear-gradient(90deg, #2196F3, #42A5F5);
}

.bar-label {
    font-size: 0.8em;
    margin-left: 4px;
}

/* ======================================================
   DATE
====================================================== */
#date,
.date-form input[type="date"] {
    margin-right: 0px;
    text-align: left;
    width: 1px;
}

#dateTrigger {
    width: 30px;
    height: 30px;
    cursor: pointer;
    margin-right: 10px;
    padding-top: 4px;
}