/* List Cards Styling - Dense, Accordion Layout */

.list-cards-container {
  width: 100%;
  margin-top: 20px;
}

/* Individual List Card */
.list-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  overflow: hidden;
}

.list-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.list-card.expanded {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Card Header - Collapsed View (2-5 lines with description) */
.list-card-header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 60px;
  user-select: none;
}

.list-card-header:hover {
  background: #f8f9fa;
}

.list-card.expanded .list-card-header {
  background: #f0f7ff;
  border-bottom: 1px solid #e0e0e0;
}

/* Card Main Content - Name and Primary Info */
.list-card-main {
  flex: 1;
  min-width: 0; /* Allow text truncation */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Card Name - Prominent */
.list-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #007bff;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.list-card-name:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Card Meta Info Line - Identifier + Ontological Scope */
.list-card-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.875rem;
  color: #6c757d;
  flex-wrap: wrap;
}

/* Description Preview - Truncated to 2 lines */
.list-card-description-preview {
  margin-top: 6px;
  font-size: 0.875rem;
  color: #6c757d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-card-meta-label {
  font-weight: 600;
  color: #495057;
}

.list-card-meta-value {
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Field Count Badge */
.list-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.list-card-badge i {
  font-size: 0.7rem;
}

/* Expand/Collapse Icon */
.list-card-expand-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f0f0;
  color: #495057;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.list-card-expand-icon i {
  transition: transform 0.3s ease;
}

.list-card.expanded .list-card-expand-icon i {
  transform: rotate(180deg);
}

.list-card-header:hover .list-card-expand-icon {
  background: #007bff;
  color: white;
}

/* Card Body - Expanded View */
.list-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}

.list-card.expanded .list-card-body {
  max-height: 1000px;
  padding: 16px;
}

/* Field Grid in Expanded View */
.list-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.list-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-card-field-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.list-card-field-value {
  color: #2c3e50;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.list-card-field-value.empty {
  color: #adb5bd;
  font-style: italic;
}

/* Full width fields (like descriptions) */
.list-card-field.full-width {
  grid-column: 1 / -1;
}

/* Empty State */
.list-cards-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.list-cards-empty i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: #adb5bd;
}

/* Sort and Filter Controls */
.list-cards-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.list-cards-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-cards-sort-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 600;
}

.list-cards-sort select {
  font-size: 0.875rem;
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  color: #495057;
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 992px) {
  .list-card-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .list-card-field.full-width {
    grid-column: 1;
  }

  .list-card-meta-value {
    max-width: 150px;
  }
}

@media (max-width: 768px) {
  .list-card-header {
    padding: 10px 12px;
    gap: 8px;
    min-height: 50px;
  }

  .list-card-name {
    font-size: 1rem;
  }

  .list-card-meta {
    font-size: 0.8rem;
    gap: 8px;
  }

  .list-card-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .list-card-expand-icon {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 576px) {
  .list-card {
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .list-card-header {
    flex-wrap: wrap;
  }

  .list-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }

  .list-card-meta-item {
    width: 100%;
  }

  .list-card-meta-value {
    max-width: none;
  }
}

/* Print Styles */
@media print {
  .list-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    margin-bottom: 8px;
    page-break-inside: avoid;
  }

  .list-card-expand-icon {
    display: none;
  }

  .list-card-body {
    max-height: none !important;
    padding: 12px !important;
  }
}
