/* ====== Styles généraux ====== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #1c1c1c;
    color: #f1f1f1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2em;
    color: #ecf0f1;
}

h2 {
    margin: 10px 0;
}

/* ====== Section Vérifier Produit ====== */
#scan-section {
    background-color: #2c3e50;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

/* Boutons scan et input */
#scan-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

#scan-options button {
    flex: 1 1 140px;
    padding: 8px 12px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: white;
}

#scan-options button:hover {
    background-color: #2980b9;
}

#manual-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#manual-input-container input[type="text"] {
    padding: 8px;
    font-size: 1em;
    flex: 1 1 200px;
    border-radius: 5px;
    border: none;
}

#manual-input-container button {
    padding: 8px 12px;
    font-size: 1em;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
}

#manual-input-container button:hover {
    background-color: #2980b9;
}

/* Zone résultat scan */
#scan-result {
    margin-top: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#scan-result img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 5px;
}

#scan-result .scan-info {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

#scan-result .product-name {
    font-size: 1em;
    font-weight: bold;
}

#scan-result .barcode {
    font-size: 0.95em;
    color: #f1c40f;
    word-break: break-word;
}

#scan-result .status {
    font-size: 1em;
    font-weight: bold;
}

/* Zone caméra */
#scanner {
    width: 100%;
    max-width: 400px;
    height: 400px;
    margin: 10px auto;
    border: 2px solid #3498db;
    border-radius: 10px;
    background-color: #000;
    overflow: hidden;
}

/* ====== Palettes et boutons principaux ====== */
#add-palette-button,
#delete-all-button {
    padding: 8px 12px;
    font-size: 1em;
    margin-bottom: 15px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
}

#add-palette-button {
    background-color: #27ae60;
    color: white;
}

#add-palette-button:hover {
    background-color: #1e8449;
}

#delete-all-button {
    background-color: #e74c3c;
    color: white;
}

#delete-all-button:hover {
    background-color: #c0392b;
}

/* ====== Palette ====== */
.palette {
    background-color: #7f8c8d;
    color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 2px solid #2980b9;
}

/* Champ nom palette */
.palette-name-input {
    padding: 5px;
    font-size: 1em;
    margin-bottom: 10px;
    width: 70%;
    border-radius: 5px;
    border: 1px solid #3498db;
    background-color: #7f8c8d;
    color: #fff;
}

/* Boutons palette */
.add-case-button,
.delete-palette-button {
    padding: 5px 10px;
    font-size: 0.9em;
    margin-right: 5px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    color: white;
}

.add-case-button {
    background-color: #f39c12;
}

.add-case-button:hover {
    background-color: #d35400;
}

.delete-palette-button {
    background-color: #e74c3c;
}

.delete-palette-button:hover {
    background-color: #c0392b;
}

/* ====== Caisses ====== */
.case {
    background-color: #ffffff;
    color: #333;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
}

.case-name-input {
    padding: 5px;
    font-size: 0.95em;
    margin-bottom: 8px;
    width: 60%;
    border-radius: 5px;
    border: 1px solid #3498db;
    background-color: #ffffff;
    color: #333;
}

/* Boutons caisse */
.add-product-button,
.delete-case-button {
    padding: 5px 10px;
    font-size: 0.85em;
    margin-right: 5px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    color: white;
}

.add-product-button {
    background-color: #2980b9;
}

.add-product-button:hover {
    background-color: #2471a3;
}

.delete-case-button {
    background-color: #c0392b;
}

.delete-case-button:hover {
    background-color: #922b21;
}

/* ====== Produits ====== */
.product {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 8px 0;
    border-radius: 5px;
    gap: 10px;
    flex-wrap: wrap;
}

.product img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 5px;
}

.product p {
    margin: 0;
    font-size: 0.9em;
}

/* Boutons produits */
.edit-product-button,
.delete-product-button {
    padding: 4px 8px;
    font-size: 0.8em;
    margin-left: 5px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.edit-product-button {
    background-color: #f1c40f;
    color: white;
}

.edit-product-button:hover {
    background-color: #d4ac0d;
}

.delete-product-button {
    background-color: #e74c3c;
    color: white;
}

.delete-product-button:hover {
    background-color: #c0392b;
}

/* ====== Responsive mobile ====== */
@media (max-width: 600px) {
    #scan-options button {
        flex: 1 1 100%;
    }

    #manual-input-container input[type="text"] {
        flex: 1 1 100%;
    }

    #scanner {
        height: 250px;
    }

    .product {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .product img {
        width: 80px;
        height: 80px;
    }

    #scan-result {
        flex-direction: column;
        align-items: flex-start;
    }

    #scan-result img {
        width: 120px;
        height: 120px;
    }

    .edit-product-button,
    .delete-product-button {
        flex: 1;
        text-align: center;
        min-width: 100px;
    }
}
