.list {
  width: 100%;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.list.no-pagination {
  padding-bottom: 32px;
}

/* List Header with Search */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}

.header-content {
  flex: 1;
}

.pagination-size-container {
  margin-top: 16px;
}

.pagination-size-container .multi-select-wrapper {
  min-width: 50px;
  max-width: 70px;
}

.pagination-size-container .multi-select-header {
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
}

.search-container {
  position: relative;
  min-width: 300px;
}

.filter-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Multi-select styling */
.multi-select-wrapper {
  position: relative;
  min-width: 150px;
}

.multi-select-header {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.multi-select-header:hover {
  border-color: var(--primary);
}

.multi-select-header:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.multi-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.option-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.option-item:hover {
  background-color: #f8f9fa;
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.option-item label {
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  margin: 0;
}

.filter-select {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  min-width: 120px;
  width: 100%;
  transition: all 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--muted);
  pointer-events: none;
}

/* QR Grid Layout */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* QR Card Styling */
.qr-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.qr-preview {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
}

.qr-preview img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.qr-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-height: 0; /* Allow flex items to shrink */
}

.qr-info-left {
  flex: 1;
}

.qr-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  /* Allow natural multi-line wrapping */
  max-height: none;
  overflow: visible;
  display: block;
  cursor: default;
}

.qr-slug {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 8px 0;
  font-family: 'Courier New', monospace;
}

.qr-date {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.qr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
  max-width: 120px; /* Limit width to prevent overflow */
  flex-shrink: 0; /* Don't shrink tags area */
}

.qr-tags .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.qr-tags .no-tags {
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
}

.qr-scans {
  font-size: 13px;
  color: var(--primary);
  margin: 4px 0 0 0;
  font-weight: 500;
}

.qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.action-btn span {
  font-size: 14px;
}

.action-btn.primary {
  background: var(--primary);
  color: white;
}

.action-btn.primary:hover {
  background: #0a4a7a;
}

.action-btn.secondary {
  background: #f1f3f4;
  color: var(--text);
  border: 1px solid var(--border);
}

.action-btn.secondary:hover {
  background: #e8eaed;
}

.action-btn.danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.action-btn.danger:hover {
  background: #fee2e2;
}

.delete-form {
  display: contents;
}

/* No Results Styling */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  color: var(--text);
}

.no-results p {
  margin: 0 0 24px 0;
  font-size: 16px;
}

.create-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
}

.create-btn:hover {
  background: #0a4a7a;
}

/* Pagination Styling */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 32px 0;
  padding: 16px 0;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-pages {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-ellipsis {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .list-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-container {
    min-width: auto;
  }
  
  .qr-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .qr-info {
    flex-direction: column;
    align-items: stretch;
  }
  
  .qr-tags {
    justify-content: flex-start;
    margin-top: 8px;
  }
  
  .qr-actions {
    flex-direction: column;
  }
  
  .action-btn {
    flex: none;
  }
  
  .pagination {
    gap: 6px;
    margin: 24px 0;
  }
  
  .pagination-btn {
    padding: 6px 8px;
    font-size: 13px;
    min-width: 32px;
    height: 32px;
  }
  
  .pagination-pages {
    gap: 2px;
  }
  
  .pagination-ellipsis {
    padding: 6px 2px;
    font-size: 13px;
  }
  
  .multi-select-wrapper {
    min-width: 120px;
  }
  
  .multi-select-header {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .multi-select-options {
    max-height: 150px;
  }
  
  .option-item {
    padding: 6px 12px;
  }
  
  .option-item label {
    font-size: 13px;
  }
}

/* Legacy table styles (hidden) */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

td img {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
}