body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

h1,
h2 {
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
}

/* Form Styles */
#addProductForm {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    align-items: center;
}

#addProductForm input[type="text"],
#addProductForm input[type="number"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    height: 40px;
    box-sizing: border-box;
}

/* Custom Styled layout to handle custom placeholder name adjustments safely */
.custom-file-upload {
    display: inline-block;
    padding: 0 15px;
    height: 40px;
    line-height: 38px;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px dashed #3498db;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #2980b9;
    text-align: center;
    min-width: 160px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.custom-file-upload:hover {
    background-color: #ebf5fb;
    border-color: #2980b9;
}

/* Hides the default unstylable browser input details */
.custom-file-upload input[type="file"] {
    display: none;
}

#addProductForm button {
    height: 40px;
    padding: 0 20px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    white-space: nowrap;
    box-sizing: border-box;
}

#addProductForm button:hover {
    background-color: #219d54;
}

/* Product List Styles */
#productList {
    list-style: none;
    padding: 0;
}

#productList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 10px;
}

#productList li:nth-child(odd) {
    background-color: #f8f9fa;
}

.product-info {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.product-info .price {
    color: #27ae60;
    font-weight: bold;
    margin-left: 15px;
}

/* Container for the action buttons and thumbnails */
.product-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Thumbnail configuration positioned directly to the left of Edit button */
/* FIXED: Set width to auto so it wraps the image completely without side backgrounds */
.product-image-preview {
    width: auto;
    height: 45px;
    max-width: 60px;
    object-fit: contain;
    border-radius: 2px;
    border: 1px solid #bdc3c7;
    margin-right: 4px;
}

.no-image-placeholder {
    width: 35px;
    height: 45px;
    margin-right: 4px;
}

/* Style for the blue edit button */
.edit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.edit-btn:hover {
    background-color: #2980b9;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* --- TRUE YES/NO MODAL BACKDROP AND BOX STYLES --- */
.modal-overlay {
    display: none; /* Controlled dynamically by JavaScript via 'flex' */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #ffffff;
    padding: 24px 35px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.modal-box p {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: #2c3e50;
    font-weight: 500;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.modal-buttons button {
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 95px;
}

.btn-yes {
    background-color: #27ae60;
    color: white;
}

.btn-yes:hover {
    background-color: #219d54;
}

.btn-no {
    background-color: #e74c3c;
    color: white;
}

.btn-no:hover {
    background-color: #c0392b;
}

/* --- RESPONSIVE STYLES FOR MOBILE --- */
@media (max-width: 480px) {
    #addProductForm {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-file-upload {
        max-width: 100%;
    }

    .container {
        padding: 20px 15px;
    }

    #productList li {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .product-actions {
        width: 100%;
        justify-content: flex-end;
    }
}