body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f0f2f5;
  color: #1c1e21;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Changed height to min-height to allow content to expand */
  text-align: center;
}

.container {
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 800px;
  margin: 20px auto; /* Added margin for better spacing */
  max-height: 95vh; /* Limit container height to 95% of viewport height */
  overflow-y: auto; /* Add vertical scroll if content exceeds max-height */
  box-sizing: border-box; /* Include padding/border in height calculation */
}

h1 {
  color: #0d6efd;
}

nav {
  margin-bottom: 20px;
}

nav button {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 0 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

nav button:hover {
  background-color: #0b5ed7;
}

nav button.active-btn {
  background-color: #0a58ca; /* Darker shade for active button */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

section {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: left;
}

.hidden {
  display: none !important;
}

form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

form input[type="text"],
form input[type="number"] {
  width: calc(100% - 22px); /* Account for padding and border */
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box; /* Include padding/border in width */
}

/* Form grid for two-column layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two columns */
  gap: 15px; /* Space between fields */
  margin-bottom: 15px;
}

.form-grid > div {
  text-align: left;
}

/* Adjust input margins inside grid to prevent double spacing */
.form-grid input {
  margin-bottom: 5px;
}

/* Image upload specific styles */
.image-upload-container {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  margin-bottom: 20px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.image-upload-box {
  border: 2px dashed #ccc;
  border-radius: 8px;
  width: 120px; /* Fixed width for boxes */
  height: 120px; /* Fixed height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.image-upload-box label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  color: #666;
  font-size: 0.9em;
  font-weight: normal; /* Override label bold */
  margin-bottom: 0; /* Remove default label margin */
}

.image-upload-box label img.upload-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 5px;
  opacity: 0.6;
}

.image-upload-box .image-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.image-upload-box img.preview-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
}

/* Form action buttons container */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

.form-actions button#draftsBtn,
.form-actions button#cancelBtn {
  background-color: #6c757d; /* Gray for secondary actions */
  color: white;
}

.form-actions button#draftsBtn:hover,
.form-actions button#cancelBtn:hover {
  background-color: #5a6268;
}

.form-actions button#submitEmployeeFormBtn {
  background-color: #0d6efd; /* Blue for primary action */
  color: white;
}

.form-actions button#submitEmployeeFormBtn:hover {
  background-color: #0b5ed7;
}

/* Adjust general form button style to not affect these */
form button[type="submit"] {
  /* This rule will target #addWorkerBtn too, ensure it's overridden by specific ID */
  background-color: #0d6efd; /* Ensure primary submit button has blue color */
}

#employeeListContainer table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

#employeeListContainer th,
#employeeListContainer td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

#employeeListContainer th {
  background-color: #f2f2f2;
}

#employeeListContainer img.preview-image-small {
  max-width: 100px;
  max-height: 100px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

/* New styles for password screen */
.auth-container {
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.auth-container input[type="password"] {
  width: calc(100% - 22px);
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.auth-container button {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.auth-container button:hover {
  background-color: #0b5ed7;
}

.message-text {
  margin-top: 15px;
  font-weight: bold;
}

.message-text.error {
  color: red;
}

.message-text.success {
  color: green;
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.modal-content h3 {
  margin-top: 0;
  color: #333;
}

.modal-content p {
  margin-bottom: 25px;
  color: #555;
  font-size: 1.1em;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-actions button {
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

.modal-actions button#confirmYesBtn {
  background-color: #0d6efd;
  color: white;
}

.modal-actions button#confirmYesBtn:hover {
  background-color: #0b5ed7;
}

.modal-actions button#confirmNoBtn {
  background-color: #dc3545; /* Red for No/Cancel */
  color: white;
}

.modal-actions button#confirmNoBtn:hover {
  background-color: #c82333;
}

/* Styles for action buttons in table */
.employee-actions-cell {
  white-space: nowrap; /* Keep buttons on one line */
}

.employee-actions-cell button {
  padding: 5px 10px;
  margin: 2px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.employee-actions-cell button.edit-btn {
  background-color: #ffc107; /* Yellow for edit */
  color: #333;
}

.employee-actions-cell button.edit-btn:hover {
  background-color: #e0a800;
}

.employee-actions-cell button.delete-btn {
  background-color: #dc3545; /* Red for delete */
  color: white;
}

.employee-actions-cell button.delete-btn:hover {
  background-color: #c82333;
}

/* New style for the image container in the list */
.employee-image-container {
    text-align: center;
}

.employee-image-container.hidden-image {
    display: none;
}

/* Style for the list controls (checkbox) */
.list-controls {
    text-align: right;
    margin-bottom: 10px;
    padding-right: 10px;
}

.list-controls label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}