body {
  font-family: 'Roboto', sans-serif;
  margin: 10px;
  background-color: #f8f9fa;
  color: #343a40;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.container {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 95%;
  max-width: 900px;
  box-sizing: border-box;
}

h1 {
  text-align: center;
  color: #007bff;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.product-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
  position: relative; /* For absolute positioning of ul */
}

.product-input>* {
  margin-right: 5px;
  margin-bottom: 5px;
}

label {
  display: inline-block;
  margin-bottom: 0;
  font-weight: 500;
  width: auto;
  text-align: left;
  font-size: 0.9em;
  min-width: 60px;
}

.price-display {
  font-size: 0.8em;
  color: #6c757d;
  white-space: nowrap;
  margin-right: 5px;
}

input[type="text"],
input[type="number"],
select {
  padding: 6px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
  flex-grow: 1;
  min-width: 0;
  font-size: 0.9em;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ced4da;
  border-radius: 4px;
  max-height: 100px;
  overflow-y: auto;
  width: auto;
  position: absolute;
  background-color: white;
  z-index: 10;
  left: 0;
  top: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 100%; /* Ensure full width */
  box-sizing: border-box;
}

li {
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.9em;
}

li:hover {
  background-color: #e9ecef;
}

#cpi-change {
  margin-top: 15px;
  font-weight: 600;
  font-size: 1em;
  text-align: center;
  color: #28a745;
}

.selected-products,
.individual-contributions {
  margin-top: 15px;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 8px;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.selected-products h3,
.individual-contributions h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.selected-product {
  margin-bottom: 5px;
  font-size: 0.9em;
}

.selected-product strong {
  font-weight: 600;
}

.output-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 0.9em;
}

.output-table th,
.output-table td {
  padding: 6px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.output-table th {
  background-color: #f0f0f0;
  font-weight: 500;
}

.output-table tr:last-child td {
  border-bottom: none;
}

.output-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 11;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-height: 80%;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

#pagination {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

#pagination button {
  margin: 0 5px;
  padding: 5px 10px;
  border: 1px solid #ccc;
  background-color: white;
  cursor: pointer;
  border-radius: 4px;
}

#pagination button.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

/* Media query for smaller screens */
@media (max-width: 576px) {
  .product-input {
      flex-direction: column;
      align-items: flex-start;
  }

  label {
      text-align: left;
      margin-bottom: 5px;
  }

  ul {
      left: 0;
      top: 100%;
      width: 100%;
  }
}