/* ---- Style général ---- */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    text-align: center;
}

/* ---- Navigation ---- */
.navigation {
    display: flex;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.navigation button {
    padding: 12px 25px;
    margin: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    outline: none;
}

.navigation button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.navigation button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.navigation .active {
    background: rgba(255, 255, 255, 0.6);
    color: #2c3e50;
}

/* ---- En-tête ---- */
.header {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
    margin: 20px auto;
    width: 60%;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

/* ---- Tableau ---- */
.table-container {
    width: 80%;
    margin: auto;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    overflow-x: auto; /* Permet le défilement horizontal sur petits écrans */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

th {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 18px;
}

/* Lavage non conforme */
tr.non-conforme {
    background: rgba(231, 76, 60, 0.8); /* Couleur rouge pour les lignes non conformes */
    cursor: pointer;
    transition: all 0.3s;
}

tr.non-conforme:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.02);
}

/* ---- Filtres de recherche ---- */
.filters {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    width: 70%;
    margin: 20px auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.filters input {
    padding: 10px;
    margin: 5px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
}

.filters button {
    padding: 10px;
    margin: 5px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    background: #1abc9c;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    outline: none;
}

.filters button:hover {
    background: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.filters button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* ---- Options d'affichage ---- */
.view-options {
    margin: 10px auto;
    padding: 10px;
}

.view-options label {
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
}

/* ---- Section Consommation ---- */
.consumption {
    width: 80%;
    margin: 30px auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.consumption-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    width: 150px;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
}

.consumption-card:hover {
    transform: scale(1.05);
}

.consumption-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: white;
}

.consumption-card p {
    font-size: 22px;
    font-weight: bold;
    color: #1abc9c;
    margin: 0;
}

.consumption-card i {
    font-size: 30px;
    color: white;
    margin-bottom: 10px;
}

/* Colonnes détaillées masquées par défaut */
.detailed-column {
    display: none;
}

/* Quand mode détaillé activé */
.detailed-view .detailed-column {
    display: table-cell;
}

/* Bouton "Comparer" dans la page 1 */
.btn-comparer {
    background: #1abc9c;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

/* Effet au survol */
.btn-comparer:hover {
    background: #16a085;
    transform: scale(1.05);
}

/* ---- Responsive Design ---- */

/* Pour les tablettes et écrans plus petits */
@media (max-width: 992px) {
    .header {
        width: 80%;
    }

    .table-container,
    .filters,
    .consumption {
        width: 90%;
    }
}


/* Pour les tablettes en mode portrait et grands téléphones */
@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
        align-items: center;
    }

    .navigation button {
        width: 80%;
        margin-bottom: 10px;
    }

    .header {
        width: 90%;
        font-size: 20px;
    }

    .table-container {
        width: 95%;
    }
    
    .consumption-card {
        width: 40%; /* 2 cartes par ligne */
        margin-bottom: 20px;
    }
}

/* Pour les téléphones en mode portrait */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .navigation button {
        width: 95%;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .header {
        font-size: 18px;
        padding: 10px;
    }

    th, td {
        padding: 8px;
        font-size: 12px;
    }

    th {
        font-size: 14px;
    }

    .filters {
        flex-direction: column;
        align-items: center;
    }

    .filters input, .filters button {
        width: 90%;
    }
    
    .consumption {
        flex-direction: column;
        align-items: center;
    }

    .consumption-card {
        width: 80%; /* 1 carte par ligne */
    }
}