/* Reset de base */
:root {
    --myWhite: #d5f2ff;
    --menu-bg: #34495e;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Styles généraux */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

header {
    text-align: center;
    margin: 0 auto;
    margin-bottom: 20px;
    padding: 1rem;
    color: #d5f2ff;
    background-color: #26aceb;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--myWhite);
}
.nav-menu {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
}
.nav-menu.active {
    left: 0;
}
.nav-item {
    margin-left: 1rem;
}
.nav-link {
    color: var(--myWhite);
    text-decoration: none;
    font-weight: bold;
}

.site-title {
    line-height: 1.2;
}

header p {
    margin-bottom: 20px;    
    text-align: center;
}
header a {
    text-decoration: none;
    color: #fff;
}
header a:hover {
    text-decoration: none;
    color: #e6ff07;
}

.container {
    max-width: 800px;
    margin: 0 auto 20px;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Styles du formulaire */
form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="number"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.input-group {
    display: flex;
    margin-bottom: 10px;
}

.input-group input,
.input-group select {
    flex: 1;
    margin-right: 10px;
}

.input-group .removeOil {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#addOil {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
}

button[type="submit"] {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    width: 100%;
}

/* Styles des résultats */
.result {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
}

.lessive {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cardSoude,
.cardEau {
    flex-basis: 48%;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quantity {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-top: 10px;
}

.quality h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.qualityCard {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.qualityCard progress {
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
}

progress::-webkit-progress-bar {
    background-color: #ecf0f1;
    /* background-color: #e0e0e0; */
    border-radius: 10px;
    overflow: hidden;
}

.qualityCard progress::-webkit-progress-value {
    border-radius: 10px;
    background-image: 
        linear-gradient(
            45deg, 
            rgba(255, 255, 255, .15) 25%, 
            transparent 25%, 
            transparent 50%, 
            rgba(255, 255, 255, .15) 50%, 
            rgba(255, 255, 255, .15) 75%, 
            transparent 75%, 
            transparent
        );
    background-size: 40px 40px;
    animation: stripes 1s linear infinite, progressAnimation 1.5s ease-out;
}

.qualityCard .value {
    display: block;
    text-align: right;
    font-size: 14px;
    color: #777;
    margin-top: 5px;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.5s forwards;
}

.quality {
    margin-top: 20px;
}

#soapQualityChart {
    max-width: 100%;
    height: 300px;
}

/* Couleurs spécifiques pour chaque propriété */
.durete progress::-webkit-progress-value { background-color: #3498db; }
.hardness progress::-webkit-progress-value { background-color: #4CAF50; }
.cleansing progress::-webkit-progress-value { background-color: #2196F3; }
.condition progress::-webkit-progress-value { background-color: #FFC107; }
.bubbly progress::-webkit-progress-value { background-color: #9C27B0; }
.creamy progress::-webkit-progress-value { background-color: #FF5722; }
.healthy progress::-webkit-progress-value { background-color: #795548; }

.text-center {
    text-align: center;
}

.rainbow {
    background-image: linear-gradient(to left, violet, indigo, blue, green, yellow, orange, red);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-animation 5s linear infinite;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #333;
}

footer a {
    text-decoration: none;
}

footer #starter {
    flex-basis: 50%;
    background-color: #333;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

footer #starterText h2 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #fff;
}
footer #starter a {
    padding: 10px;
    background-color: #e2d9d9;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
}

/* Animation déclenchée au chargement ou mise à jour */
.qualityCard.animate progress::-webkit-progress-value {
    animation: progressAnimation 1s ease-out;
}

.qualityCard.animate .value {
    animation: fadeIn 0.5s ease-out 0.5s forwards;
}

/* Message d'erreur */
.error {
    background-color: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Animations */

@keyframes rainbow-animation {
    100% {background-position: 100vh;}
}

@keyframes stripes {
    0% {background-position: 0 0;}
    100% {background-position: 40px 0;}
}

@keyframes progressAnimation {
    0% { width: 0; }
    100% { width: var(--value); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive design max-width: 768px*/
@media screen and (max-width: 858px) {
    .hamburger {
        display: block;
        position: relative;
        z-index: 1000;
    }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: var(--menu-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }

    .nav-menu.active {
      left: 0;
    }

    .nav-item {
      margin: 1.5rem 0;
    }

    .hamburger.active .hamburger-line:nth-child(2) {
      opacity: 0;
    }

    .hamburger.active .hamburger-line:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .hamburger-line:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
    }
}

@media (max-width: 600px) {
    .lessive {
        flex-direction: column;
    }

    .cardSoude,
    .cardEau {
        flex-basis: 100%;
        margin-bottom: 10px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input,
    .input-group select {
        margin-right: 0;
        margin-bottom: 10px;
    }
    footer {
        display: block;
    }
}