/* ------------------------------
   Base Layout
--------------------------------*/
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
}

.container {
  margin: 20px auto;
  max-width: 1200px;
  padding: 0 10px;
  box-sizing: border-box;
}

/* ------------------------------
   Form Rows
--------------------------------*/
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;   /* wrap if smaller screens */
  gap: 8px;
}

.form-row label {
  flex: 0 0 auto;
  min-width: 100px;
  margin-right: 8px;
  font-weight: bold;
  font-size: 14px;
}

/* Dropdowns */
.form-row select {
  flex: 0 0 auto;
  width: 140px;
  padding: 4px 6px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  height: 30px;
}

/* Textbox */
.form-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 200px;
  max-width: 60ch;   /* up to ~60 characters */
  padding: 4px 6px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  height: 30px;
  box-sizing: border-box;
}

/* ------------------------------
   Search Form (textbox + button)
--------------------------------*/
#searchForm {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;   /* ensures wrapping instead of cut-off */
}

#searchForm button {
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background-color: #255d8b;
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

#searchForm button:hover {
  background-color: #1a4466;
}

/* ------------------------------
   Table Styling
--------------------------------*/
.table-wrapper {
  width: 100%;
  overflow-x: auto;  /* scroll only if absolutely needed */
}

table {
  border-collapse: collapse;
  width: 100%;
  table-layout: auto;  /* auto-distribute */
  margin-top: 10px;
  font-size: 14px;
  min-width: 700px;
}

th,
td {
  padding: 8px;
  border: 1px solid #ccc;
  word-wrap: break-word;
  white-space: normal;
  text-align: left;
}

th {
  background-color: #255d8b;
  color: white;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

tr:nth-child(odd) {
  background-color: #ffffff;
}

/* Column widths - flexible but balanced */
th:nth-child(1),
td:nth-child(1) {
  width: 30%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 25%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 25%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 20%;
}

/* ------------------------------
   Links
--------------------------------*/
a {
  color: #0056b3;
  text-decoration: none;
  cursor: pointer;
}

#alphabetFilter a {
  font-weight: normal;
  margin-right: 8px;
  color: #0056b3;
}

#alphabetFilter a.selected {
  color: #a80000;
  font-weight: bold;
}

#alphabetFilter a:first-child {
  margin-right: 10px;
  font-weight: bold;
}

/* ------------------------------
   Search Row
--------------------------------*/
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.search-row label {
  min-width: 60px;
}

/* ------------------------------
   Responsive (Mobile & Tablets)
--------------------------------*/
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
  }

  table {
    min-width: 100%;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row label {
    width: 100%;
    margin-bottom: 4px;
  }

  #searchForm {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  #searchForm input[type="text"],
  #searchForm button {
    width: 100%;
    max-width: none;
  }

  table {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  table {
    font-size: 11px;
  }

  th,
  td {
    padding: 4px;
  }
}
