html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* This will prevent any unintentional horizontal scrolling */
}

/* Diseases Showcase Section */

#showcase-disease {
  color: #fff;
  background: #333;
  padding: 4rem 1rem; /* Increase top padding for space from the nav */
  border-top: 5px solid #002d56;
  border-bottom: 5px solid #cc9138;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#showcase-disease::before {
  content: "";
  background: url("../img/diseasestates169.jpg") no-repeat center center/cover;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

#showcase-disease .showcase-content {
  z-index: 1;
  text-align: center;
}

#showcase-disease .showcase-content p {
  margin-bottom: 1rem;
}

/* The switch - the box around the slider */
#showcase-disease .switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
#showcase-disease .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
/* The slider */
#showcase-disease .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

#showcase-disease .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

#showcase-disease input:checked + .slider {
  background-color: var(--primary-color);
}

#showcase-disease input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

#showcase-disease input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
#showcase-disease .slider.round {
  border-radius: 34px;
}

#showcase-disease .slider.round:before {
  border-radius: 50%;
}

/* Style for the search field when loading */
#diseaseSearch.loading {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

/* Optional: Add a loading indicator */
#diseaseSearch.loading::placeholder {
  color: #6c757d;
}

/* Styling for no results message */
#diseaseList li p.no-results {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

#diseaseSearch {
  text-align: center;
  width: 90%; /* Increased width for mobile */
  max-width: 600px;
  height: 40px;
  border-radius: 0.25rem;
  border: none;
  box-sizing: border-box; /* Include padding in width calculation */
}

header.sticky {
  position: sticky;
  top: 0px;
  z-index: 1020;
}

#disease-contact-disclaimer {
  text-align: center;
  color: white;
  background-color: var(--bs-primary);
  padding: 15px 20px; /* Reduced padding */
  width: 100%; /* Ensure full width */
  box-sizing: border-box; /* Include padding in width calculation */
}

.showcase-content .btn-group {
  margin-top: 10px;
}

#disease-query-container {
  width: auto;
  margin: auto;
}

.diseaseStateCardsContainer {
  padding: 0rem;
}

#diseaseList {
  /* Remove default list styling */
  list-style-type: none;
  padding: 0;
  margin: 0;

  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(280px, 1fr)
  ); /* Further reduced for mobile */
  grid-auto-rows: auto;
  grid-gap: 0.5rem; /* Added small gap for better layout */
  align-items: stretch;
  margin: 0 auto;
  width: 100%; /* Ensure full width */
  box-sizing: border-box; /* Include padding in width calculation */
}

#diseaseList li {
  border: 1px solid #ddd; /* Add a border to all links */
  margin-top: 0; /* Changed from -1px to avoid overlapping borders with grid gap */
  background-color: #f6f6f6; /* Grey background color */
  padding: 12px; /* Add some padding */
  padding-left: 20px;
  padding-right: 20px;
  text-decoration: none; /* Remove default text underline */
  font-size: 18px; /* Increase the font-size */
  color: black; /* Add a black text color */

  display: block;
  text-align: center;
}

#diseaseList li p {
  margin: 0;
}

#diseaseList li:hover:not(.header) {
  background-color: #eee; /* Add a hover effect to all links, except for headers */
}

.drug-drug-p {
  font-weight: bold;
}

.drug-disease-p {
  color: rgb(80, 80, 80);
  font-size: 16px;
}

#diseaseStateCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: auto;
  grid-gap: 0.5rem; /* Added small gap for better layout */
  align-items: stretch;
  margin: 0 auto;
  padding: 0 0.5rem; /* Added small padding on sides for mobile */
}

#diseaseStateCards * {
  box-sizing: border-box;
}

.disease-card {
  background-color: #f8f8ff;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: 0.3s;
  transition: transform 0.2s;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  word-wrap: break-word;
}

.disease-card > .disease-card-content {
  text-align: left;
  color: var(--btn-color);
  padding: 2px 16px;
  flex-grow: 1;
  position: relative;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.disease-card > .disease-footer {
  background-color: var(--btn-color);
}

.disease-card > .disease-footer > a {
  display: block;
  padding: 10px;
  padding-top: 15px;
  color: rgb(0, 0, 0);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.disease-card img {
  display: none;
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

.disease-card:hover {
  cursor: pointer;
  transform: scale(1);
  background: white; /* fallback */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.disease-card:hover img {
  display: block;
  opacity: 0.4;
}

.disease-card-image-wrapper {
  background: rgba(0, 0, 0, 1);
}

.disease-card-text-wrapper {
  position: relative;
  z-index: 10;
}

.disease-card-text-wrapper > h1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.disease-card-text-wrapper > p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.disease-card:hover .disease-card-bg-overlay {
  display: block;
}

.disease-card-bg-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.disease-card:hover .disease-card-content {
  color: white;
}

.disease-card .disease-card-content h1 {
  padding-top: 16px;
  font-size: 1.75rem;
  font-weight: bold;
}

.disease-card:hover .disease-footer {
  display: block;
}

.disease-card .disease-footer {
  display: none;
}

/* Media queries for responsive design */
@media (max-width: 1199.98px) {
  /* Fixes for hamburger menu */
  .navbar-toggler {
    margin-right: 15px;
  }

  .navbar-brand {
    margin-left: 15px;
  }

  /* Fix width issues */
  #disease-body {
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling */
  }

  /* Ensure container is properly sized */
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }
}

@media (max-width: 991.98px) {
  /* Medium screen adjustments */
  #diseaseSearch {
    width: 80%;
  }
}

@media (max-width: 767.98px) {
  /* Small screen adjustments */
  #diseaseList {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  #diseaseSearch {
    width: 90%;
  }

  .disease-card .disease-card-content h1 {
    font-size: 1.5rem;
  }

  #disease-contact-disclaimer {
    padding: 15px 20px;
  }
}

@media (max-width: 575.98px) {
  /* Extra small screen adjustments */
  #diseaseList {
    grid-template-columns: 1fr; /* Single column for very small screens */
    width: 100%;
  }

  #diseaseStateCards {
    grid-template-columns: 1fr; /* Single column for very small screens */
    width: 100%;
  }

  .disease-card {
    min-height: 150px; /* Reduced height for mobile */
    padding: 10px; /* Add padding for better spacing */
  }

  .disease-card .disease-card-content h1 {
    font-size: 1.25rem;
    padding-top: 10px;
  }

  #disease-contact-disclaimer {
    padding: 10px 15px;
    font-size: 0.9rem; /* Smaller text on tiny screens */
  }

  #showcase-disease {
    padding: 1.5rem 0.5rem;
    padding-top: 4rem; /* Add padding to the top to avoid being covered by the nav bar */
  }

  /* Fix the button sizing */
  .showcase-content .btn-group {
    display: flex;
    width: 100%;
    max-width: 280px;
    margin: 10px auto;
  }

  .showcase-content .btn-group .btn {
    flex: 1;
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
  }

  /* Adjust the list items */
  #diseaseList li {
    padding: 10px;
    font-size: 16px;
  }
}
