body {
  font-family: Arial, sans-serif;
  background-color: #2e2e3b;
  margin: auto;
  padding: 0;
  display: flex;
  justify-content: center; /* Center content horizontally */
  align-items: flex-start; /* Align content to the top */
  height: 100%; /* Full viewport height */
  flex-direction: column; /* Stack elements vertically */

  background-image: repeating-linear-gradient(
    45deg,
    #15151b 0px,
    #15151b 20px,
    #1b1b24 20px,
    #1b1b24 40px
  );
}

header {
  width: 100%;  
  justify-content: center;
  margin-top: 20px;
}

.site-logo {
  width: 18%;
  min-width: 10%;
  max-width: 200%;
  height: auto;
}

h1, h2 {
  text-align:center;
  color:white;
}

#header {
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Container for Form and Table */
.container {
  display: flex;
  flex-direction: column; /* Stack form and table vertically */
  flex-wrap: wrap;
  justify-content: center;  
  align-items: center; /* Center content horizontally */
  width: 100%;  
  padding: 20px;
  gap: 20px; /* Add spacing between the form and the table */
}

/* Form container with flexbox */
#cardForm {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap */

  margin-bottom: 20px;
  border-radius: 4px;

  background-color: #1a1c2b;

  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

  border: 1px solid white;
  padding: 10px;
}

/* Form fields styling */
#cardForm input[type="text"], select {
  flex: 1;
  width: calc(50% - 10px); /* Each input takes up 50% minus a little gap */
  padding: 8px;
  margin: 2px;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 10px; /* Add space between rows */
  background-color: #665c6b;
  text-align: center;
  font-weight: bold;
  color: white;  
}

input::placeholder, select::placeholder {
  color: #afafaf; 
}

.back-button {
  background-color: #1a1c2b;
  color: white;
  border: 1px solid white;
  padding: 8px 8px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 0.3s ease;
  text-decoration: none;
  display: block;
  margin: 1% auto;
  text-align: center;
  width: fit-content;
}

/* Adjust button to take full width when stacked */
#cardForm button {
  background-color: #1a1c2b;
  width: 100%;
  padding: 10px 15px;
  border: 1px solid white;
  cursor: pointer;
  border-radius: 5px;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

#cardForm button:hover {
  background-color: #3a3a4d;
  border: 1px solid #868686;
}

input[type="text"], select {
  width: 100%; /* Make form inputs take full width */
  max-width: 400px; /* Limit the width of input fields */
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.suggestions-container {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  background-color: #fff;
  position: absolute;
  width: 100%;
  z-index: 10;
  display: none; /* Hidden by default */
}

.suggestions-container div {
  padding: 8px;
  cursor: pointer;
}

.suggestions-container div:hover {
  background-color: #f0f0f0;
}



#treatmentSelect option:nth-child(odd) {
  background-color: #2c2f49; /* Darker */
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#treatmentSelect option:nth-child(even) {
  background-color: #2b2635; /* Lighter */
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}


/* Wrapper for the table body to enable scrolling */
#cardTableWrapper {
  max-height: 600px; /* Adjust this height as needed */
  overflow-y: auto;  /* Enable vertical scrolling */
  margin-top: 10px;
  border-radius: 4px;
  border: 1px solid white;
  display: block; /* Make sure table is block level to allow scrolling */
}

/* Hide scrollbar gutter and style thumb */
#cardTableWrapper::-webkit-scrollbar {
  width: 6px; /* Slim scrollbar */
  background: transparent; /* Removes gutter background */
}

#cardTableWrapper::-webkit-scrollbar-track {
  background: transparent; /* Track background hidden */
}

#cardTableWrapper::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.4); /* Light thumb */
  border-radius: 4px;
}

#cardTableWrapper::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.6); /* Slightly brighter on hover */
}

#cardTableWrapper {
  scrollbar-width: thin; /* slim bar */
  scrollbar-color: rgba(255,255,255,0.4) transparent; /* thumb and track */
}

/* Table Styling */
table {
  width: 100%;
  max-width: 990px; /* Limit the width of the table */
  table-layout: fixed; /* Prevent the table from resizing */
  margin: 0 auto; /* Center the table */
  border-collapse: collapse;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

table th {
  border-width: 0px 0px 1px 0px; /* top, right, bottom, left */
  border-style: solid;
  border-color: white;
  background-color: #1a1c2b;
  font-weight: bold;
}

table td {
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;  /* or any preferred width */
  width: 150px;  /* or any preferred width */
}

/* Table header and cell styling */
table th, table td {
  padding: 10px;
  text-align: left;
  color: white;
  text-align: center;
}

table tbody tr:nth-child(even) {
  background-color: #2c2f49; /* Slightly lighter than your base #1e1b1c */
}

table tbody tr:nth-child(odd) {
  background-color: #46394d; /* Keep this as the base */
}

/* Button styling */
button, .button {
  margin: auto;
  background-color: #1a1c2b;
  color: white;
  padding: 8px 8px;
  border: 1px solid white;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

button:hover, .button:hover {
  background-color: #3a3a4d;
  border: 1px solid #868686;
}

button:focus, .button:focus {
  outline: none;
}

#foot-notes {
  color: white;
  margin-left: 85%;
  margin-top: 1%;
  float: left;
}

#ko-fi-footer {
  float: right;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}


@media (max-width: 768px) {
  .form-wrapper,
  .container {
    flex-direction: column;
    align-items: center;
  }

  .site-logo {
    width: 60%;
  }

  h1, h2 {
    font-size: 1.4rem;
  }

  #cardForm {
    padding: 8px;
  }

  #cardForm input[type="text"],
  #cardForm select {
    width: 100%;
    font-size: 14px;
    padding: 6px;
  }

  #cardForm button {
    font-size: 14px;
    padding: 8px;
  }

  button, .button {
    font-size: 13px;
    padding: 6px 8px;
  }

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

  table th, table td {
    padding: 8px;
    font-size: 13px;
  }

  #cardTableWrapper {
    max-height: 300px;
  }

  #foot-notes {
    margin-left: auto;
    margin-top: 40px;
    text-align: right;
    font-size: 12px;
  }
}
