/* delivery.css */

/* Stili Generali */
body {
    font-family: Arial, sans-serif;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

/* Contenitore Principale */
#delivery-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* Titolo e Pulsanti in Testata */
#delivery-container h1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 2em;
    margin-bottom: 20px;
    position: relative;
}

/* Contenitore dei Pulsanti in Testata */
#header-buttons {
    display: flex;
    align-items: center;
    position: absolute;
    right: 0;
    top: 0;
}

/* Pulsante Archivia Ordini */
#archive-orders {
    background-color: #dc3545; /* Rosso */
    color: #fff;
    border: none;
    padding: 6px 15px; /* Ridotto del 40% */
    font-size: 0.6em; /* Ridotto del 40% */
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
}

#archive-orders:hover {
    background-color: #c82333;
}

/* Pulsante Aggiungi Ordine */
#add-order-button {
    background-color: #007bff; /* Blu */
    color: #fff;
    border: none;
    padding: 6px 12px; /* Ridotto del 40% */
    font-size: 0.6em; /* Ridotto del 40% */
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

#add-order-button:hover {
    background-color: #0069d9;
}

/* Sezione Statistiche */
#delivery-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

#delivery-stats p {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 1.2em;
    flex: 1;
    margin: 0 10px;
    text-align: center;
}

/* Contenitore Ordini */
#orders-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

/* Card Ordine */
.order-card {
    background-color: #fff;
    width: calc(23% - 40px);
    margin: 10px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
}

.order-card:hover {
    transform: scale(1.02);
}

.order-card h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.order-card ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
}

.order-card li {
    margin-bottom: 5px;
}

.order-card p {
    font-size: 1em;
    font-weight: bold;
}

/* Colori Stato Ordine - Card interamente colorate */
.order-card.green {
    background-color: #d4edda; /* Verde chiaro */
}

.order-card.yellow {
    background-color: #fff3cd; /* Giallo chiaro */
}

.order-card.red {
    background-color: #f8d7da; /* Rosso chiaro */
}

/* Pulsanti nella Card Ordine */
.order-card button {
    color: #fff;
    border: none;
    padding: 7px 15px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
}

/* Pulsante Pagato (verde) */
.order-card .paid-button {
    background-color: #28a745; /* Verde */
}

.order-card .paid-button:hover {
    background-color: #218838;
}

/* Pulsante Elimina Ordine (rosso) */
.order-card .delete-order-button {
    background-color: #dc3545; /* Rosso */
}

.order-card .delete-order-button:hover {
    background-color: #c82333;
}

/* Modali */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

/* Contenuto Modale */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 15px; /* Ridotto il padding */
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation-name: animatetop;
    animation-duration: 0.4s;
}

@keyframes animatetop {
    from {opacity: 0; margin-top: -50px;}
    to {opacity: 1; margin-top: 5%;}
}

/* Pulsante Chiudi Modale */
.close-button, .close-add-order {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}

.close-button:hover, .close-add-order:hover {
    color: #000;
}

/* Stili Form nei Modali */
.modal-content h2 {
    margin-top: 0;
    font-size: 1.2em;
}

.modal-content label {
    display: block;
    margin: 2px 0; /* Ridotto lo spazio */
    font-size: 0.9em;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="password"],
.modal-content input[type="email"],
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 6px; /* Ridotto il padding */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9em;
}

/* Stili Generali dei Pulsanti nel Modale */
.modal-content button {
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 5px;
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Pulsanti Specifici */
#submit-new-order, #save-order-changes {
    background-color: #28a745; /* Verde */
}

#submit-new-order:hover, #save-order-changes:hover {
    background-color: #218838;
}

/* Pulsante Aggiungi Prodotto */
#add-product-to-new-order, #add-product-button {
    background-color: #17a2b8; /* Ciano */
}

#add-product-to-new-order:hover, #add-product-button:hover {
    background-color: #138496;
}

/* Pulsante Modifica Ordine (giallo) */
#edit-order-button {
    background-color: #ffc107; /* Giallo */
    color: #212529;
}

#edit-order-button:hover {
    background-color: #e0a800;
}

/* Pulsante Conferma Modifiche */
#confirm-product-modifications {
    background-color: #ffc107; /* Giallo */
    color: #212529;
}

#confirm-product-modifications:hover {
    background-color: #e0a800;
}

/* Pulsanti nelle Liste Modali */
.modal-content .remove-product-button {
    background-color: #dc3545; /* Rosso */
    padding: 6px 12px;
    font-size: 0.8em;
    margin-top: 0;
}

.modal-content .remove-product-button:hover {
    background-color: #c82333;
}

.modal-content .modify-product-button {
    background-color: #ffc107; /* Giallo */
    color: #212529;
    padding: 6px 12px;
    font-size: 0.8em;
    margin-top: 0;
}

.modal-content .modify-product-button:hover {
    background-color: #e0a800;
}

.modal-content .select-product-button {
    background-color: #007bff; /* Blu */
    padding: 6px 12px;
    font-size: 0.8em;
    margin-top: 0;
}

.modal-content .select-product-button:hover {
    background-color: #0069d9;
}

/* Radio Button nel Form */
.modal-content input[type="radio"] {
    margin-right: 3px;
}

.modal-content label > input {
    margin-right: 5px;
}

.modal-content h3 {
    margin-top: 10px;
    font-size: 1em;
}

.modal-content ul {
    list-style-type: none;
    padding: 0;
}

.modal-content li {
    margin-bottom: 3px;
    font-size: 0.9em;
}

/* Prodotti del Menu */
.modal-content .category-products {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.menu-product {
    background-color: #f8f9fa;
    padding: 10px;
    margin: 5px;
    border-radius: 10px;
    width: calc(45% - 20px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.menu-product p {
    margin: 0 0 5px 0;
    font-size: 0.9em;
}

.menu-product button {
    background-color: #17a2b8; /* Ciano */
    color: #fff;
    padding: 6px 12px;
    font-size: 0.8em;
}

.menu-product button:hover {
    background-color: #138496;
}

/* Pulsante Annulla (rosso) vicino alle categorie */
#cancel-add-product {
    background-color: #dc3545; /* Rosso */
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    margin: 3px;
}

#cancel-add-product:hover {
    background-color: #c82333;
}

/* Contenitore dei Pulsanti Categoria e Annulla */
#category-buttons-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

/* Stili Extra */
#category-container, #product-container {
    margin-top: 10px;
}

/* Pulsanti di Categoria ed Extra */
.macro-category-button, .category-button, .extra-category-button {
    background-color: #6c757d; /* Grigio */
    color: #fff;
    border: none;
    padding: 6px 10px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    margin: 3px;
}

.macro-category-button:hover, .category-button:hover, .extra-category-button:hover {
    background-color: #5a6268;
}

/* Form nei Modali */
#base-ingredients-form, #extra-ingredients-form {
    margin-top: 5px;
}

#base-ingredients-form ul, #extra-ingredients-form ul {
    list-style-type: none;
    padding: 0;
}

#base-ingredients-form li, #extra-ingredients-form li {
    margin-bottom: 3px;
    font-size: 0.9em;
}

/* Allineamento di checkbox e radio button */
.modal-content input[type="checkbox"],
.modal-content input[type="radio"] {
    vertical-align: middle;
    margin-right: 5px;
}

.modal-content label {
    display: flex;
    align-items: center;
}

/* Stili Responsivi */
@media screen and (max-width: 1400px) {
    .order-card {
        width: calc(30% - 40px); /* 3 card per riga */
    }
}

@media screen and (max-width: 992px) {
    .order-card {
        width: calc(45% - 40px); /* 2 card per riga */
    }
}

@media screen and (max-width: 768px) {
    #orders-container {
        flex-direction: column;
        align-items: center;
    }

    .order-card {
        width: calc(100% - 40px); /* Card a tutta larghezza su mobile */
    }

    .menu-product {
        width: calc(100% - 20px);
    }

    #delivery-stats {
        flex-direction: column;
    }

    #delivery-stats p {
        margin: 10px 0;
    }

    /* Bottoni più piccoli nei modali */
    .modal-content button {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    /* Riduzione dei margini */
    .modal-content label {
        margin: 2px 0;
    }

    .modal-content h3 {
        margin-top: 8px;
    }

    .modal-content li {
        margin-bottom: 3px;
    }

    /* Gestione dei bottoni per evitare sovrapposizioni */
    .modal-content .form-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }

    .modal-content .form-buttons button {
        flex: 1;
        padding: 6px 8px;
        font-size: 0.8em;
    }
}
