/* styles.css */
body {
  font-family: Arial, sans-serif;
  background-color: #e0ded4;
  color: #3a3a3a;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#title {
  color: #2b3a42;
  text-align: center;
  margin-bottom: 20px;
}

#page-content {
  background-color: #f5f0e6;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 20px;
  max-width: 850px;
  width: 90%;
}

#selection-area {
  display: flex;
  gap: 20px;
  flex-direction: column;
}

#residents,
#electricity-list,
#demands,
#other-products {
  background-color: #d6ccc2;
  border: 1px solid #8e8d8a;
  border-radius: 8px;
  padding: 15px;
  flex: 1;
  min-width: 250px;
}

#electricity {
  max-height: 275px;
  overflow-y: auto;
}

#other-products > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  & > div {
    flex: 1 1 calc(33% - 0.5rem); /* Ensures a dynamic number of columns */
    min-width: 200px; /* Prevents elements from shrinking too small */
  }
}

h4 {
  margin-top: 0;
  color: #5c6b73;
}

input[type="checkbox"] {
  margin-right: 5px;
}

label {
  cursor: pointer;
}

.worker-label {
  display: block;
  margin-top: 8px;
}

/* input[type="number"] {
  width: 100%;
  padding: 5px;
  border: 1px solid #8e8d8a;
  border-radius: 4px;
} */

button[type="submit"] {
  background-color: #3b6064;
  color: #f5f0e6;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
}

button[type="submit"]:hover {
  background-color: #7395ae;
}

#results {
  margin-top: 20px;
  background-color: #eef1f1;
  border: 1px solid #3b6064;
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.demand-wrapper {
  display: flex;
  flex-direction: column;
}

.demand-wrapper > h4 {
  flex-grow: 0;
}

.demand-wrapper > div {
  flex-grow: 1;
}

.needs-checkbox-list {
  margin-bottom: 10px;
}

#demands thead td {
  color: #3b6064;
  font-weight: 700;
}

#demands tbody td {
  vertical-align: top;
}

/* Enhanced Table Styles */
.table-container {
  margin-top: 20px;
  width: 100%;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.styled-table thead {
  background-color: #3b6064;
  color: #f5f0e6;
  text-align: left;
}

.styled-table th,
.styled-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #d6ccc2;
}

.styled-table tbody tr:nth-child(odd) {
  background-color: #f0ebe3;
}

.styled-table tbody tr:nth-child(even) {
  background-color: #ede0d4;
}

.styled-table tbody tr:hover {
  background-color: #d6ccc2;
  cursor: pointer;
}

.styled-table th {
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.styled-table td {
  color: #3a3a3a;
}

.table-container h3 {
  background-color: #2b3a42;
  color: #f5f0e6;
  padding: 8px 12px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  margin: 0;
}

.table-container {
  background-color: #eef1f1;
  border: 1px solid #3b6064;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.styled-table tbody tr:nth-child(odd) {
  background-color: #f0eae0;
}

.styled-table tbody tr:nth-child(even) {
  background-color: #e5dcd3;
}

.styled-table tbody tr:hover {
  background-color: #d6ccc2;
  transition: background-color 0.3s ease;
}

.number-input {
  display: flex;
  align-items: stretch; /* Ensures labels and inputs have the same height */
  min-width: 200px; /* Adjust this value based on your design */

  & > label {
    background-color: burlywood;
    flex: 1; /* Makes the label size flexible */
    padding: 0.5rem;
    border-radius: 0.25rem 0 0 0.25rem;
    text-align: center;
  }

  & > input {
    flex: 0.5; /* Allows the input to scale dynamically */
    border: none;
    border-radius: 0 0.25rem 0.25rem 0;
    text-align: right;
    font-size: large;
    width: 100%; /* Ensures the input fills its space */
  }
}
