/* Parts Section Styles */

.parts-section {
  margin-top: 24px;
  border-top: 1px solid #e0e0e0;
  padding-top: 16px;
}

.parts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.parts-header h4 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.parts-list-container {
  max-height: 500px;
  overflow-y: auto;
  border-radius: 4px;
  background-color: #fafafa;
}

.placeholder-text {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 24px;
  margin: 0;
  font-size: 14px;
}

/* Parts List Table */

.parts-list {
  padding: 12px;
}

.parts-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.parts-filter form {
  flex: 1;
  display: flex;
  align-items: center;
}

.filter-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.filter-input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}

.parts-table th {
  background-color: #f5f5f5;
  padding: 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
  color: #333;
}

.parts-table td {
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
  word-break: break-word;
}

.parts-table tbody tr {
  transition: background-color 0.2s;
}

.parts-table tbody tr:hover {
  background-color: #f9f9f9;
}

/* Part actions in table */

.part-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 3px;
  transition: all 0.2s;
  color: #333;
}

.btn-icon:hover {
  background-color: #e0e0e0;
  transform: scale(1.1);
}

.btn-icon.delete:hover {
  background-color: #ffebee;
  color: #d32f2f;
}

.no-results {
  text-align: center;
  color: #999;
  padding: 16px;
  margin: 0;
  font-size: 14px;
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 6px 10px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s;
  min-width: 32px;
  text-align: center;
}

.pagination-btn:hover:not(.active):not(:disabled) {
  background-color: #f5f5f5;
  border-color: #999;
}

.pagination-btn.active {
  background-color: #1976d2;
  color: white;
  border-color: #1976d2;
  font-weight: 600;
}

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

/* Parts count display */

.parts-count {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* Part detail container */

.part-detail-container {
  padding: 0;
}

.part-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.part-detail-header h3 {
  margin: 0;
  font-size: 18px;
}

/* Part edit form container */

.part-edit-form-container {
  padding: 0;
}

.part-edit-form-container h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
}

/* Value display in detail view */

.value {
  padding: 6px 0;
  color: #333;
}

/* Outlined buttons styling */

.outlined.small {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}

.outlined.dim {
  opacity: 0.7;
}

.outlined.dim:hover {
  opacity: 1;
}

/* Loading indicator during htmx swap */

.htmx-swapping .parts-list {
  opacity: 0.5;
  transition: opacity 0.2s;
}

/* Responsive adjustments */

@media (max-width: 768px) {
  .parts-filter {
    flex-direction: column;
    gap: 8px;
  }

  .parts-filter form {
    width: 100%;
  }

  .filter-input {
    width: 100%;
  }

  .parts-list-container {
    max-height: 300px;
  }

  .parts-table {
    font-size: 12px;
  }

  .parts-table th,
  .parts-table td {
    padding: 6px;
  }

  .part-actions {
    gap: 2px;
  }

  .btn-icon {
    padding: 2px 4px;
    font-size: 14px;
  }
}
