@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables */
:root {
  --bg-color: rgb(255, 255, 255);
  --text-color: rgb(20, 20, 20);
  --border-color: rgb(0, 0, 255); /* Blue border */
  --accent-color: rgb(0, 0, 255); /* Blue accent */
  --input-bg: rgb(255, 255, 255);
  --input-border: rgb(0, 0, 255); /* Blue input border */
  --title: rgb(20, 20, 20);
  --hover: rgb(210, 220, 255);
  --link: rgb(0, 0, 255);
  border: 15px solid blue;
}

body.dark {
  --bg-color: rgb(20, 20, 20);
  --text-color: rgb(180, 180, 180);
  --border-color: rgb(255, 255, 255);
  --accent-color: rgb(255, 255, 255);
  --input-bg: rgb(20, 20, 20);
  --input-border: rgb(255, 255, 255);
  --title: rgb(255, 255, 255);
  --hover: rgb(0, 0, 255);
  --link: rgb(255, 255, 255);
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
}

/* Container */
.container {
  width: 100%;
  /*max-width: 1200px;*/
  margin: auto;
  padding: 20px;
}

.header {
  float: left;
  width: 100%;
  max-width: 1200px;
  margin: auto;
}

.sitetitle {
    width: 100%;
    white-space: normal;   /* Allow wrapping */
    word-wrap: break-word; /* For long words */
    overflow-wrap: break-word;
}

/* Heading */
h1 {
  float: left;
  text-align: left;
  font-weight: 600;
  color: var(--accent-color);
}

h2 {
  /*float: left;*/
  text-align: left;
  margin-bottom: 3px;
  font-weight: 400;
  color: var(--text-color);
  display: inline-block;
  vertical-align: baseline;
}

h3 {
  /*float: left;*/
  text-align: left;
  margin-bottom: 10px;
  font-weight: 400;
  color: var(--text-color);
  display: inline-block;
  vertical-align: baseline;
}

p {
  clear: both;
}

/* Dark Mode Toggle Button */
.toggle-btn {
  background: blue;
  color: white;
  border: none;
  padding: 8px 12px 6px 12px;
  font-size: 18px;
  cursor: pointer;
  /*margin-bottom: 10px;*/
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;

}

body.dark .toggle-btn {
  background: blue;
  color: white;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

/* Table Head */
thead tr {
  padding-bottom: 0;
}

thead th {
  text-align: left;
  padding: 8px 15px 8px 0;
  font-weight: 400;
  font-size: 14px;
  user-select: none;
  vertical-align: middle;
  position: relative;
}

/* Remove filter titles on top */
thead th:nth-child(1),
thead th:nth-child(2),
thead th:nth-child(3),
thead th:nth-child(4) {
  padding-top: 4px;
  padding-bottom: 4px;
}

/* Inputs and Selects in thead */
thead input[type="text"],
thead select {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-color);
  outline: none;
  appearance: none;
  border-radius: 0;
  /*cursor: pointer;*/
  padding-right: 25px;
}

/* Select styling */
thead select {
  background-color: var(--input-bg);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-color) 50%),
    linear-gradient(135deg, var(--text-color) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 3px),
    calc(100% - 10px) calc(50% - 3px);
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

thead::after {
  content: "";
  display: block;
  height: 10px;
}

/* Table body rows */
tbody tr {
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: var(--hover); /* Light blue hover */
  color: inherit;
}

/* Table cells */
tbody td {
  padding: 10px 15px 10px 10px;
  font-size: 14px;
  vertical-align: center;
}

/* Name column always bold and blue */
tbody td[data-name="true"] {
  font-weight: 400;
  color: var(--accent-color);
  user-select: text;
}

/* Links column */
tbody td a {
  color: var(--link);
  text-decoration: none;
}

tbody td a:hover {
  text-decoration: underline;
}

/* Hide Bio column by default (desktop) */
thead th:nth-child(6),
tbody td:nth-child(6) {
  display: none;
}

/* When row is active (clicked), show Bio cell */
tbody tr.active td:nth-child(6) {
  display: table-cell;
  padding-top: 10px;
  color: #0000ff; /* blue text */
}

/* Optional: style the expanded bio cell */
tbody td:nth-child(6) {
  font-style: italic;
  font-size: 14px;
  background-color: #f9f9f9;
  border-top: 1px solid #0000ff;
}


/* Hide all bio-rows by default */
/* Default state: hide bio-row */
.bio-row {
}

.bio-row:hover {
  background-color: transparent !important;
  color: inherit !important;
}

body.dark .bio-row {
}

.bio-row td {
  cursor: text;
}

.bio-cell {
  padding: 10px 15px 10px 20px;
  overflow: hidden;
  font-size: 14px;
  color: var(--text-color);
  transition: max-height 0.4s ease, padding 0.3s ease;
  max-height: 500px;
}


body.dark .bio-cell {
  color: var(--text-color);
}

.bio-content {
  line-height: 1.5;
  max-width: 748px;
}

/* Responsive Mobile Styles */
@media (max-width: 748px) {
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: block;
    margin-bottom: 0;
  }
  
  thead th {
    padding: 8px 0; 
  }

  thead th:nth-child(5),
  thead th:nth-child(6) {
    display: none;
  }

  tbody td:nth-child(5),
  tbody td:nth-child(6) {
    display: none;
  }

  tbody tr {
    cursor: pointer;
    margin: 0;
  }

  tbody td[data-name="true"] {
    display: block;
    font-size: 16px;
  }

  tbody td:not([data-name="true"]) {
    display: none;
    padding-left: 20px;
    font-size: 14px;
  }

  tbody tr.active td:nth-child(2), td:nth-child(3), td:nth-child(4) {
    padding: 0 20px;
  }
  
  tbody tr.active td:nth-child(6) {
    padding: 0 15px 15px 15px;
  }
  
  tbody tr.active td {
    display: block;
  }

  thead select {
    background-image:
      linear-gradient(45deg, transparent 50%, var(--text-color) 50%),
      linear-gradient(135deg, var(--text-color) 50%, transparent 50%);
    background-position:
      calc(100% - 15px) calc(50% - 3px),
      calc(100% - 10px) calc(50% - 3px);
    background-repeat: no-repeat;
    background-size: 5px 5px;
  }
  
  .bio-row td {
    display: block !important;
    padding: 10px 15px 10px 0;
    background-color: var(--bg-color);
  }
  
  tbody tr:not(.active) td:not([data-name="true"]) {
    display: none;
  }

  tbody tr.active td {
    display: block;
  }
  
  .resourceForm {
    width: 100%;
  }

}

/* Top bar with toggle and about buttons */
.top-bar {
  display: flex;
  align-items: right;
  gap: 10px;
  margin-bottom: 5px;
  justify-content: flex-end;
}

/* About Toggle Button */
.about-toggle {
  background: blue;
  color: white;
  border: none;
  height: 40px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-left: auto;
}

body.dark .about-toggle {
  background: blue;
  color: white;
}

/* Full-width About Panel */
.about-panel {
  padding-left: 40px;
  padding-right: 40px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  background: blue;
  color: white;
  z-index: 1000;
  transition: height 0.4s ease, padding 0.5s ease;
  /* Hide scrollbar for Firefox */
  scrollbar-width: none; 
  /* Hide scrollbar for IE and Edge */
  -ms-overflow-style: none; 
}

/* When active */
.about-panel.show {
  height: 65vh;
  overflow-y: scroll;
  padding: 40px 40px;
}

.aboutLink {
  color: rgb(180, 180, 180);
  text-decoration: underline;
}

/* Content inside the panel */
.about-inner {
  float: left;
  margin: 0 auto;
  max-width: 748px;
  padding-right: 20px;
}

.about-inner h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.about-inner p {
  font-size: 16px;
  line-height: 1.6;
}

/* Close Button */
#about-close {
  position: absolute;
  top: 27px;
  right: 40px;
  font-size: 40px;
  padding: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Remove top border when listing is followed by bio */
tr.listing-row {
  border-top: 1px solid var(--border-color);
  border-bottom: none;
}

tr.listing-row:last-child {
  border-bottom: 1px solid var(--border-color);
}

tr.bio-row {
  border-top: none;
  border-bottom: none;
}

tr.bio-row:last-child {
  border-bottom: 1px solid var(--border-color);
}

.links {
  padding-left: 10px;
}

.resourceForm {
  float: left;
  margin: 0 auto;
  min-width: 30%;
  max-width: 748px;
}

label {
  font-size: 0.85em;
  color: rgb(180, 180, 180);
}

.Ainput {
  border: 1px solid white;
  background: none;
  color: white;
  outline: none;
  appearance: none;
  border-radius: 0;
  padding: 5px;
  margin-bottom: 7px;
  margin-top: 2px;
  width: 100%;
}

.submit {
  background: blue;
  border: 1px solid white;
  color: white;
  height: 40px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 10px;
}

.submit:hover {
  background: white;
  border: 1px solid white;
  color: blue;
  font-weight: 400;
}

textarea {
  resize: none;
}
