#categoryTabContent a.nav-link[aria-expanded='true'] i.bi-chevron-down {
  transform: rotate(180deg);
}

#categoryTab a.nav-link.active {
  background-color: #377dff;
  color: #ffffff;
}

@media only screen and (max-width: 768px) {
  #foundations-middle-column {
    border: none !important;
  }
}

.grant-content {
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.grant-content:after {
  content: '...';
  position: absolute;
  right: 0;
  bottom: 0;
  background: white;
  padding-left: 10px;
}

.legacy-grant-card {
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  margin-bottom: 20px;
}

.legacy-grant-card:hover {
  transform: translateY(-5px);
}

.legacy-grant-card .card-body {
  padding: 20px;
  background-color: #ffffff;
  border-radius: 10px;
}

.legacy-grant-card .card-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #343a40;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Foundation Name Styling */
.legacy-grant-card .foundation-name {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 10px;
}

/* Deadline Styling */
.legacy-grant-card .deadline {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 15px;
}

/* Content Styling */
.legacy-grant-card .grant-content {
  font-size: 1rem;
  color: #495057;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* Amount Styling */
.legacy-grant-card .amount {
  font-size: 1rem;
  font-weight: bold;
  color: #28a745;
  margin-bottom: 20px;
}

/* Link Styling */
.legacy-grant-card .card-link {
  font-size: 0.9rem;
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

.legacy-grant-card .card-link:hover {
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
  .legacy-grant-card {
    margin-bottom: 15px;
  }
}

.legacy-grant-card-top {
  min-height: 100px;
}

/* Testimonal slider - landing page */
.carousel img {
  width: 70px;
  max-height: 70px;
  border-radius: 50%;
  margin-right: 1rem;
  overflow: hidden;
}

.carousel-inner {
  padding: 1em;
}

@media screen and (min-width: 576px) {
  .carousel-inner {
    display: flex;
    width: 90%;
    margin-inline: auto;
    padding: 1em 0;
    overflow: hidden;
  }
  .carousel-item {
    display: block;
    margin-right: 0;
    flex: 0 0 calc(100% / 2);
  }
}

@media screen and (min-width: 768px) {
  .carousel-item {
    display: block;
    margin-right: 0;
    flex: 0 0 calc(100% / 3);
  }
}

.carousel .card {
  margin: 0 0.5em;
  border: 0;
}

.carousel-control-prev,
.carousel-control-next {
  width: 3rem;
  height: 3rem;
  background-color: grey;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}

/* Grants Table */
#grantsTable {
  font-size: 0.9rem;
}

#grantsTable th:nth-child(1) {
  white-space: normal;
  word-wrap: break-word;
  /* max-width: 300px; */
}

#grantsTable tr td:nth-child(3) {
  white-space: normal;
  word-wrap: break-word;
  /* max-width: 300px; */
}

.states-container {
  height: calc(100vh - 300px); /* Dynamic height based on viewport */
  min-height: 400px; /* Minimum height */
  max-height: 800px; /* Maximum height to prevent excessive growth */
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.5rem;
  background-color: #fff;
}

/* Alternative: Match the foundations card height exactly */
@media (min-width: 992px) {
  .states-container {
    height: fit-content;
    max-height: calc(100vh - 250px);
  }

  /* Make the states container match the table card */
  .col-lg-2 {
    display: flex;
    flex-direction: column;
  }

  .states-container {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
}

.state-link {
  display: block !important;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: #495057;
  transition: all 0.15s ease-in-out;
  font-weight: 400;
}

.state-link:hover {
  background-color: #f8f9fa;
  color: #377dff;
  text-decoration: none;
  transform: translateX(2px);
}

.state-link.active,
.state-link[aria-current='page'] {
  background-color: #377dff;
  color: #ffffff;
  font-weight: 600;
}

.state-link.active:hover {
  background-color: #2968e4;
  color: #ffffff;
  transform: none;
}

.states-container::-webkit-scrollbar {
  width: 8px;
}

.states-container::-webkit-scrollbar-track {
  background: #f1f3f4;
  border-radius: 4px;
}

.states-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.states-container::-webkit-scrollbar-thumb:hover {
  background: #377dff;
}

.sortable-header {
  cursor: pointer !important;
  user-select: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.sortable-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 2px 4px;
  text-decoration: none !important;
}

.sortable-header i {
  font-size: 0.75em;
  transition: opacity 0.2s ease;
}

.sortable-header:hover i {
  opacity: 1 !important;
}

/* Active sort styling */
th:has(.sortable-header i.bi-chevron-up),
th:has(.sortable-header i.bi-chevron-down) {
  background-color: rgba(13, 110, 253, 0.1);
}

th:has(.sortable-header i.bi-chevron-up) .sortable-header i,
th:has(.sortable-header i.bi-chevron-down) .sortable-header i {
  color: #0d6efd;
  opacity: 1 !important;
}
