/* Server Cards Container */
.serverCardsContainer {
  max-width: 100%;
  margin: 2rem 0;
}

/* Search and Filter Controls */
.cardControls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--ifm-background-surface-color);
  border-radius: 8px;
  border: 1px solid var(--ifm-color-emphasis-300);
}

.cardControlsSearch {
  flex: 1;
  min-width: 300px;
}

.searchInput {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ifm-color-emphasis-300);
  border-radius: 6px;
  font-size: 0.9rem;
  background-color: var(--ifm-background-color);
  color: var(--ifm-font-color-base);
  transition: border-color 0.2s ease;
}

.searchInput:focus {
  outline: none;
  border-color: var(--ifm-color-primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 187, 0.1);
}

.cardControlsFilters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.cardControlsFilterGroup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.cardControlsSelect {
  padding: 0.5rem 0.75rem;
  padding-right: 2rem;
  border: 1px solid var(--ifm-color-emphasis-300);
  border-radius: 6px;
  background-color: var(--ifm-background-color);
  color: var(--ifm-font-color-base);
  font-size: 0.875rem;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M4.5 6l3.5 3.5L11.5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

.cardControlsSelect:focus {
  outline: none;
  border-color: var(--ifm-color-primary);
}

/* Results Stats */
.cardStats {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--ifm-color-emphasis-600);
}

.cardStatsCount {
  font-weight: 600;
  color: var(--ifm-color-primary);
}

/* Card Grid Layout */
.cardGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  justify-content: center;
}

/* Always use two columns on wide screens */
@media screen and (min-width: 1200px) {
  .cardGrid {
    grid-template-columns: repeat(2, calc(50% - 0.5rem));
    max-width: 1080px;
    margin: 0 auto;
  }
}

/* Single column on smaller screens */
@media screen and (max-width: 768px) {
  .cardGrid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .cardControls {
    flex-direction: column;
    align-items: stretch;
  }

  .cardControlsSearch {
    min-width: auto;
  }

  .cardControlsFilters {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Individual Card Styles */
.serverCardLink {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
}

.serverCard {
  display: flex;
  flex-direction: column;
  background-color: var(--ifm-background-color);
  border: 1px solid var(--ifm-color-emphasis-300);
  border-radius: 6px;
  padding: .9rem;
  transition: all 0.2s ease;
  height: 150px; /* Reduced from 185px to 150px */
  width: 100%; /* Ensure the card takes full width of its grid cell */
  cursor: pointer;
}

.serverCard:hover {
  border-color: var(--ifm-color-primary-light);
  transform: translateY(-2px);
}

/* Card Header */
.serverCardHeader {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem; /* Reduced from 0.5rem to 0.3rem */
  min-height: 2rem;
}

.serverCardIcon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1.2rem;
}

.serverCardTitleSection {
  margin-top: .35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.serverCardTitle {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  color: var(--ifm-heading-color);
}

.serverCardTags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.1rem;
  align-items: center;
}

.serverCardCategory {
  display: inline-block;
  padding: 0.15rem 0.2rem;
  background-color: var(--ifm-menu-color-background-active);
  font-size: 0.6rem;
  font-weight: 500;
  border-radius: 3px;
  letter-spacing: 0;
  width: fit-content;
}


/* Card Content */
.serverCardContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent content from expanding the card */
}

.serverCardDescription {
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--ifm-font-color-base);
  opacity: 0.85;
  margin-top: 0.5rem;
  margin-bottom: 0rem; /* Reduced from 0.3rem to 0.2rem */
  margin-left: 32px;
  flex: 1;
  height: 2.6rem; /* Reduced from 3.8rem to 2.6rem */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Reduced from 3 lines to 2 lines */
  -webkit-box-orient: vertical;
}

/* Workflow Tags */
.serverCardWorkflow {
  display: inline-block;
  padding: 0.15rem 0.2rem;
  background-color: var(--ifm-menu-color-background-active);
  color: var(--ifm-font-color-base);
  font-size: 0.6rem;
  font-weight: 500;
  border-radius: 3px;
  letter-spacing: 0;
  white-space: nowrap;
  width: fit-content;
}

/* Empty State */
.cardGridEmpty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--ifm-color-emphasis-600);
}

.cardGridEmptyTitle {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ifm-color-emphasis-700);
}

.cardGridEmptyMessage {
  font-size: 0.875rem;
}

/* Accessibility Improvements */
.serverCard:focus-within {
  outline: 2px solid var(--ifm-color-primary);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .serverCard {
    transition: none;
  }

  .serverCard:hover {
    transform: none;
  }
}
