/* --- Global Styles & Resets --- */
body {
  font-family:
    "Roboto",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background-color: #f4f7f9; /* Light grayish-blue background */
  color: #333;
  margin: 0;
  padding: 20px;
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 1000px; /* Max width for the content */
  margin: 20px auto; /* Center the container */
  background-color: #ffffff; /* White background for the content card */
  padding: 25px 30px;
  border-radius: 8px; /* Rounded corners */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Softer shadow */
}

h1 {
  color: #2c3e50; /* Dark blue-gray */
  text-align: center;
  margin-bottom: 30px;
  font-weight: 500; /* Slightly bolder */
  font-size: 2em;
}

/* --- Table Styles --- */
.table-responsive {
  overflow-x: auto; /* Allows horizontal scrolling on small screens */
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse; /* Removes gaps between cells */
  background-color: #fff;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0; /* Lighter border */
}

th {
  background-color: #f8f9fa; /* Very light gray for headers */
  color: #495057; /* Darker text for headers */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9em;
}

/* Alternating row colors for readability */
tbody tr:nth-child(even) {
  background-color: #fbfcfd;
}

tbody tr:hover {
  background-color: #f1f1f1; /* Highlight on hover */
  transition: background-color 0.2s ease-in-out;
}

td:first-child,
th:first-child {
  /* For the '#' column */
  width: 60px;
  text-align: center;
}

/* Style for forms within table cells (like the delete button form) */
td form {
  display: inline; /* Keeps the form from taking up block space */
  margin: 0;
  padding: 0;
}

.no-data {
  text-align: center;
  color: #777;
  font-style: italic;
  padding: 20px;
}

/* --- Status Badge Styles --- */
.status-badge {
  padding: 5px 12px;
  border-radius: 16px; /* Pill shape */
  font-size: 0.85em;
  font-weight: 500;
  color: #fff; /* Default text color (will be overridden) */
  display: inline-block; /* To make padding and radius work well */
  min-width: 80px; /* Ensures badges have some width */
  text-align: center;
  line-height: 1.4; /* Adjust for better vertical centering if needed */
}

/* Define colors for different statuses */
/* Make sure these class names match what's generated in your EJS */
/* Example status names: "Pending", "In Transit", "Delivered", "Error", "Completed" */

.status-pending {
  background-color: #ffc107; /* Amber */
  color: #212529; /* Dark text for light background */
}
.status-in-transit {
  background-color: #17a2b8; /* Info Blue/Teal */
  color: #fff;
}
.status-delivered,
.status-completed {
  /* Grouping similar statuses */
  background-color: #28a745; /* Success Green */
  color: #fff;
}
.status-error,
.status-failed {
  background-color: #dc3545; /* Danger Red */
  color: #fff;
}
.status-cancelled,
.status-on-hold {
  background-color: #6c757d; /* Secondary Grey */
  color: #fff;
}
/* Add more statuses as needed */
.status-processing {
  background-color: #007bff; /* Primary Blue */
  color: #fff;
}

/* --- Responsive Adjustments (Optional, more advanced) --- */
@media screen and (max-width: 768px) {
  body {
    padding: 10px;
  }
  .container {
    padding: 15px;
  }
  h1 {
    font-size: 1.6em;
    margin-bottom: 20px;
  }

  /* For very small screens, you might want to make the table display differently */
  /* This is a common "stacking" pattern, but requires data-label attributes */
  /*
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr { border: 1px solid #ccc; margin-bottom: 10px;}

  td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
    text-align: right;
  }

  td:before {
    position: absolute;
    top: 12px;
    left: 15px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
  }
  td:first-child { text-align: right; }
  .status-badge { float: right; }
  */
}

/* --- Form Styles --- */
.form-container {
  margin-top: 20px;
  background-color: #fdfdfd; /* Slightly off-white */
  padding: 20px 25px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e7e7e7;
}

.form-container h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.4em;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  /* If you add number inputs later */
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box; /* Important for width 100% with padding */
  font-size: 1em;
  transition:
    border-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
}

/* --- Button Styles --- */
.btn {
  padding: 10px 18px;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition:
    background-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
  text-decoration: none; /* For <a> tags styled as buttons */
  display: inline-block;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style for the delete button */
.btn-danger {
  background-color: #dc3545; /* Bootstrap's danger red */
  color: white;
  /* To make it slightly smaller than primary buttons if desired: */
  padding: 6px 12px; /* Adjusted padding */
  font-size: 0.9em;   /* Adjusted font size */
}

.btn-danger:hover {
  background-color: #c82333; /* Darker red on hover */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* Responsive form inputs if needed */
@media screen and (max-width: 600px) {
  .form-group input[type="text"] {
    /* Optionally adjust font size or padding for smaller screens */
  }
}
