body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
}

.navbar {
    background-color: #6200ea;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-name {
    color: white;
    margin: 0;
    font-size: 20px;
}

.tablinks-container {
    display: flex;
    align-items: center;
}

.tablinks {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    color: white;
    font-size: 17px;
    margin: 0 5px;
    position: relative;
}

.tablinks:hover::after, .tablinks.active::after {
    width: 100%;
}

.tablinks::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}

.dropbtn {
    display: none;
    background-color: #6200ea;
    color: white;
    padding: 14px 16px;
    font-size: 17px;
    border: none;
    cursor: pointer;
}

.dropdown {
    display: none;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 20px;
    background-color: #6200ea;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content button {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border: none;
    background: none;
    width: 100%;
}

.dropdown-content button:hover {
    background-color: #7c4dff;
}

.tabcontent {
    display: none;
    padding: 20px;
    background-color: white;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tabcontent h3 {
    color: #6200ea;
    margin: 0;
}

.add-item-form {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap; /* Permet aux éléments de passer à la ligne suivante si nécessaire */
}

.item-name-input, .item-quantity-input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1; /* Permet aux champs de s'étendre pour remplir l'espace disponible */
    min-width: 100px; /* Largeur minimale pour les champs */
}

.add-item-button {
    padding: 5px 16px;
    background-color: #6200ea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.save-button {
    padding: 8px 16px;
    background: none;
    color: lightgray;
    font-weight: bold;
    border: solid 1px;
    border-radius: 4px;
    cursor: pointer;
}

.item-list {
    list-style: none;
    padding: 0;
}

.item-list li {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.item-name {
    flex: 1;
}

.item-quantity {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.item-quantity button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    background-color: white;
}

.decrease-quantity {
    color: #fc6b6b;
}

.increase-quantity {
    color: #59ae5c;
}

.quantity {
    margin: 0 10px;
}

.delete-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: black;
}

.toast {
    position: fixed; /* Position fixe pour flotter au-dessus du contenu */
    top: 60px; /* Position en dessous de la barre de menu */
    left: 50%;
    transform: translateX(-50%); /* Centre le message horizontalement */
    background-color: #b5b4b4;
    color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Assure que le message est au-dessus des autres éléments */
    opacity: 0; /* Initialement invisible */
    transition: opacity 0.5s ease-in-out; /* Animation pour l'apparition et la disparition */
    width: auto;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1; /* Rendre visible */
}

.modal {
    display: none; /* Caché par défaut */
    position: fixed; /* Position fixe pour flotter au-dessus du contenu */
    z-index: 1001; /* Assure que la boîte de dialogue est au-dessus des autres éléments */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 5px;
    text-align: center;
}

.modal-button {
    background-color: #6200ea;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.modal-button:hover {
    background-color: #7c4dff;
}

.sort-buttons {
    display: flex;
    justify-content: flex-start; /* Aligne les boutons à gauche */
    gap: 10px;
    margin-bottom: 20px;
    padding-left: 20px; /* Ajoute un peu d'espace à gauche pour l'alignement */
}

.sort-button {
    padding: 6px 12px;
    background-color: #6200ea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.sort-button:hover {
    background-color: #7c4dff;
}

.add-category-button {
    background-color: #7c4dff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    margin-left: 10px;
    line-height: 1; /* Assure que le texte est bien centré */
}

@media screen and (max-width: 600px) {
    .tablinks-container {
        display: none;
    }

    .dropdown {
        display: block;
    }

    .dropbtn {
        display: block;
    }

    .add-item-form {
        flex-direction: column; /* Empile les éléments verticalement */
        align-items: stretch; /* Étire les éléments pour qu'ils aient la même largeur */
    }

    .item-name-input, .item-quantity-input {
        width: 100%; /* Prend toute la largeur disponible */
        margin-bottom: 10px; /* Ajoute un espace entre les éléments empilés */
    }
}
