.directory {
  --max-width: 1600px;
  --field-height: 36px;
  --field-radius: 3px;
  --input-padding-inline: 0.6rem;
  margin-bottom: 120px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  h1 { max-width: var(--max-width); margin-inline: auto; font-family: var(--font-family); }
}

#wpadminbar { position: absolute !important; }
.subheader { position: relative !important; }

/* Hide DataTables sort icons */
.directory-table thead th span.dt-column-order {
  display: none !important;
}

.dt-layout-table { overflow-x: auto; }

.filter-controls {
  position: sticky; top: 0;
  display: flex; justify-content: space-between;
  flex-wrap: wrap; align-items: center; gap: 20px;
  width: var(--max-width); height: 66px;
  margin: 2.1rem 0 1.2rem; padding: 0 18px 0 18px;
  max-width: 100%; margin-inline: auto;
  color: hsl(0 0% 100% / 1);
  background: hsl(0 0% 21% / 1);
  border-radius: 12px;
  box-shadow: 0 0 20px 0 hsl(0 0% 30% / 0.5);
  transition: all ease-in-out 100ms;
  select { margin-inline: 0.2rem; }
  input[type="search"] {
    height: var(--field-height);
    margin-left: 8px;
    padding-left: var(--input-padding-inline);
    padding-right: var(--input-padding-inline);
    border: none; outline: none;
    border-radius: var(--field-radius);
  }
  @media (width <= 1600px) { margin-inline: auto;  width: 98%; }
  @media (width < 800px) {
    width: 100%; padding: 0 6px; gap: 0;
    font-size: 12px; border-radius: 0;
    #tableControls { gap: 0; }
    .filter-controls__left button { padding: 0 10px; font-size: 12px; }
    .filter-buttons { gap: 4px; }
    .dt-length {
      select { width: 60px; height: 36px; }
      label { display: none; }
    }
    .dt-search input[type="search"] { width: 140px; }
  }
}

/* Styles applied when filter bar is stuck to top */
.filter-controls.is-stuck {
  width: 100%; max-width: 100%;
  z-index: 100;
  background: hsl(0 0% 0% / 0.8);
  backdrop-filter: blur(3px);
  border-bottom: 1px solid hsl(0 0% 0% / 1);
  border-radius: 0;
  box-shadow: 0 0 20px 0 hsl(0 0% 20% / 0.7);
}

.filter-controls__left { display: flex; align-items: center; gap: 10px; }
.filter-controls__right { display: flex; justify-content: flex-end; gap: 15px; }

#tableControls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 30px;
}

/* .filter-controls label {} */

.filter-buttons { display: flex; gap: 8px; }

.filter-btn {
  height: var(--field-height);
  padding: 1px 30px 0;
  font-size: 14px;
  background: hsl(0 0% 100% / 1);
  border: 1px solid hsl(0 0% 0% / 1);
  border-radius: var(--field-radius);
  transition: all 0.2s;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: #0066cc;
  color: #0066cc;
}

.filter-btn.active {
  background-color: #0066cc;
  border-color: #0066cc;
  color: white;
}

section.export {
  max-width: var(--max-width);
  margin-bottom: 32px; margin-inline: auto;
  text-align: right;
  a {
    padding: 9px 16px 8px;
    font-size: 12px; font-weight: bold; text-decoration: none;
    color: hsl(0 0% 100% / 0.95);
    background: linear-gradient(45deg, hsl(260 100% 38% / 1), hsl(260 100% 58% / 1));
    border-radius: 100px;
  }
}

/* Table Styling - Generic for all directory tables */
.directory-table {
  max-width: var(--max-width); margin-inline: auto;
}

.dt-layout-row:has(.dt-paging) {
  max-width: var(--max-width); margin-inline: auto !important;
}

/* .directory-table thead {} */
/* .directory-table thead tr {} */
/* .directory-table thead th {} */
/* .directory-table tbody {} */
/* .directory-table tbody tr {} */
/* .directory-table tbody tr:hover {} */
.directory-table tbody tr:nth-child(even) { background: hsl(215 60% 96% / 1); }
/* .directory-table tbody tr:nth-child(odd) {} */

.directory-table tbody td {
  --padding-vert: 10px;
  --padding-horz: 10px;
  padding: var(--padding-vert) var(--padding-horz) !important;
  border: none;
}

.directory-table a { color: hsl(210 80% 40% / 1); text-decoration: none; }

.directory-table a:hover { color: hsl(210 90% 30% / 1); text-decoration: underline; }

.directory-table a:visited { color: hsl(210 70% 35% / 1); }

.personnel-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.personnel-modal-content {
  position: relative;
  background-color: #ffffff;
  margin: auto;
  padding: 0;
  border: none;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.personnel-modal-content h2 {
  margin: 0;
  padding: 30px 40px 20px;
  font-size: 1.8em;
  color: #1a1a1a;
  font-weight: 600;
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  border-bottom: 2px solid #e9ecef;
}

.personnel-modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #666;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  z-index: 1;
}

.personnel-modal-close:hover,
.personnel-modal-close:focus {
  color: #000;
}

.personnel-modal-content > div:last-child {
  padding: 20px 40px 40px;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
}

.modal-section {
  margin-bottom: 30px;
  padding-top: 25px;
  border-top: 1px solid #e9ecef;
}

.modal-section:first-of-type {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.modal-section:last-of-type {
  margin-bottom: 0;
}

.modal-section h3 {
  margin: 0 0 16px 0;
  color: #0066cc;
  font-size: 1.1em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
}

.modal-section p {
  margin: 10px 0;
  line-height: 1.5;
  color: #333;
  white-space: pre-line;
}

.modal-section p strong {
  display: inline-block;
  min-width: 140px;
  color: #666;
  font-weight: 500;
}

.modal-section p strong::after {
  content: ":";
}

.modal-section p span {
  color: #1a1a1a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .personnel-modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .personnel-modal-content h2 {
    padding: 25px 25px 15px;
    font-size: 1.5em;
  }

  .personnel-modal-content > div:last-child {
    padding: 15px 25px 30px;
  }

  .modal-section p strong {
    display: block;
    margin-bottom: 4px;
  }

  .modal-section p strong::after {
    content: "";
  }
}

.view-details-btn {
  background-color: #0066cc;
  color: white;
  border: none;
  padding: 7px 12px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.view-details-btn:hover {
  background-color: #0052a3;
}

.view-details-btn:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.view-details-btn:active {
  background-color: #003d7a;
}
