/* ========== コレクション選択UI モジュール ========== */

/* コレクション選択コンテナ */
.collection-toggle {
  margin: 12px 0;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-wrapper input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.1);
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 3px;
  margin-right: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
  background-color: #2563eb;
  border-color: #2563eb;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 12px;
  top: -2px;
  left: 2px;
}

.checkbox-label {
  font-weight: 500;
  color: #333;
}

/* コレクション選択オプション */
.collection-options-container {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}

.collection-selector {
  margin-bottom: 16px;
}

.collection-levels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.collection-level {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.collection-level label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.collection-level select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.collection-level select:disabled {
  background-color: #f5f5f5;
  color: #999;
}

.selected-collection-path {
  margin-top: 12px;
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 4px;
  border-left: 4px solid #2196f3;
  font-size: 14px;
}

.selected-collection-path span {
  color: #1976d2;
  font-family: monospace;
}

/* スニペット一覧 */
.available-snippets {
  margin-top: 16px;
}

.available-snippets h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #333;
}

.snippets-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

.snippet-item {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.snippet-item:last-child {
  border-bottom: none;
}

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

.snippet-checkbox {
  margin-right: 12px;
  margin-top: 2px;
  transform: scale(1.1);
}

.snippet-content {
  flex: 1;
}

.snippet-text {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
  color: #333;
}

.snippet-meta {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.snippet-type-badge {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.snippet-source {
  color: #888;
}

.snippets-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

/* 空状態 */
.snippets-empty {
  padding: 24px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .collection-levels {
    gap: 8px;
  }
  
  .collection-options-container {
    padding: 12px;
  }
  
  .snippet-item {
    padding: 8px;
  }
  
  .snippets-actions {
    flex-direction: column;
  }
  
  .btn-small {
    width: 100%;
  }
}
