* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    background: #f4f6f9;
}

header {
    background: #024180;
    color: white;
    padding: 1rem;
    text-align: center;
}

main {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

form input,
form select,
form button,
#search {
    width: 100%;
    padding: 0.5rem;
    margin: 0.3rem 0;
}

button {
    background: #0074D9;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.3rem 0;
    cursor: pointer;
}

button:hover {
    background: #339cff;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    background: #ecf0f1;
    margin: 0.3rem 0;
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

li button {
    background: #e74c3c;
    padding: 0.3rem 0.5rem;
}

.help-list {
    list-style-type: "✔ ";
    /* Icône devant chaque li */
    padding-left: 20px;
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0;
}

.help-list li {
    margin-bottom: 6px;
    justify-content: start;
}

.help-list li strong {
    color: #0077cc;
    /* Met en avant les mots clés */
}

.help-list li em {
    color: #555;
    /* Mise en avant secondaire */
    font-style: normal;
}

footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    background: #2c3e50;
    color: white;
    margin-top: 2rem;
}

/* ================= MODAL ================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* ================= LISTES INVENTAIRE & MODAL ================= */

#predefinedList {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #ddd;
}

#inventoryContainer {
    max-width: 700px;
    margin: 0 auto;
}

#inventoryList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item */
.predefined-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    border-radius: 6px;
}

.item-info {
    flex: 1 1 60%;
    max-width: 60%;
    white-space: normal;
    /* ✅ retourne à la ligne si nécessaire */
    word-wrap: break-word;
}

.item-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    flex: 0 0 auto;
}

.qty-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    text-align: center;
    cursor: pointer;
}

.qty-input {
    width: 50px;
    height: 32px;
    text-align: center;
}

.add-btn {
    height: 32px;
    padding: 0 10px;
    cursor: pointer;
}

/* ================== MODE NUIT COMPLET ================== */
body.night-mode {
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body.night-mode input,
body.night-mode select,
body.night-mode button {
    background-color: #2c2c2c;
    color: #f0f0f0;
    border: 1px solid #444;
}

body.night-mode input:focus,
body.night-mode select:focus {
    outline: 1px solid #0077cc;
}

body.night-mode button {
    cursor: pointer;
    transition: background 0.2s;
}

body.night-mode button:hover {
    background-color: #3a3a3a;
}

/* Liste d'aide en mode nuit */
body.night-mode .help-list {
    list-style-type: "✔ ";
    color: #e0e0e0;
}

body.night-mode .help-list li strong {
    color: #4da3ff;
}

body.night-mode .help-list li em {
    color: #ccc;
}

body.night-mode header,
body.night-mode footer {
    background: #111;
    color: #eee;
}

body.night-mode section {
    background: #2c2c2c;
    color: #f0f0f0;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
}

body.night-mode li {
    background: #333;
    color: #f0f0f0;
}

body.night-mode li button {
    background: #555;
    color: #f0f0f0;
}

body.night-mode li button:hover {
    background: #666;
}

/* Modal sombre */
body.night-mode .modal-content {
    background-color: #2a2a2a;
    color: #f0f0f0;
    border: 1px solid #444;
}

body.night-mode .close {
    color: #ccc;
}

body.night-mode .close:hover {
    color: #fff;
}

/* Items prédéfinis et inventaire */
body.night-mode .predefined-item {
    background: #2f2f2f;
    border-bottom: 1px solid #444;
}

body.night-mode .item-info {
    color: #f0f0f0;
}

body.night-mode .item-controls button {
    background-color: #444;
    color: #f0f0f0;
}

body.night-mode .item-controls button:hover {
    background-color: #555;
}

body.night-mode .qty-input {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #555;
}

/* Scrollbar sombre pour la liste d'inventaire et modale */
body.night-mode #predefinedList,
body.night-mode .modal-content {
    scrollbar-width: thin;
    scrollbar-color: #555 #2a2a2a;
}

body.night-mode #predefinedList::-webkit-scrollbar,
body.night-mode .modal-content::-webkit-scrollbar {
    width: 8px;
}

body.night-mode #predefinedList::-webkit-scrollbar-thumb,
body.night-mode .modal-content::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

body.night-mode #bandeau-bas {
    background-color: #111;
    color: #eee;
}